diff --git a/.coderabbit.yaml b/.coderabbit.yaml index ec2953a161..42b705b571 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -8,4 +8,10 @@ reviews: base_branches: - main - 1.6.x - - 1.7.x \ No newline at end of file + - 1.7.x + - 1.8.x + high_level_summary: false + poem: false + sequence_diagrams: false + collapse_walkthrough: true + changed_files_summary: false diff --git a/.env b/.env index d7aa8b8d9e..76af83a946 100644 --- a/.env +++ b/.env @@ -22,6 +22,7 @@ _APP_OPTIONS_FORCE_HTTPS=disabled _APP_OPTIONS_ROUTER_FORCE_HTTPS=disabled _APP_OPENSSL_KEY_V1=your-secret-key _APP_DOMAIN=traefik +_APP_CONSOLE_DOMAIN=localhost _APP_DOMAIN_FUNCTIONS=functions.localhost _APP_DOMAIN_SITES=sites.localhost _APP_DOMAIN_TARGET_CNAME=test.localhost @@ -84,8 +85,9 @@ _APP_COMPUTE_MAINTENANCE_INTERVAL=600 _APP_COMPUTE_RUNTIMES_NETWORK=runtimes _APP_EXECUTOR_SECRET=your-secret-key _APP_EXECUTOR_HOST=http://exc1/v1 -_APP_FUNCTIONS_RUNTIMES=php-8.0,node-18.0,python-3.9,ruby-3.1 -_APP_SITES_RUNTIMES=static-1,node-22,flutter-3.29 +_APP_BROWSER_HOST=http://appwrite-browser:3000/v1 +_APP_FUNCTIONS_RUNTIMES=node-22 +_APP_SITES_RUNTIMES=static-1,node-22 _APP_MAINTENANCE_INTERVAL=86400 _APP_MAINTENANCE_START_TIME=12:00 _APP_MAINTENANCE_RETENTION_CACHE=2592000 diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 6d73787d00..62b4953e27 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -64,8 +64,9 @@ jobs: sudo wget -O /usr/share/keyrings/azlux-archive-keyring.gpg https://azlux.fr/repo.gpg sudo apt update sudo apt install oha + oha --version - name: Benchmark PR - run: 'oha -z 180s http://localhost/v1/health/version -j > benchmark.json' + run: 'oha -z 180s http://localhost/v1/health/version --output-format json > benchmark.json' - name: Cleaning run: docker compose down -v - name: Installing latest version @@ -78,7 +79,7 @@ jobs: docker compose up -d sleep 10 - name: Benchmark Latest - run: oha -z 180s http://localhost/v1/health/version -j > benchmark-latest.json + run: oha -z 180s http://localhost/v1/health/version --output-format json > benchmark-latest.json - name: Prepare comment run: | echo '## :sparkles: Benchmark results' > benchmark.txt diff --git a/.github/workflows/sdk-preview.yml b/.github/workflows/sdk-preview.yml index 8abe2c2f91..e317845768 100644 --- a/.github/workflows/sdk-preview.yml +++ b/.github/workflows/sdk-preview.yml @@ -47,7 +47,7 @@ jobs: node-version: 20 - name: Build and Publish SDK - working-directory: ./app/sdks/${{ steps.set-sdk.outputs.platform }}-${{ steps.set-sdk.outputs.sdk_type }} + working-directory: ./app/sdks/console-web run: | npm install npm run build diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6fd4e89858..9ea04f596c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -178,6 +178,7 @@ jobs: - name: Load and Start Appwrite run: | docker load --input /tmp/${{ env.IMAGE }}.tar + sed -i 's|^_APP_BROWSER_HOST=.*|_APP_BROWSER_HOST=http://invalid-browser/v1|' .env docker compose up -d sleep 30 @@ -198,7 +199,7 @@ jobs: docker compose exec -T \ -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ - appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --exclude=devKeys + appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --exclude-group devKeys,screenshots e2e_shared_mode_test: name: E2E Shared Mode Service Test @@ -277,14 +278,12 @@ jobs: docker compose exec -T \ -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ - appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --exclude=devKeys + appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug --exclude-group devKeys,screenshots e2e_dev_keys: name: E2E Service Test (Dev Keys) runs-on: ubuntu-latest needs: setup - strategy: - fail-fast: false steps: - name: checkout uses: actions/checkout@v4 @@ -360,3 +359,85 @@ jobs: -e _APP_DATABASE_SHARED_TABLES \ -e _APP_DATABASE_SHARED_TABLES_V1 \ appwrite test /usr/src/code/tests/e2e/Services/Projects --debug --group=devKeys + + e2e_screenshots_keys: + name: E2E Service Test (Site Screenshots) + runs-on: ubuntu-latest + needs: setup + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: Load Cache + uses: actions/cache@v4 + with: + key: ${{ env.CACHE_KEY }} + path: /tmp/${{ env.IMAGE }}.tar + fail-on-cache-miss: true + + - name: Load and Start Appwrite + run: | + docker load --input /tmp/${{ env.IMAGE }}.tar + sed -i 's/_APP_OPTIONS_ABUSE=disabled/_APP_OPTIONS_ABUSE=enabled/' .env + docker compose up -d + sleep 30 + + - name: Run Site tests with browser connected in dedicated table mode + run: | + echo "Keeping original value of _APP_BROWSER_HOST" + echo "Using project tables" + export _APP_DATABASE_SHARED_TABLES= + export _APP_DATABASE_SHARED_TABLES_V1= + + docker compose exec -T \ + -e _APP_DATABASE_SHARED_TABLES \ + -e _APP_DATABASE_SHARED_TABLES_V1 \ + appwrite test /usr/src/code/tests/e2e/Services/Sites --debug --group=screenshots + + e2e_screenshots_shared_mode: + name: E2E Shared Mode Service Test (Site Screenshots) + runs-on: ubuntu-latest + needs: [ setup, check_database_changes ] + if: needs.check_database_changes.outputs.database_changed == 'true' + strategy: + fail-fast: false + matrix: + tables-mode: [ + 'Shared V1', + 'Shared V2', + ] + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: Load Cache + uses: actions/cache@v4 + with: + key: ${{ env.CACHE_KEY }} + path: /tmp/${{ env.IMAGE }}.tar + fail-on-cache-miss: true + + - name: Load and Start Appwrite + run: | + docker load --input /tmp/${{ env.IMAGE }}.tar + sed -i 's/_APP_OPTIONS_ABUSE=disabled/_APP_OPTIONS_ABUSE=enabled/' .env + docker compose up -d + sleep 30 + + - name: Run Site tests with browser connected in ${{ matrix.tables-mode }} table mode + run: | + echo "Keeping original value of _APP_BROWSER_HOST" + if [ "${{ matrix.tables-mode }}" == "Shared V1" ]; then + echo "Using shared tables V1" + export _APP_DATABASE_SHARED_TABLES=database_db_main + export _APP_DATABASE_SHARED_TABLES_V1=database_db_main + elif [ "${{ matrix.tables-mode }}" == "Shared V2" ]; then + echo "Using shared tables V2" + export _APP_DATABASE_SHARED_TABLES=database_db_main + export _APP_DATABASE_SHARED_TABLES_V1= + fi + + docker compose exec -T \ + -e _APP_DATABASE_SHARED_TABLES \ + -e _APP_DATABASE_SHARED_TABLES_V1 \ + appwrite test /usr/src/code/tests/e2e/Services/Sites --debug --group=screenshots diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7746ef99af..277a509447 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -415,8 +415,8 @@ In addition, you will also need to add some logic to the `reduce()` method of th ```php case $document->getCollection() === 'buckets': - $files = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{bucketInternalId}', $document->getInternalId(), METRIC_BUCKET_ID_FILES))); - $storage = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{bucketInternalId}', $document->getInternalId(), METRIC_BUCKET_ID_FILES_STORAGE))); + $files = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{bucketInternalId}', $document->getSequence(), METRIC_BUCKET_ID_FILES))); + $storage = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{bucketInternalId}', $document->getSequence(), METRIC_BUCKET_ID_FILES_STORAGE))); if (!empty($files['value'])) { $metrics[] = [ @@ -463,9 +463,9 @@ $queueForStatsUsage ->addMetric(METRIC_BUILDS, 1) ->addMetric(METRIC_BUILDS_STORAGE, $build->getAttribute('size', 0)) ->addMetric(METRIC_BUILDS_COMPUTE, (int)$build->getAttribute('duration', 0) * 1000) - ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_BUILDS), 1) - ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_BUILDS_STORAGE), $build->getAttribute('size', 0)) - ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_BUILDS_COMPUTE), (int)$build->getAttribute('duration', 0) * 1000) + ->addMetric(str_replace('{functionInternalId}', $function->getSequence(), METRIC_FUNCTION_ID_BUILDS), 1) + ->addMetric(str_replace('{functionInternalId}', $function->getSequence(), METRIC_FUNCTION_ID_BUILDS_STORAGE), $build->getAttribute('size', 0)) + ->addMetric(str_replace('{functionInternalId}', $function->getSequence(), METRIC_FUNCTION_ID_BUILDS_COMPUTE), (int)$build->getAttribute('duration', 0) * 1000) ->setProject($project) ->trigger(); ``` diff --git a/README-CN.md b/README-CN.md index 3aee63993e..f3571c54ce 100644 --- a/README-CN.md +++ b/README-CN.md @@ -72,7 +72,7 @@ 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:1.7.3 + appwrite/appwrite:1.7.4 ``` ### Windows @@ -84,7 +84,7 @@ 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:1.7.3 + appwrite/appwrite:1.7.4 ``` #### PowerShell @@ -94,7 +94,7 @@ 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:1.7.3 + appwrite/appwrite:1.7.4 ``` 运行后,可以在浏览器上访问 http://localhost 找到 Appwrite 控制台。在非 Linux 的本机主机上完成安装后,服务器可能需要几分钟才能启动。 diff --git a/README.md b/README.md index 2c76f27e13..07e8464ea0 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ 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:1.7.3 + appwrite/appwrite:1.7.4 ``` ### Windows @@ -93,7 +93,7 @@ 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:1.7.3 + appwrite/appwrite:1.7.4 ``` #### PowerShell @@ -103,7 +103,7 @@ 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:1.7.3 + appwrite/appwrite:1.7.4 ``` Once the Docker installation is complete, go to http://localhost to access the Appwrite console from your browser. Please note that on non-Linux native hosts, the server might take a few minutes to start after completing the installation. diff --git a/app/cli.php b/app/cli.php index 9517347420..86ec241c93 100644 --- a/app/cli.php +++ b/app/cli.php @@ -125,13 +125,13 @@ CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getInternalId()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database ->setSharedTables(false) ->setTenant(null) - ->setNamespace('_' . $project->getInternalId()); + ->setNamespace('_' . $project->getSequence()); } return $database; @@ -145,13 +145,13 @@ CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getInternalId()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database ->setSharedTables(false) ->setTenant(null) - ->setNamespace('_' . $project->getInternalId()); + ->setNamespace('_' . $project->getSequence()); } $database @@ -167,7 +167,7 @@ CLI::setResource('getLogsDB', function (Group $pools, Cache $cache) { return function (?Document $project = null) use ($pools, $cache, $database) { if ($database !== null && $project !== null && !$project->isEmpty() && $project->getId() !== 'console') { - $database->setTenant($project->getInternalId()); + $database->setTenant((int)$project->getSequence()); return $database; } @@ -182,22 +182,24 @@ CLI::setResource('getLogsDB', function (Group $pools, Cache $cache) { // set tenant if ($project !== null && !$project->isEmpty() && $project->getId() !== 'console') { - $database->setTenant($project->getInternalId()); + $database->setTenant((int)$project->getSequence()); } return $database; }; }, ['pools', 'cache']); - +CLI::setResource('publisher', function (Group $pools) { + return new BrokerPool(publisher: $pools->get('publisher')); +}, ['pools']); +CLI::setResource('publisherRedis', function () { + // Stub +}); CLI::setResource('queueForStatsUsage', function (Publisher $publisher) { return new StatsUsage($publisher); }, ['publisher']); CLI::setResource('queueForStatsResources', function (Publisher $publisher) { return new StatsResources($publisher); }, ['publisher']); -CLI::setResource('publisher', function (Group $pools) { - return new BrokerPool(publisher: $pools->get('publisher')); -}, ['pools']); CLI::setResource('queueForFunctions', function (Publisher $publisher) { return new Func($publisher); }, ['publisher']); @@ -251,7 +253,7 @@ CLI::setResource('logError', function (Registry $register) { }; }, ['register']); -CLI::setResource('executor', fn () => new Executor(fn (string $projectId, string $deploymentId) => System::getEnv('_APP_EXECUTOR_HOST'))); +CLI::setResource('executor', fn () => new Executor()); CLI::setResource('telemetry', fn () => new NoTelemetry()); @@ -284,6 +286,5 @@ $cli $cli->shutdown()->action(fn () => Timer::clearAll()); -// Enable coroutines, but disable TCP hooks. These don't work until we use `\Utopia\Cache\Adapter\Pool` and `\Utopia\Database\Adapter\Pool`. -Runtime::enableCoroutine(SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_TCP); +Runtime::enableCoroutine(SWOOLE_HOOK_ALL); run($cli->run(...)); diff --git a/app/config/collections/common.php b/app/config/collections/common.php index e77d5403d2..6de7eb224b 100644 --- a/app/config/collections/common.php +++ b/app/config/collections/common.php @@ -1439,13 +1439,6 @@ return [ 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], - [ - '$id' => ID::custom('_key_roles'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['roles'], - 'lengths' => [128], - 'orders' => [], - ], ], ], diff --git a/app/config/collections/projects.php b/app/config/collections/projects.php index 48a0938a1c..ac14421382 100644 --- a/app/config/collections/projects.php +++ b/app/config/collections/projects.php @@ -1286,6 +1286,7 @@ return [ ] ], ], + 'deployments' => [ '$collection' => ID::custom(Database::METADATA), '$id' => ID::custom('deployments'), diff --git a/app/config/console.php b/app/config/console.php index e37c9b7836..b1e4299ce0 100644 --- a/app/config/console.php +++ b/app/config/console.php @@ -5,13 +5,13 @@ */ use Appwrite\Auth\Auth; -use Appwrite\Network\Validator\Origin; +use Appwrite\Network\Platform; use Utopia\Database\Helpers\ID; use Utopia\System\System; $console = [ '$id' => ID::custom('console'), - '$internalId' => ID::custom('console'), + '$sequence' => ID::custom('console'), 'name' => 'Appwrite', '$collection' => ID::custom('projects'), 'description' => 'Appwrite core engine', @@ -23,7 +23,7 @@ $console = [ [ '$collection' => ID::custom('platforms'), 'name' => 'Localhost', - 'type' => Origin::CLIENT_TYPE_WEB, + 'type' => Platform::TYPE_WEB, 'hostname' => 'localhost', ], // Current host is added on app init ], diff --git a/app/config/errors.php b/app/config/errors.php index 6d9d29a8ea..8365e8c705 100644 --- a/app/config/errors.php +++ b/app/config/errors.php @@ -393,6 +393,16 @@ return [ 'description' => 'Membership is already confirmed.', 'code' => 409, ], + Exception::MEMBERSHIP_DELETION_PROHIBITED => [ + 'name' => Exception::MEMBERSHIP_DELETION_PROHIBITED, + 'description' => 'Membership deletion is prohibited.', + 'code' => 400, + ], + Exception::MEMBERSHIP_DOWNGRADE_PROHIBITED => [ + 'name' => Exception::MEMBERSHIP_DOWNGRADE_PROHIBITED, + 'description' => 'Membership role downgrade is prohibited.', + 'code' => 400, + ], /** Avatars */ Exception::AVATAR_SET_NOT_FOUND => [ diff --git a/app/config/locale/templates/email-inner-base.tpl b/app/config/locale/templates/email-inner-base.tpl index 8cef391d2f..677f70ce7d 100644 --- a/app/config/locale/templates/email-inner-base.tpl +++ b/app/config/locale/templates/email-inner-base.tpl @@ -1,6 +1,6 @@

{{hello}}

{{body}}

-

{{redirect}}

+

{{buttonText}}

{{footer}}

{{thanks}} diff --git a/app/config/locale/translations/af.json b/app/config/locale/translations/af.json index e68fda2c75..9b313ac92a 100644 --- a/app/config/locale/translations/af.json +++ b/app/config/locale/translations/af.json @@ -8,6 +8,7 @@ "emails.verification.body": "Volg hierdie skakel om u e-pos adres te bevestig.", "emails.verification.footer": "Ignoreer gerus hierdie boodskap as u nie die versoek gestuur het om u adres te bevestig nie.", "emails.verification.thanks": "Baie dankie,", + "emails.verification.buttonText": "Bevestig e-posadres", "emails.verification.signature": "Die {{project}} span", "emails.magicSession.subject": "Teken aan", "emails.magicSession.hello": "Goeie dag,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Volg hierdie skakel om u {{project}} wagwoord te herstel.", "emails.recovery.footer": "Ignoreer gerus hierdie boodskap as u nie die versoek gestuur het om u wagwoord te herstel nie.", "emails.recovery.thanks": "Baie dankie,", + "emails.recovery.buttonText": "Stel wagwoord terug", "emails.recovery.signature": "Die {{project}} span", "emails.invitation.subject": "Uitnodiging om by die %s span aan te sluit by %s", "emails.invitation.hello": "Goeie dag,", "emails.invitation.body": "Hierdie boodskap is aan u gestuur omdat {{owner}} u uitnooi om 'n lid van die {{team}} groep by die {{project}} projek te wees.", "emails.invitation.footer": "As u nie belang stel nie, kan u gerus hierdie boodskap ignoreer.", "emails.invitation.thanks": "Baie dankie,", + "emails.invitation.buttonText": "Aanvaar uitnodiging na {{team}}", "emails.invitation.signature": "Die {{project}} span", "locale.country.unknown": "Onbekend", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/ar-ma.json b/app/config/locale/translations/ar-ma.json index efd2e95c31..e4b5b1f558 100644 --- a/app/config/locale/translations/ar-ma.json +++ b/app/config/locale/translations/ar-ma.json @@ -8,6 +8,7 @@ "emails.verification.body": "تبّع هاد الوصلة باش تيقّن لادريسة تاع ليميل ديالك.", "emails.verification.footer": "إلا ماشي نتا اللي طلبتي تيقّن هاد لادريسة تاع ليميل، ممكن تنخّل هاد البرية.", "emails.verification.thanks": "شكرا،", + "emails.verification.buttonText": "تأكيد عنوان البريد الإلكتروني", "emails.verification.signature": "فرقة {{project}}", "emails.magicSession.subject": "تكونيكطا", "emails.magicSession.hello": "السلام،", @@ -20,12 +21,14 @@ "emails.recovery.body": "تبّع هاد الوصلة باش تبدّل كلمة السر تاع {{project}}.", "emails.recovery.footer": "إلا ماشي نتا اللي طلبتي تبدّل كلمة السر، ممكن تنخّل هاد البرية.", "emails.recovery.thanks": "شكرا،", + "emails.recovery.buttonText": "إعادة تعيين كلمة السر", "emails.recovery.signature": "فرقة {{project}}", "emails.invitation.subject": "عراضة ل فرقة %s ف %s", "emails.invitation.hello": "السلام،", "emails.invitation.body": "هاد البرية تصيفطات ليك حيت {{owner}} بغى يعرض عليك تولّي عضو ف فرقة {{team}} عند {{project}}.", "emails.invitation.footer": "إلا كنتي ما مسوّقش, ممكن تنخّل هاد البرية.", "emails.invitation.thanks": "شكرا،", + "emails.invitation.buttonText": "اقبل الدعوة إلى {{team}}", "emails.invitation.signature": "فرقة {{project}}", "emails.certificate.subject": "السرتافيكة فشلات ل %s", "emails.certificate.hello": "السلام،", diff --git a/app/config/locale/translations/ar.json b/app/config/locale/translations/ar.json index 1d67c2ecf7..eda0652fbe 100644 --- a/app/config/locale/translations/ar.json +++ b/app/config/locale/translations/ar.json @@ -8,6 +8,7 @@ "emails.verification.body": "برجاء اتباع الرابط التالي لتأكيد بريدك الإلكتروني", "emails.verification.footer": "لو لم تطلب تأكيد هذا البريد الإلكتروني، يمكنك تجاهل هذه الرسالة", "emails.verification.thanks": "شكرا،", + "emails.verification.buttonText": "تأكيد عنوان البريد الإلكتروني", "emails.verification.signature": "فريق {{project}}", "emails.magicSession.subject": "تسجيل الدخول", "emails.magicSession.hello": "أهلا،", @@ -20,12 +21,14 @@ "emails.recovery.body": "برجاء اتباع الراط التالي لتغيير كلمة السر الخاصة بـ{{project}}", "emails.recovery.footer": "لولم تطلب تغيير كلمة السر، يمكنك تجاهل هذه الرسالة", "emails.recovery.thanks": "شكرا،", + "emails.recovery.buttonText": "إعادة تعيين كلمة المرور", "emails.recovery.signature": "فريق {{project}}", "emails.invitation.subject": "دعوة لفريق %s في %s", "emails.invitation.hello": "أهلا،", "emails.invitation.body": "هذة الرسالة تم ارسالها لك لأن {{owner}} ارسل لك دعوة لتكون عضوا بفريق {{team}} في {{project}}", "emails.invitation.footer": "اذا كنت غير مهتم، يمكنك تجاهل هذه الرسالة", "emails.invitation.thanks": "شكرا،", + "emails.invitation.buttonText": "قبول الدعوة إلى {{team}}", "emails.invitation.signature": "فريق {{project}}", "locale.country.unknown": "مجهول", "countries.af": "أفغانستان", diff --git a/app/config/locale/translations/as.json b/app/config/locale/translations/as.json index 572ed80f1a..60e385a8ac 100644 --- a/app/config/locale/translations/as.json +++ b/app/config/locale/translations/as.json @@ -8,6 +8,7 @@ "emails.verification.body": "আপোনাৰ ইমেইল ঠিকনা প্ৰমাণিত কৰিবলৈ এই লিংকটো অনুসৰণ কৰক।", "emails.verification.footer": "যদি আপুনি এই ঠিকনাটো সত্যাপিত কৰিবলৈ কোৱা নাই, আপুনি এই বাৰ্তাটো উপেক্ষা কৰিব পাৰে।", "emails.verification.thanks": "ধন্যবাদ,", + "emails.verification.buttonText": "ইমেইল ঠিকনা নিশ্চিত কৰক", "emails.verification.signature": "{{project}} দল", "emails.magicSession.subject": "লগইন", "emails.magicSession.hello": "নমস্কাৰ,", @@ -20,12 +21,14 @@ "emails.recovery.body": "আপোনাৰ {{project}} পাছৱৰ্ড ৰিছেট কৰিবলৈ এই লিংকটো অনুসৰণ কৰক।.", "emails.recovery.footer": "যদি আপুনি আপোনাৰ পাছৱৰ্ড ৰিছেট কৰিবলৈ কোৱা নাছিল, আপুনি এই বাৰ্তাটো উপেক্ষা কৰিব পাৰে।", "emails.recovery.thanks": "ধন্যবাদ,", + "emails.recovery.buttonText": "পাছৱৰ্ড ৰিছেট কৰক", "emails.recovery.signature": "{{project}} দল", "emails.invitation.subject": "%s বছৰত %s দললৈ নিমন্ত্ৰণ", "emails.invitation.hello": "নমস্কাৰ,", "emails.invitation.body": "এই মেইলটো আপোনালৈ প্ৰেৰণ কৰা হৈছিল কাৰণ {{owner}} জনে আপোনাক {{project}} বছৰবয়সত {{team}} দলৰ সদস্য হ'বলৈ আমন্ত্ৰণ জনাব বিচাৰিছিল।", "emails.invitation.footer": "যদি আপুনি আগ্ৰহী নহয়, আপুনি এই বাৰ্তাটো উপেক্ষা কৰিব পাৰে।", "emails.invitation.thanks": "ধন্যবাদ,", + "emails.invitation.buttonText": "{{team}}-লৈ নিমন্ত্ৰণ গ্ৰহণ কৰক", "emails.invitation.signature": "{{project}} দল", "locale.country.unknown": "অজ্ঞাত ", "countries.af": "আফগানিস্তান ", diff --git a/app/config/locale/translations/az.json b/app/config/locale/translations/az.json index 5988c51786..63e442f7c5 100644 --- a/app/config/locale/translations/az.json +++ b/app/config/locale/translations/az.json @@ -8,6 +8,7 @@ "emails.verification.body": "E-poçt ünvanınızı təsdiq etmək üçün bu linki izləyin.", "emails.verification.footer": "Bu ünvanı doğrulamağı xahiş etməmisinizsə, bu mesajı gözardı edə bilərsiniz.", "emails.verification.thanks": "Təşəkkürlər,", + "emails.verification.buttonText": "E-poçt ünvanını təsdiqlə", "emails.verification.signature": "{{project}} komandası", "emails.magicSession.subject": "Daxil Olmaq", "emails.magicSession.hello": "Salam,", @@ -20,12 +21,14 @@ "emails.recovery.body": "{{project}} şifrənizi sıfırlamaq üçün bu linki izləyin.", "emails.recovery.footer": "Şifrənizi sıfırlamağı xahiş etməmisinizsə, bu mesajı gözardı edə bilərsiniz.", "emails.recovery.thanks": "Təşəkkürlər,", + "emails.recovery.buttonText": "Şifrəni sıfırla", "emails.recovery.signature": "{{project}} komandası", "emails.invitation.subject": "%s Komandasına Dəvət %sdə", "emails.invitation.hello": "Salam,", "emails.invitation.body": "{{owner}}, {{project}}də {{team}} komandasına üzv olmağa dəvət etmək istədiyi üçün bu məktub sizə göndərildi.", "emails.invitation.footer": "Əgər maraqlanmırsınızsa, bu mesajı gözardı edə bilərsiniz.", "emails.invitation.thanks": "Təşəkkürlər,", + "emails.invitation.buttonText": "{{team}} dəvətini qəbul et", "emails.invitation.signature": "{{project}} komandası", "locale.country.unknown": "Naməlum", "countries.af": "Əfqanıstan", diff --git a/app/config/locale/translations/be.json b/app/config/locale/translations/be.json index f03a9d5bef..b4ae0827c3 100644 --- a/app/config/locale/translations/be.json +++ b/app/config/locale/translations/be.json @@ -8,6 +8,7 @@ "emails.verification.body": "Перайдзіце па гэтай спасылцы, каб пацвердзіць свой адрас электроннай пошты", "emails.verification.footer": "Калі вы не запытвалі пацвярджэнне гэтага адрасу, праігнаруйце гэтае паведамленне.", "emails.verification.thanks": "Дзякуем,", + "emails.verification.buttonText": "Пацвердзіць адрас электроннай пошты", "emails.verification.signature": "каманда {{project}}", "emails.magicSession.subject": "Лагін", "emails.magicSession.hello": "Прывітанне,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Перайдзіце па гэтай спасылцы, каб скінуць пароль для праекта {{project}}.", "emails.recovery.footer": "Калі вы не прасілі скінуць пароль, вы можаце праігнараваць гэта паведамленне.", "emails.recovery.thanks": "Дзякуем,", + "emails.recovery.buttonText": "Аднавіць пароль", "emails.recovery.signature": "каманда {{project}}", "emails.invitation.subject": "Запрошення до Команди %s у %s", "emails.invitation.hello": "Прывітанне,", "emails.invitation.body": "Гэта паведамленне было адпраўлена вам, таму што {{owner}} хацеў запрасіць вас стаць членам каманды {{team}} у {{project}}.", "emails.invitation.footer": "Калі вам гэта не цікава, вы можаце праігнараваць гэтае паведамленне.", "emails.invitation.thanks": "Дзякуем,", + "emails.invitation.buttonText": "Прыняць запрашэнне ў {{team}}", "emails.invitation.signature": "каманда {{project}}", "locale.country.unknown": "Невядомы", "countries.af": "Афганістан", diff --git a/app/config/locale/translations/bh.json b/app/config/locale/translations/bh.json index 5cf06bd1dd..7d2b469ed5 100644 --- a/app/config/locale/translations/bh.json +++ b/app/config/locale/translations/bh.json @@ -8,6 +8,7 @@ "emails.verification.body": "ईमेल प्रमाणिकरण करे क लेल दिहल गइल लिंक फॉलो करें|", "emails.verification.footer": "अगर ई पता को सत्यापित करे के लिए ना कहाले, तो आप ई संदेश क अनदेखा कर सकत अछि।", "emails.verification.thanks": "धन्यवाद,", + "emails.verification.buttonText": "ईमेल पता के पुष्टि करीं", "emails.verification.signature": "{{project}} टीम", "emails.magicSession.subject": "लॉग इन करीं|", "emails.magicSession.hello": "प्रणाम,", @@ -20,12 +21,14 @@ "emails.recovery.body": "पासवर्ड बदल क लेल दिहल गइल लिंक फॉलो करें|", "emails.recovery.footer": "अगर पासवर्ड बदल क लेल ना कहाले, तो आप ई संदेश क अनदेखा कर सकत अछि।", "emails.recovery.thanks": "धन्यवाद,", + "emails.recovery.buttonText": "पासवर्ड रीसेट करीं", "emails.recovery.signature": "{{project}} टीम", "emails.invitation.subject": "%s टीम क %s पे न्योता देवे क लेल|", "emails.invitation.hello": "प्रणाम,", "emails.invitation.body": "ई मेल आपके एही लेल भेजल गईल रहल काहे क {{owner}} आपके {{project}} क {{team}} टीम का सदस्य बनावे चाहित रहे|", "emails.invitation.footer": "अगर आवे क इच्छा ना होवत, तो आप ई संदेश क अनदेखा कर सकत अछि।", "emails.invitation.thanks": "धन्यवाद,", + "emails.invitation.buttonText": "{{team}} में नेवता स्वीकार करीं", "emails.invitation.signature": "{{project}} टीम", "locale.country.unknown": "अनजान", "countries.af": "अफ़ग़ानिस्तान", diff --git a/app/config/locale/translations/bn.json b/app/config/locale/translations/bn.json index 495f56e012..1157d5cc0f 100644 --- a/app/config/locale/translations/bn.json +++ b/app/config/locale/translations/bn.json @@ -8,6 +8,7 @@ "emails.verification.body": "এই লিঙ্কের মাধ্যমে ইমেইল যাচাই করুন।", "emails.verification.footer": "আপনি যদি এই ঠিকানা যাচাই করতে না বলেন, তাহলে আপনি এই বার্তাটি উপেক্ষা করতে পারেন।", "emails.verification.thanks": "ধন্যবাদ,", + "emails.verification.buttonText": "ইমেইল ঠিকানা নিশ্চিত করুন", "emails.verification.signature": "{{project}} টীম", "emails.magicSession.subject": "লগ ইন", "emails.magicSession.hello": "নমস্কার,", @@ -20,12 +21,14 @@ "emails.recovery.body": "এই লিঙ্কের মাধ্যমে আপনার {{project}} পাসওয়ার্ড পুনরায় সেট করুন।", "emails.recovery.footer": "আপনি যদি আপনার পাসওয়ার্ড পুনরায় সেট করতে না বলেন, তাহলে আপনি এই বার্তাটি উপেক্ষা করতে পারেন।", "emails.recovery.thanks": "ধন্যবাদ,", + "emails.recovery.buttonText": "পাসওয়ার্ড রিসেট করুন", "emails.recovery.signature": "{{project}} টীম", "emails.invitation.subject": "%s টিমকে %s তে আমন্ত্রণ জানান", "emails.invitation.hello": "নমস্কার,", "emails.invitation.body": "এই মেইলটি আপনাকে পাঠানো হয়েছে কারণ {{owner}} আপনাকে {{project}} এর সাথে যুক্ত {{team}} টিমের সদস্য হওয়ার জন্য আমন্ত্রণ জানাতে চেয়েছিলেন।", "emails.invitation.footer": "যদি এটি আপনার জন্য প্রয়োজনীয় না হয়, আপনি এই বার্তাটি উপেক্ষা করতে পারেন।", "emails.invitation.thanks": "ধন্যবাদ,", + "emails.invitation.buttonText": "{{team}}-এর আমন্ত্রণ গ্রহণ করুন", "emails.invitation.signature": "{{project}} টীম", "locale.country.unknown": "অজানা", "countries.af": "আফগানিস্তান", diff --git a/app/config/locale/translations/ca.json b/app/config/locale/translations/ca.json index 98940a4a48..ec5112f075 100644 --- a/app/config/locale/translations/ca.json +++ b/app/config/locale/translations/ca.json @@ -8,6 +8,7 @@ "emails.verification.body": "Accedeix a aquest enllaç per tal de verificar la teva adreça electrònica.", "emails.verification.footer": "Si no has sol·licitat la verificació d'aquesta adreça electrònica, pots ignorar aquest missatge.", "emails.verification.thanks": "Gràcies,", + "emails.verification.buttonText": "Confirma l'adreça electrònica", "emails.verification.signature": "Equip {{project}}", "emails.magicSession.subject": "Entrar", "emails.magicSession.hello": "Hola,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Accedeix a aquest enllaç per a reinicialitzar la teva contrasenya de {{project}}.", "emails.recovery.footer": "Si no has sol·licitat reinicialitzar la teva contrasenya, pots ignorar aquest missatge.", "emails.recovery.thanks": "Gràcies,", + "emails.recovery.buttonText": "Restableix la contrasenya", "emails.recovery.signature": "Equip {{project}}", "emails.invitation.subject": "Invitació a l'equip %s a s%", "emails.invitation.hello": "Hola,", "emails.invitation.body": "Aquest correu se t'ha enviat perquè {{owner}} vol convidar-te a formar part de l'equip {{team}} al {{project}}.", "emails.invitation.footer": "Si no és del teu interès, pots ignorar aquest missatge.", "emails.invitation.thanks": "Gràcies,", + "emails.invitation.buttonText": "Accepta la invitació a {{team}}", "emails.invitation.signature": "Equip {{project}}", "locale.country.unknown": "Desconegut", "countries.af": "Afganistan", diff --git a/app/config/locale/translations/da.json b/app/config/locale/translations/da.json index 9cec74dbed..ae93b3c3b5 100644 --- a/app/config/locale/translations/da.json +++ b/app/config/locale/translations/da.json @@ -8,6 +8,7 @@ "emails.verification.body": "Følg dette link, for at verificere din email adresse.", "emails.verification.footer": "Hvis du ikke har bedt om at verificere denne adresse, ignorer venligst denne besked.", "emails.verification.thanks": "Tak,", + "emails.verification.buttonText": "Bekræft e-mailadresse", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Hej,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Følg dette link for at nulstille koden til {{project}}.", "emails.recovery.footer": "Hvis du ikke har bedt om at nulstille dit password, ignorer venligst denne besked.", "emails.recovery.thanks": "Tak,", + "emails.recovery.buttonText": "Nulstil adgangskode", "emails.recovery.signature": "{{project}} team", "emails.invitation.subject": "Invitation til %s Team på %s", "emails.invitation.hello": "Hej,", "emails.invitation.body": "Denne mail blev sendt til dig, fordi {{owner}} vil invitere dig til at blive medlem af {{team}} teamet på {{project}}.", "emails.invitation.footer": "Hvis du ikke er interesseret, ignorer venligst denne besked.", "emails.invitation.thanks": "Tak,", + "emails.invitation.buttonText": "Accepter invitation til {{team}}", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Ukendt", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/de.json b/app/config/locale/translations/de.json index 38b1e46870..a5a2f0ba43 100644 --- a/app/config/locale/translations/de.json +++ b/app/config/locale/translations/de.json @@ -8,6 +8,7 @@ "emails.verification.body": "Folge diesem Link, um deine E-Mail-Adresse zu bestätigen.", "emails.verification.footer": "Solltest du keine Verifizierung dieser E-Mail-Adresse angefordert haben, kannst du diese Nachricht ignorieren.", "emails.verification.thanks": "Danke,", + "emails.verification.buttonText": "E-Mail-Adresse bestätigen", "emails.verification.signature": "{{project}}-Team", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Hey,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Folge diesem Link, um dein {{project}}-Kennwort zurückzusetzen.", "emails.recovery.footer": "Solltest du keine Kennwort-Zurücksetzung angefordert haben, kannst du diese Nachricht ignorieren.", "emails.recovery.thanks": "Danke,", + "emails.recovery.buttonText": "Passwort zurücksetzen", "emails.recovery.signature": "{{project}}-Team", "emails.invitation.subject": "Einladung zum %s-Team auf %s", "emails.invitation.hello": "Hello,", "emails.invitation.body": "Du erhälst diese E-Mail, weil {{owner}} dich in das Team {{team}} auf {{project}} eingeladen hat.", "emails.invitation.footer": "Wenn du nicht interessiert bist, kannst du diese Nachricht ignorieren.", "emails.invitation.thanks": "Danke,", + "emails.invitation.buttonText": "Einladung zu {{team}} annehmen", "emails.invitation.signature": "{{project}}-Team", "locale.country.unknown": "Unbekannt", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/el.json b/app/config/locale/translations/el.json index 1ef9cd30df..3576ffb865 100644 --- a/app/config/locale/translations/el.json +++ b/app/config/locale/translations/el.json @@ -8,6 +8,7 @@ "emails.verification.body": "Ακολουθήστε αυτό το link για να επαληθεύσετε τη δ/νση του email σας", "emails.verification.footer": "Εάν δεν ζητήσατε επαλήθευση αυτής της δ/νσης email, μπορείτε να αγνοήσετε αυτό το μήνυμα", "emails.verification.thanks": "Ευχαριστούμε,", + "emails.verification.buttonText": "Επιβεβαιώστε διεύθυνση email", "emails.verification.signature": "Η ομάδα του {{project}}", "emails.magicSession.subject": "Είσοδος", "emails.magicSession.hello": "Γεια σου,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Ακολουθήστε αυτό το link για να αλλάξετε τον {{project}} κωδικό σας", "emails.recovery.footer": "Εάν δεν ζητήσατε αλλαγή του κωδικού σας πρόσβασης, μπορείτε να αγνοήσετε αυτό το μήνυμα", "emails.recovery.thanks": "Ευχαριστούμε,", + "emails.recovery.buttonText": "Επαναφορά κωδικού πρόσβασης", "emails.recovery.signature": "Η ομάδα του {{project}}", "emails.invitation.subject": "Πρόσκληση στην %s Ομάδα στον %s", "emails.invitation.hello": "Γεια σου,", "emails.invitation.body": "Αυτό το email στάλθηκε επειδή ο/η {{owner}} θέλει να σας προσκαλέσει να γίνετε μέλος της ομάδας {{team}} του {{project}}.", "emails.invitation.footer": "Εάν δεν ενδιαφέρεστε, μπορείτε να αγνοήσετε αυτό το μήνυμα.", "emails.invitation.thanks": "Ευχαριστούμε,", + "emails.invitation.buttonText": "Αποδεχόμενος την πρόσκληση στην {{team}}", "emails.invitation.signature": "Η ομάδα του {{project}}", "locale.country.unknown": "Άγνωστο", "countries.af": "Αφγανιστάν", diff --git a/app/config/locale/translations/en.json b/app/config/locale/translations/en.json index d9dfddb017..dbfa2e1be8 100644 --- a/app/config/locale/translations/en.json +++ b/app/config/locale/translations/en.json @@ -8,6 +8,7 @@ "emails.verification.body": "Follow this link to verify your email address to your {{b}}{{project}}{{/b}} account.", "emails.verification.footer": "If you didn’t ask to verify this address, you can ignore this message.", "emails.verification.thanks": "Thanks,", + "emails.verification.buttonText": "Confirm email address", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "{{project}} Login", "emails.magicSession.hello": "Hello {{user}},", @@ -45,12 +46,14 @@ "emails.recovery.body": "Follow this link to reset your {{b}}{{project}}{{/b}} password.", "emails.recovery.footer": "If you didn't ask to reset your password, you can ignore this message.", "emails.recovery.thanks": "Thanks,", + "emails.recovery.buttonText": "Reset password", "emails.recovery.signature": "{{project}} team", "emails.invitation.subject": "Invitation to %s Team at %s", "emails.invitation.hello": "Hello {{user}},", "emails.invitation.body": "This mail was sent to you because {{b}}{{owner}}{{/b}} wanted to invite you to become a member of the {{b}}{{team}}{{/b}} team at {{b}}{{project}}{{/b}}.", "emails.invitation.footer": "If you are not interested, you can ignore this message.", "emails.invitation.thanks": "Thanks,", + "emails.invitation.buttonText": "Accept invite to {{team}}", "emails.invitation.signature": "{{project}} team", "emails.certificate.subject": "Certificate failure for %s", "emails.certificate.hello": "Hello,", diff --git a/app/config/locale/translations/eo.json b/app/config/locale/translations/eo.json index ba80bc602d..8aba49098b 100644 --- a/app/config/locale/translations/eo.json +++ b/app/config/locale/translations/eo.json @@ -7,6 +7,7 @@ "emails.verification.body": "Alklaku ĉi tiun ligon por kontroli vian retpoŝtan adreson.", "emails.verification.footer": "Se vi ne petis ĉi tiun konfirmon de ĉi tiu retpoŝto, vi povas ignori ĉi tiun mesaĝon.", "emails.verification.thanks": "Dankegon.,", + "emails.verification.buttonText": "Konfirmi retadreson", "emails.verification.signature": "Teamo {{project}}", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Saluton,", @@ -19,12 +20,14 @@ "emails.recovery.body": "Alklaku ĉi tiun ligon por reagordi vian pasvorton. {{project}}", "emails.recovery.footer": "Se vi ne petis reagordi vian pasvorton, vi povas ignori ĉi tiun mesaĝon.", "emails.recovery.thanks": "Dankegon,", + "emails.recovery.buttonText": "Pasvorton restarigi", "emails.recovery.signature": "Teamo {{project}}", "emails.invitation.subject": "Invito al la Teamo %s em %s", "emails.invitation.hello": "Dankegon,", "emails.invitation.body": "Ĉi tiu retpoŝto estis sendita ĉar la {{owner}} volas inviti vin fariĝi membro de la Teamo {{team}} en {{project}}.", "emails.invitation.footer": "Se vi ne interesiĝas, vi povas ignori ĉi tiun mesaĝon.", "emails.invitation.thanks": "Dankegon,", + "emails.invitation.buttonText": "Akcepti inviton al {{team}}", "emails.invitation.signature": "Teamo {{project}}", "locale.country.unknown": "Unknown", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/es.json b/app/config/locale/translations/es.json index ff98fd28c7..e986b15f3c 100644 --- a/app/config/locale/translations/es.json +++ b/app/config/locale/translations/es.json @@ -8,6 +8,7 @@ "emails.verification.body": "Haz clic en este enlace para verificar tu correo:", "emails.verification.footer": "Si no has solicitado verificar este correo, puedes ignorar este mensaje.", "emails.verification.thanks": "Gracias.,", + "emails.verification.buttonText": "Confirmar dirección de correo", "emails.verification.signature": "El equipo de {{project}}.", "emails.magicSession.subject": "Inicio de sesión", "emails.magicSession.hello": "Hola,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Haz clic en este enlace para restablecer la contraseña de {{project}}:", "emails.recovery.footer": "Si no has solicitado restablecer la contraseña, puedes ignorar este mensaje.", "emails.recovery.thanks": "Gracias.,", + "emails.recovery.buttonText": "Restablecer contraseña", "emails.recovery.signature": "El equipo de {{project}}", "emails.invitation.subject": "Invitación al equipo %s en %s", "emails.invitation.hello": "Hola,", "emails.invitation.body": "Este correo ha sido enviado a petición de {{owner}} quién quiere invitarte a formar parte del equipo {{team}} en {{project}}.", "emails.invitation.footer": "Si no estás interesado, puedes ignorar este mensaje.", "emails.invitation.thanks": "Gracias.,", + "emails.invitation.buttonText": "Aceptar invitación a {{team}}", "emails.invitation.signature": "El equipo de {{project}}", "locale.country.unknown": "Desconocido", "countries.af": "Afganistán", diff --git a/app/config/locale/translations/fa.json b/app/config/locale/translations/fa.json index f826a75118..9434b9ff03 100644 --- a/app/config/locale/translations/fa.json +++ b/app/config/locale/translations/fa.json @@ -8,6 +8,7 @@ "emails.verification.body": "برای تأیید ایمیل‌تان پیوند زیر را دنبال کنید.", "emails.verification.footer": "اگر شما درخواست تأیید حساب نداده‌اید، می‌توانید این پیام را نادیده بگیرید.", "emails.verification.thanks": "سپاس فراوان،", + "emails.verification.buttonText": "آدرس ایمیل را تایید کنید", "emails.verification.signature": "تیم {{user}}", "emails.magicSession.subject": "ورود به حساب کاربری", "emails.magicSession.hello": "سلام،", @@ -20,12 +21,14 @@ "emails.recovery.body": "برای بازیابی گذرواژه‌تان پیوند زیر را دنبال کنید.", "emails.recovery.footer": "اگر شما درخواست بازیابی گذرواژه نداده‌اید، می‌توانید این پیام را نادیده بگیرید.", "emails.recovery.thanks": "سپاس فراوان،", + "emails.recovery.buttonText": "بازنشانی رمز عبور", "emails.recovery.signature": "تیم {{user}}", "emails.invitation.subject": "دعوت به تیم %s در %s", "emails.invitation.hello": "سلام،", "emails.invitation.body": "این ایمیل برای شما فرستاده شده‌است زیرا {{owner}} می‌خواهد شما را به تیم {{team}} در پروژه‌ی {{project}} بیفزاید.", "emails.invitation.footer": "اگر علاقه ندارید، می‌توانید این پیام را نادیده بگیرید.", "emails.invitation.thanks": "سپاس فراوان،", + "emails.invitation.buttonText": "دعوت را به {{team}} بپذیرید", "emails.invitation.signature": "تیم {{user}}", "locale.country.unknown": "ناشناخته", "countries.af": "افغانستان", diff --git a/app/config/locale/translations/fr.json b/app/config/locale/translations/fr.json index 1b60cb1910..3af7193764 100644 --- a/app/config/locale/translations/fr.json +++ b/app/config/locale/translations/fr.json @@ -8,6 +8,7 @@ "emails.verification.body": "Suivez ce lien pour vérifier votre adresse e-mail.", "emails.verification.footer": "Si vous n'avez pas demandé à vérifier cette adresse, vous pouvez ignorer ce message.", "emails.verification.thanks": "Merci,", + "emails.verification.buttonText": "Confirmez l'adresse e-mail", "emails.verification.signature": "Équipe {{project}}", "emails.magicSession.subject": "Connexion", "emails.magicSession.hello": "Bonjour,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Suivez ce lien pour réinitialiser votre mot de passe pour {{project}}.", "emails.recovery.footer": "Si vous n'avez pas demandé à réinitialiser votre mot de passe, vous pouvez ignorer ce message.", "emails.recovery.thanks": "Merci,", + "emails.recovery.buttonText": "Réinitialisation du mot de passe", "emails.recovery.signature": "L'équipe {{project}}", "emails.invitation.subject": "Invitation à l'équipe %s de %s", "emails.invitation.hello": "Bonjour,", "emails.invitation.body": "Cet e-mail vous a été envoyé parce que {{owner}} souhaite vous inviter à devenir membre de l'équipe {{team}} pour {{project}}.", "emails.invitation.footer": "Si vous n'êtes pas intéressé, vous pouvez ignorer ce message.", "emails.invitation.thanks": "Merci,", + "emails.invitation.buttonText": "Accepter l'invitation à {{team}}", "emails.invitation.signature": "L'équipe {{project}}", "locale.country.unknown": "Inconnu", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/ga.json b/app/config/locale/translations/ga.json index 3ed68ad8c3..c486e77126 100644 --- a/app/config/locale/translations/ga.json +++ b/app/config/locale/translations/ga.json @@ -8,6 +8,7 @@ "emails.verification.body": "Lean an nasc seo chun do ríomhphost a fhíorú.", "emails.verification.footer": "Mura ndearna tú iarratas an seoladh seo a fhíoru, déan neamhaird den teachtaireacht seo.", "emails.verification.thanks": "Go raibh maith agat,", + "emails.verification.buttonText": "Deimhnigh seoladh ríomhphoist", "emails.verification.signature": "{{project}} foireann", "emails.magicSession.subject": "Logáil isteach", "emails.magicSession.hello": "Haigh,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Lean an nasc seo chun do pasfhocal {{project}} a athshocrú.", "emails.recovery.footer": "Mura ndearna tú iarratas do pasfhocal a athshocrú, déan neamhaird den teachtaireacht seo.", "emails.recovery.thanks": "Go raibh maith agat,", + "emails.recovery.buttonText": "Athshocraigh focal faire", "emails.recovery.signature": "{{project}} foireann", "emails.invitation.subject": "Cuireadh do %s foireann ag %s", "emails.invitation.hello": "Haigh,", "emails.invitation.body": "Seoladh an ríomhphost seo chugat mar ba mhaith le {{owner}} cuireadh a thabhairt duit bheith mar bhall den fhoireann {{team}} ag obair ar {{project}}.", "emails.invitation.footer": "Is cuma leat? Déan neamhaird den teachtaireacht seo.", "emails.invitation.thanks": "Go raibh maith agat,", + "emails.invitation.buttonText": "Glac le cuireadh chuig {{team}}", "emails.invitation.signature": "{{project}} foireann", "locale.country.unknown": "Neamhaithnid", "countries.af": "An Afganastáin", diff --git a/app/config/locale/translations/gu.json b/app/config/locale/translations/gu.json index 54378caa9e..8d5d2fb8d6 100644 --- a/app/config/locale/translations/gu.json +++ b/app/config/locale/translations/gu.json @@ -8,6 +8,7 @@ "emails.verification.body": "તમારું ઇમેઇલ સરનામું ચકાસવા માટે આ લિંકને અનુસરો.", "emails.verification.footer": "જો તમે આ સરનામાંની ચકાસણી કરવાનું ન કહ્યું હોય, તો તમે આ સંદેશને અવગણી શકો છો.", "emails.verification.thanks": "આભાર,", + "emails.verification.buttonText": "ઇમેઇલ સરનામું ખાતરી કરો", "emails.verification.signature": "{{project}} ટીમ", "emails.magicSession.subject": "પ્રવેશ કરો", "emails.magicSession.hello": "નમસ્કાર,", @@ -20,12 +21,14 @@ "emails.recovery.body": "તમારો {{project}} પાસવર્ડ ફરીથી સેટ કરવા માટે આ લિંકને અનુસરો.", "emails.recovery.footer": "જો તમે તમારો પાસવર્ડ ફરીથી સેટ કરવાનું ન કહ્યું હોય, તો તમે આ સંદેશને અવગણી શકો છો.", "emails.recovery.thanks": "આભાર,", + "emails.recovery.buttonText": "પાસવર્ડ રીસેટ કરો", "emails.recovery.signature": "{{project}} ટીમ", "emails.invitation.subject": "%s ટીમને %s પર આમંત્રણ", "emails.invitation.hello": "નમસ્કાર,", "emails.invitation.body": "આ મેઇલ તમને મોકલવામાં આવ્યો હતો કારણ કે {{owner}} તમને {{project}} માં {{team}} ટીમના સભ્ય બનવા માટે આમંત્રિત કરવા માંગતા હતો.", "emails.invitation.footer": "જો તમને રસ નથી, તો તમે આ સંદેશને અવગણી શકો છો.", "emails.invitation.thanks": "આભાર,", + "emails.invitation.buttonText": "{{team}} નું આમંત્રણ સ્વીકારો", "emails.invitation.signature": "{{project}} ટીમ", "locale.country.unknown": "અજાણ", "countries.af": "અફઘાનિસ્તાન", diff --git a/app/config/locale/translations/he.json b/app/config/locale/translations/he.json index b3d4dea2a8..8e5279e5e4 100644 --- a/app/config/locale/translations/he.json +++ b/app/config/locale/translations/he.json @@ -8,6 +8,7 @@ "emails.verification.body": "לחץ על קישור זה כדי לאמת את כתובת הדוא\"ל שלך.", "emails.verification.footer": "אם לא ביקשת לאמת כתובת זו, תוכל להתעלם מהודעה זו.", "emails.verification.thanks": "תודה,", + "emails.verification.buttonText": "אשר כתובת דוא\"ל", "emails.verification.signature": "צוות {{project}}", "emails.magicSession.subject": "כניסה למערכת", "emails.magicSession.hello": "שלום,", @@ -20,12 +21,14 @@ "emails.recovery.body": "עקוב אחר קישור זה כדי לאפס את סיסמתך ב-{{project}}.", "emails.recovery.footer": "אם לא ביקשת לאפס את הסיסמה, תוכל להתעלם מהודעה זו.", "emails.recovery.thanks": "תודה,", + "emails.recovery.buttonText": "סיסמא איפוס", "emails.recovery.signature": "צוות {{project}}", "emails.invitation.subject": "הזמנה לצוות %s ב- %s", "emails.invitation.hello": "שלום,", "emails.invitation.body": "דואר זה נשלח אליך מכיוון ש {{owner}} רצה להזמין אותך להיות חבר בצוות {{team}} ב-{{project}}.", "emails.invitation.footer": "אם אינך מעוניין, תוכל להתעלם מהודעה זו.", "emails.invitation.thanks": "תודה,", + "emails.invitation.buttonText": "אשר הזמנה ל-{{team}}", "emails.invitation.signature": "צוות {{project}}", "locale.country.unknown": "לא ידוע", "countries.af": "אפגניסטן", diff --git a/app/config/locale/translations/hi.json b/app/config/locale/translations/hi.json index 1c4d531d60..ef71e287cd 100644 --- a/app/config/locale/translations/hi.json +++ b/app/config/locale/translations/hi.json @@ -8,6 +8,7 @@ "emails.verification.body": "इस लिंक के माध्यम से अपने ईमेल को सत्यापित कीजिये।", "emails.verification.footer": "यदि आप इस पते को सत्यापित नहीं करना चाहते हैं, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।", "emails.verification.thanks": "धन्यवाद,", + "emails.verification.buttonText": "ईमेल पता सत्यापित करें", "emails.verification.signature": "{{project}} टीम", "emails.magicSession.subject": "लॉग इन", "emails.magicSession.hello": "नमस्ते,", @@ -20,12 +21,14 @@ "emails.recovery.body": "इस लिंक के माध्यम से अपना {{project}} पासवर्ड रीसेट करें।", "emails.recovery.footer": "यदि आप अपना पासवर्ड रीसेट नहीं करना चाहते हैं, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।", "emails.recovery.thanks": "धन्यवाद,", + "emails.recovery.buttonText": "पासवर्ड रीसेट करें", "emails.recovery.signature": "{{project}} टीम", "emails.invitation.subject": "%s टीम का यहाँ %s पर आमंत्रण", "emails.invitation.hello": "नमस्ते,", "emails.invitation.body": "यह मेल आपको इसलिए भेजा गया है क्योंकि {{owner}} आपको {{team}} टीम का सदस्य बनाना चाहते है, जो {{project}} से जुड़ा हुआ है।", "emails.invitation.footer": "यदि आप इसमें रूचि नहीं रखते, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।", "emails.invitation.thanks": "धन्यवाद,", + "emails.invitation.buttonText": "{{team}} का निमंत्रण स्वीकार करें", "emails.invitation.signature": "{{project}} टीम", "locale.country.unknown": "अज्ञात", "countries.af": "अफ़ग़ानिस्तान", diff --git a/app/config/locale/translations/hr.json b/app/config/locale/translations/hr.json index e5bf4719a9..8331d67422 100644 --- a/app/config/locale/translations/hr.json +++ b/app/config/locale/translations/hr.json @@ -8,6 +8,7 @@ "emails.verification.body": "Slijedite ovu poveznicu da biste potvrdili svoju adresu e-pošte.", "emails.verification.footer": "Ukoliko niste zatražili potvrdu ove adrese, možete zanemariti ovu poruku.", "emails.verification.thanks": "Hvala,", + "emails.verification.buttonText": "Potvrdi adresu e-pošte", "emails.verification.signature": "{{project}} tim", "emails.magicSession.subject": "Prijavite se", "emails.magicSession.hello": "Pozdrav,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Slijedite ovu poveznicu za ponovno postavljanje {{project}} lozinke.", "emails.recovery.footer": "Ako niste zatražili ponovno postavljanje Vaše lozinke, možete zanemariti ovu poruku.", "emails.recovery.thanks": "Hvala,", + "emails.recovery.buttonText": "Resetiraj lozinku", "emails.recovery.signature": "{{project}} tim", "emails.invitation.subject": "Pozivnica za %s tim na %s", "emails.invitation.hello": "Pozdrav,", "emails.invitation.body": "Ova poruka Vam je poslana jer Vas je {{owner}} htio pozvati da postanete član {{team}} tima na {{project}}.", "emails.invitation.footer": "Ukoliko niste zainteresirani, možete zanemariti ovu poruku.", "emails.invitation.thanks": "Hvala,", + "emails.invitation.buttonText": "Prihvati pozivnicu za {{team}}", "emails.invitation.signature": "{{project}} tim", "locale.country.unknown": "Nepoznato", "countries.af": "Afganistan", diff --git a/app/config/locale/translations/hu.json b/app/config/locale/translations/hu.json index 589cb61859..c21701a509 100644 --- a/app/config/locale/translations/hu.json +++ b/app/config/locale/translations/hu.json @@ -8,6 +8,7 @@ "emails.verification.body": "Kattints a linkre, hogy megerősítsd az email címedet.", "emails.verification.footer": "Ha nem te kérted a címed megerősítését, akkor nyugodtan hagyd figyelmen kívül ezt az üzenetet.", "emails.verification.thanks": "Köszönettel,", + "emails.verification.buttonText": "E-mail-cím megerősítése", "emails.verification.signature": "a {{project}} csapat", "emails.magicSession.subject": "Bejelentkezés", "emails.magicSession.hello": "Szia,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Kattints a linkre a {{project}} jelszavad visszaállításához.", "emails.recovery.footer": "Ha nem te kezdeményezted a jelszavad visszaállítását, akkor nyugodtan hagyd figyelmen kívül ezt az üzenetet.", "emails.recovery.thanks": "Köszönettel,", + "emails.recovery.buttonText": "Jelszó visszaállítása", "emails.recovery.signature": "a {{project}} csapat", "emails.invitation.subject": "Meghívó a(z) %s csapatba, a(z) %s projektbe", "emails.invitation.hello": "Szia,", "emails.invitation.body": "Ezt a levelet azért kaptad, mert {{owner}} meghívott, hogy légy a {{team}} csapat tagja a {{project}} projektben.", "emails.invitation.footer": "Ha nem érdekel a lehetőség, nyugodtan hagyd figyelmen kívül ezt az üzenetet.", "emails.invitation.thanks": "Köszönettel,", + "emails.invitation.buttonText": "Elfogadni meghívást a {{team}-re", "emails.invitation.signature": "a {{project}} csapat", "locale.country.unknown": "Ismeretlen", "countries.af": "Afganisztán", diff --git a/app/config/locale/translations/id.json b/app/config/locale/translations/id.json index c28b15f15d..836941f79a 100644 --- a/app/config/locale/translations/id.json +++ b/app/config/locale/translations/id.json @@ -8,6 +8,7 @@ "emails.verification.body": "Ikuti tautan ini untuk memverifikasi alamat email Anda.", "emails.verification.footer": "Jika Anda tidak meminta untuk memverifikasi alamat email ini, Anda dapat mengabaikan pesan ini.", "emails.verification.thanks": "Terima kasih,", + "emails.verification.buttonText": "Konfirmasi alamat email", "emails.verification.signature": "Tim {{project}}", "emails.magicSession.subject": "Masuk", "emails.magicSession.hello": "Hai,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Ikuti tautan ini untuk menyetel ulang kata sandi {{project}} Anda.", "emails.recovery.footer": "Jika Anda tidak meminta untuk menyetel ulang kata sandi, Anda dapat mengabaikan pesan ini.", "emails.recovery.thanks": "Terima kasih,", + "emails.recovery.buttonText": "Atur ulang kata sandi", "emails.recovery.signature": "Tim {{project}}", "emails.invitation.subject": "Undangan ke Tim %s di %s", "emails.invitation.hello": "Halo,", "emails.invitation.body": "Email ini dikirimkan kepada Anda karena {{owner}} ingin mengundang Anda untuk menjadi anggota tim {{team}} di {{project}}.", "emails.invitation.footer": "Jika Anda tidak tertarik, Anda dapat mengabaikan pesan ini.", "emails.invitation.thanks": "Terima kasih,", + "emails.invitation.buttonText": "Terima undangan ke {{team}}", "emails.invitation.signature": "Tim {{project}}", "locale.country.unknown": "Tidak diketahui", "countries.af": "Afganistan", diff --git a/app/config/locale/translations/it.json b/app/config/locale/translations/it.json index 8d45de9903..f0e290b481 100644 --- a/app/config/locale/translations/it.json +++ b/app/config/locale/translations/it.json @@ -8,6 +8,7 @@ "emails.verification.body": "Clicca questo link per verificare il tuo indirizzo email.", "emails.verification.footer": "Se non hai richiesto la verifica dell’indirizzo email, puoi ignorare questo messaggio.", "emails.verification.thanks": "Grazie,", + "emails.verification.buttonText": "Confermare l'indirizzo email", "emails.verification.signature": "Il team {{project}}", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Ciao,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Clicca questo link per reimpostare la tua password di {{project}}.", "emails.recovery.footer": "Se non hai richiesto la reimpostazione della password, puoi ignorare questo messaggio.", "emails.recovery.thanks": "Grazie,", + "emails.recovery.buttonText": "Reimposta password", "emails.recovery.signature": "Il team {{project}}", "emails.invitation.subject": "Invito al Team %s per %s", "emails.invitation.hello": "Ciao,", "emails.invitation.body": "Hai ricevuto questa email perché {{owner}} ti ha invitato a diventare un membro del team {{team}} di {{project}}.", "emails.invitation.footer": "Ignora questo messaggio se non sei interessatə.", "emails.invitation.thanks": "Grazie,", + "emails.invitation.buttonText": "Accetta invito a {{team}}", "emails.invitation.signature": "Il team {{project}}", "locale.country.unknown": "Sconosciuto", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/ja.json b/app/config/locale/translations/ja.json index 76d9a0cb1f..f3ad8fe1ed 100644 --- a/app/config/locale/translations/ja.json +++ b/app/config/locale/translations/ja.json @@ -8,6 +8,7 @@ "emails.verification.body": "メールアドレスを有効化するためには下記リンクをクリックして下さい。", "emails.verification.footer": "このメールに心当たりが無い場合は破棄をお願いいたします。", "emails.verification.thanks": "ご利用いただきありがとうございます。、", + "emails.verification.buttonText": "メールアドレスを確認する", "emails.verification.signature": "{{project}}チーム", "emails.magicSession.subject": "ログイン", "emails.magicSession.hello": "こんにちは、", @@ -20,12 +21,14 @@ "emails.recovery.body": "パスワードをリセットするためには下記リンクをクリックしてください。", "emails.recovery.footer": "このメールに心当たりが無い場合は破棄をお願いいたします。", "emails.recovery.thanks": "ご利用いただきありがとうございます。、", + "emails.recovery.buttonText": "パスワードをリセット", "emails.recovery.signature": "{{project}}チーム", "emails.invitation.subject": "%sチームへの招待が%sから来ました。", "emails.invitation.hello": "こんにちは、", "emails.invitation.body": "{{owner}}さんが{{project}}の{{team}}チームにあなたを招待しています。", "emails.invitation.footer": "このメールに心当たりが無い場合は破棄をお願いいたします。", "emails.invitation.thanks": "ご利用いただきありがとうございます。、", + "emails.invitation.buttonText": "{{team}}への招待を承諾する", "emails.invitation.signature": "{{project}}チーム", "locale.country.unknown": "不明", "countries.af": "アフガニスタン", diff --git a/app/config/locale/translations/jv.json b/app/config/locale/translations/jv.json index 889e968b4d..71d4f4b24a 100644 --- a/app/config/locale/translations/jv.json +++ b/app/config/locale/translations/jv.json @@ -8,6 +8,7 @@ "emails.verification.body": "Klik link iki kanggo verifikasi alamat email sampeyan.", "emails.verification.footer": "Yen sampeyan ora njaluk verifikasi alamat iki, sampeyan iso nglirwakake pesen iki.", "emails.verification.thanks": "Matur nuwun,", + "emails.verification.buttonText": "Konfirmasi alamat email", "emails.verification.signature": "Tim {{project}}", "emails.magicSession.subject": "Masuk", "emails.magicSession.hello": "Hai,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Klik link iki kanggo setel ulang sandi {{project}}.", "emails.recovery.footer": "Yen sampeyan ora njaluk setel ulang sandi, sampeyan iso nglirwakake pesen iki.", "emails.recovery.thanks": "Matur nuwun,", + "emails.recovery.buttonText": "Reset sandhi", "emails.recovery.signature": "Tim {{project}}", "emails.invitation.subject": "Undangan ke Tim %s di %s", "emails.invitation.hello": "Halo,", "emails.invitation.body": "Email iki dikirim menyang sampeyan amarga {{owner}} pengin ngajak sampeyan dadi anggota tim {{team}} di {{project}}.", "emails.invitation.footer": "Yen sampeyan ora tertarik, sampeyan iso nglirwakake pesen iki.", "emails.invitation.thanks": "Matur nuwun,", + "emails.invitation.buttonText": "Tampa undhangan menyang {{team}}", "emails.invitation.signature": "Tim {{project}}", "locale.country.unknown": "Ora dingerteni", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/kn.json b/app/config/locale/translations/kn.json index ba57c21155..ed35a7947f 100644 --- a/app/config/locale/translations/kn.json +++ b/app/config/locale/translations/kn.json @@ -8,6 +8,7 @@ "emails.verification.body": "ನಿಮ್ಮ ಇಮೇಲ್ ವಿಳಾಸ ಪರಿಶೀಲನೆಗೆ ಈ ಲಿಂಕನ್ನು ಅನುಸರಿಸಿ", "emails.verification.footer": "ನೀವು ಇಮೇಲ್ ವಿಳಾಸ ಪರಿಶೀಲನೆಗೆ ಕೇಳದಿದ್ದರೆ, ಈ ಸಂದೇಶವನ್ನು ನಿರ್ಲಕ್ಷಿಸಿ", "emails.verification.thanks": "ಧನ್ಯವಾದಗಳು,", + "emails.verification.buttonText": "ಇಮೇಲ್ ವಿಳಾಸವನ್ನು ದೃಢೀಕರಿಸಿ", "emails.verification.signature": "{{project}} ತಂಡ", "emails.magicSession.subject": "ಲಾಗಿನ್", "emails.magicSession.hello": "ನಮಸ್ಕಾರ,", @@ -20,12 +21,14 @@ "emails.recovery.body": "ನಿಮ್ಮ {{project}} ಗುಪ್ತಪದವನ್ನು ಮರುಹೊಂದಿಸಲು ಈ ಲಿಂಕನ್ನು ಅನುಸರಿಸಿ", "emails.recovery.footer": "ನೀವು ಗುಪ್ತಪದವನ್ನು ಮರುಹೊಂದಿಸಲು ಕೇಳದಿದ್ದರೆ, ಈ ಸಂದೇಶವನ್ನು ನಿರ್ಲಕ್ಷಿಸಿ", "emails.recovery.thanks": "ಧನ್ಯವಾದಗಳು,", + "emails.recovery.buttonText": "ಗುಪ್ತಪದವನ್ನು ಮರುಸೆಟ್ ಮಾಡಿ", "emails.recovery.signature": "{{project}} ತಂಡ", "emails.invitation.subject": "%s ತಂಡಕ್ಕೆ %s ರಲ್ಲಿ ಆಹ್ವಾನ", "emails.invitation.hello": "ನಮಸ್ಕಾರ,", "emails.invitation.body": "ಈ ಇಮೇಲ್ ನಿಮಗೆ ಬಂದಿದೆ ಏಕೆಂದರೆ {{owner}} ನಿಮ್ಮನ್ನು {{team}} ತಂಡದ {{project}}ರಲ್ಲಿ ಸದಸ್ಯ ಆಗಲಿಕ್ಕೆ ಆಹ್ವಾನಿಸಿದ್ದಾರೆ", "emails.invitation.footer": "ನಿಮಗೆ ಆಸಕ್ತಿಯಿಲ್ಲದಿದ್ದರೆ, ಈ ಸಂದೇಶವನ್ನು ನಿರ್ಲಕ್ಷಿಸಿ", "emails.invitation.thanks": "ಧನ್ಯವಾದಗಳು,", + "emails.invitation.buttonText": "{{team}} ಗೆ ಆಹ್ವಾನವನ್ನು ಸ್ವೀಕರಿಸಿ", "emails.invitation.signature": "{{project}} ತಂಡ", "locale.country.unknown": "Unknown", "countries.af": "ಅಫ್ಘಾನಿಸ್ತಾನ", diff --git a/app/config/locale/translations/ko.json b/app/config/locale/translations/ko.json index c33c961130..0bc425aeae 100644 --- a/app/config/locale/translations/ko.json +++ b/app/config/locale/translations/ko.json @@ -8,6 +8,7 @@ "emails.verification.body": "이메일 인증을 위해 링크를 클릭하여주세요.", "emails.verification.footer": "이메일 인증을 부탁하지 않으셨다면 이 메시지를 무시하여주세요.", "emails.verification.thanks": "감사합니다、", + "emails.verification.buttonText": "이메일 주소를 확인합니다", "emails.verification.signature": "{{project}} 팀", "emails.magicSession.subject": "로그인", "emails.magicSession.hello": "안녕하세요、", @@ -20,12 +21,14 @@ "emails.recovery.body": "{{project}}의 비밀번호 재설정을 위해 링크를 클릭하여주세요.", "emails.recovery.footer": "비밀번호 재설정 신청을 하지 않으셨다면 이 메세지를 무시하여주세요.", "emails.recovery.thanks": "감사합니다、", + "emails.recovery.buttonText": "비밀번호 재설정", "emails.recovery.signature": "{{project}} 팀", "emails.invitation.subject": "초대장 %s 팀 - %s", "emails.invitation.hello": "안녕하세요、", "emails.invitation.body": "{{owner}}님이 귀하를 {{project}}의 {{team}} 팀으로 초대합니다.", "emails.invitation.footer": "팀에 합류할 의사가 없으시면 이 메세지를 무시하여주세요.", "emails.invitation.thanks": "감사합니다、", + "emails.invitation.buttonText": "{{team}} 초대를 수락하기", "emails.invitation.signature": "{{project}} 팀", "locale.country.unknown": "알려지지 않은", "countries.af": "아프가니스탄", diff --git a/app/config/locale/translations/la.json b/app/config/locale/translations/la.json index bebef26854..fe3e7930e2 100644 --- a/app/config/locale/translations/la.json +++ b/app/config/locale/translations/la.json @@ -8,6 +8,7 @@ "emails.verification.body": "Sequere hanc nexum ut quin inscriptionem tuum.", "emails.verification.footer": "Si verificationem huius inscriptionis non postulasti, nuntium hunc ignorare potes.", "emails.verification.thanks": "Gratias,", + "emails.verification.buttonText": "Confirma inscriptionem electronicam", "emails.verification.signature": "{{project}} Team", "emails.magicSession.subject": "Log in", "emails.magicSession.hello": "Salve ibi,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Sequere hanc conjunctionem ut recipias project password {{project}}", "emails.recovery.footer": "Si tesseram tuam recuperare non petis, nuntium hunc ignorare potes", "emails.recovery.thanks": "Gratias,", + "emails.recovery.buttonText": "Reset password", "emails.recovery.signature": "{{project}} team", "emails.invitation.subject": "Invitatio pro %s in quadrigis %s", "emails.invitation.hello": "Salve ibi,", "emails.invitation.body": "Haec inscriptio ad te missa est quia dominus incepto {{owner}} te invitare vult ut membrum {{team}} quadrigis fias ad {{project}}", "emails.invitation.footer": "Si non quaero, potes hunc nuntium ignorare", "emails.invitation.thanks": "Gratias,", + "emails.invitation.buttonText": "Accipe invitare ad {{team}}", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Ignotum", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/lb.json b/app/config/locale/translations/lb.json index 91b52e4a18..8fe4b346e7 100644 --- a/app/config/locale/translations/lb.json +++ b/app/config/locale/translations/lb.json @@ -8,6 +8,7 @@ "emails.verification.body": "Follegt dëse Link fir Är E -Mail Adress z'iwwerpréiwen.", "emails.verification.footer": "Wann Dir net gefrot hutt dës Adress z'iwwerpréiwen, kënnt Dir dëse Message ignoréieren.", "emails.verification.thanks": "Merci,", + "emails.verification.buttonText": "E-Mail-Adress bestätegen", "emails.verification.signature": "{{project}} équipe", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Hey,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Follegt dëse Link fir Äert {{project}} Passwuert zréckzesetzen.", "emails.recovery.footer": "Wann Dir net gefrot hutt Äert Passwuert zréckzesetzen, kënnt Dir dëse Message ignoréieren.", "emails.recovery.thanks": "Merci,", + "emails.recovery.buttonText": "Passwuert zrécksetzen", "emails.recovery.signature": "{{project}} équipe", "emails.invitation.subject": "Invitatioun un %s équipe bei %s", "emails.invitation.hello": "Hallo,", "emails.invitation.body": "Dës E -Mail gouf un Iech geschéckt well {{owner}} Iech invitéiere wëllt fir Member vum {{team}} Team bei {{project}} ze ginn.", "emails.invitation.footer": "Wann Dir net interesséiert sidd, kënnt Dir dëse Message ignoréieren.", "emails.invitation.thanks": "Merci,", + "emails.invitation.buttonText": "Invitatioun bei {{team}} akzeptéieren", "emails.invitation.signature": "{{project}} équipe", "locale.country.unknown": "Onbekannt", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/lt.json b/app/config/locale/translations/lt.json index 94c874ce82..2439428b02 100644 --- a/app/config/locale/translations/lt.json +++ b/app/config/locale/translations/lt.json @@ -8,6 +8,7 @@ "emails.verification.body": "Spauskite šią nuorodą, kad patvirtintumėte savo el. paštą.", "emails.verification.footer": "Jei neprašėte patvirtinti šio el. pašto, galite ignoruoti šį pranešimą.", "emails.verification.thanks": "Ačiū,", + "emails.verification.buttonText": "Patvirtinti el. pašto adresą", "emails.verification.signature": "{{project}} komanda", "emails.magicSession.subject": "Prisijungti", "emails.magicSession.hello": "Labas,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Spauskite šią nuorodą, kad atkurtumėte projekto {{project}} slaptažodį.", "emails.recovery.footer": "Jei neprašėte atkurti savo slaptažodzio, galite ignoruoti šį pranešimą.", "emails.recovery.thanks": "Ačiū,", + "emails.recovery.buttonText": "Atstatyti slaptažodį", "emails.recovery.signature": "{{project}} komanda", "emails.invitation.subject": "Pakvietimas į %s komandą %s projekte", "emails.invitation.hello": "Labas,", "emails.invitation.body": "Šis el. laiškas buvo atsiųstas jums, nes {{owner}} norėjo jus pakviesti tapti projekto {{project}} dalimi {{team}} komandoje.", "emails.invitation.footer": "Jei jūsų tai nedomina, galite ignoruoti šį pranešimą.", "emails.invitation.thanks": "Ačiū,", + "emails.invitation.buttonText": "Priimti kvietimą į {{team}}", "emails.invitation.signature": "{{project}} komanda", "locale.country.unknown": "Nežinoma", "countries.af": "Afganistanas", diff --git a/app/config/locale/translations/lv.json b/app/config/locale/translations/lv.json index b4a396367c..59edfce7a6 100644 --- a/app/config/locale/translations/lv.json +++ b/app/config/locale/translations/lv.json @@ -8,6 +8,7 @@ "emails.verification.body": "Sekojiet saitei, lai apstiprinātu savu e-pasta adresi.", "emails.verification.footer": "Ja Jūs nepieprasījāt šīs adreses apstiprinājumu, lūdzu, ignorējiet šo ziņu.", "emails.verification.thanks": "Paldies,", + "emails.verification.buttonText": "Apstiprināt e-pasta adresi", "emails.verification.signature": "{{project}} komanda", "emails.magicSession.subject": "Ieiet", "emails.magicSession.hello": "Sveicināti,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Sekojiet saitei, lai atjauninātu {{project}} paroli.", "emails.recovery.footer": "Ja Jūs nepieprasījāt paroles atjaunināšanu, lūdzu, ignorējiet šo ziņu.", "emails.recovery.thanks": "Paldies,", + "emails.recovery.buttonText": "Atiestatīt paroli", "emails.recovery.signature": "{{project}} komanda", "emails.invitation.subject": "Ielūgums piebiedroties %s komandai %s projektā.", "emails.invitation.hello": "Labdien,", "emails.invitation.body": "Šis e-pasts tika nosūtīts Jums, jo {{owner}} vēlējās Jūs ielūgt kļūt par {{team}} komandas biedru {{project}} projektā.", "emails.invitation.footer": "Ja Jūs neesat ieinteresēts, lūdzu, ignorējiet šo ziņu.", "emails.invitation.thanks": "Paldies,", + "emails.invitation.buttonText": "Pieņemt ielūgumu uz {{team}}", "emails.invitation.signature": "{{project}} komanda", "locale.country.unknown": "Nav zināms", "countries.af": "Afganistāna", diff --git a/app/config/locale/translations/ml.json b/app/config/locale/translations/ml.json index 1b57d87865..bd13f92fa8 100644 --- a/app/config/locale/translations/ml.json +++ b/app/config/locale/translations/ml.json @@ -8,6 +8,7 @@ "emails.verification.body": "നിങ്ങളുടെ ഇമെയിൽ വിലാസം സ്ഥിരീകരിക്കുന്നതിനായി ഈ ലിങ്ക് പിന്തുടരുക.", "emails.verification.footer": "ഈ വിലാസം സ്ഥിരീകരിക്കാന്‍ നിങ്ങൾ ആവശ്യപ്പെട്ടില്ലെങ്കിൽ, നിങ്ങൾക്ക് ഈ സന്ദേശം അവഗണിക്കാവുന്നതാണ്.", "emails.verification.thanks": "നന്ദി,", + "emails.verification.buttonText": "ഇമെയിൽ വിലാസം സ്ഥിരീകരിക്കുക", "emails.verification.signature": "{{project}} ടീം", "emails.magicSession.subject": "ലോഗിൻ", "emails.magicSession.hello": "നമസ്കാരം,", @@ -20,12 +21,14 @@ "emails.recovery.body": "നിങ്ങളുടെ {{Project}} രഹസ്യവാക്ക് പുനക്രമീകരിക്കുന്നതിന് ഈ ലിങ്ക് പിന്തുടരുക.", "emails.recovery.footer": "നിങ്ങളുടെ രഹസ്യവാക്ക് പുനക്രമീകരിക്കാന്‍ നിങ്ങൾ ആവശ്യപ്പെട്ടില്ലെങ്കിൽ, ഈ സന്ദേശം അവഗണിക്കാവുന്നതാണ്.", "emails.recovery.thanks": "നന്ദി,", + "emails.recovery.buttonText": "പാസ്‌വേഡ് റീസെറ്റ് ചെയ്യുക", "emails.recovery.signature": "{{project}} ടീം", "emails.invitation.subject": "%s -ലെ %s ടീമിലേക്കുള്ള ക്ഷണം", "emails.invitation.hello": "നമസ്കാരം,", "emails.invitation.body": "നിങ്ങളെ {{project}} -ലെ {{team}} ടീമിലെ അംഗമാകുവാന്‍ ക്ഷണിക്കാൻ {{owner}} ആഗ്രഹിക്കുന്നതിനാലാണ് ഈ മെയിൽ നിങ്ങൾക്ക് അയക്കുന്നത്.", "emails.invitation.footer": "നിങ്ങൾക്ക് താൽപ്പര്യമില്ലെങ്കിൽ, ഈ സന്ദേശം അവഗണിക്കാവുന്നതാണ്.", "emails.invitation.thanks": "നന്ദി,", + "emails.invitation.buttonText": "{{team}} ലേക്കുള്ള ക്ഷണം സ്വീകരിക്കുക", "emails.invitation.signature": "{{project}} ടീം", "locale.country.unknown": "Unknown", "countries.af": "അഫ്ഗാനിസ്ഥാൻ", diff --git a/app/config/locale/translations/mr.json b/app/config/locale/translations/mr.json index 6550d1c1ba..881afdfe71 100644 --- a/app/config/locale/translations/mr.json +++ b/app/config/locale/translations/mr.json @@ -8,6 +8,7 @@ "emails.verification.body": "आपला ईमेल पत्ता सत्यापित करण्यासाठी या दुव्याचे अनुसरण करा.", "emails.verification.footer": "आपण या पत्त्याची पडताळणी करण्यास सांगितले नसल्यास, आपण या संदेशाकडे दुर्लक्ष करू शकता.", "emails.verification.thanks": "धन्यवाद,", + "emails.verification.buttonText": "ईमेल पत्ता सत्यापित करा", "emails.verification.signature": "{{project}} संघ", "emails.magicSession.subject": "लॉगिन करा", "emails.magicSession.hello": "नमस्कार ,", @@ -20,12 +21,14 @@ "emails.recovery.body": "आपला {{project}}चे पासवर्ड रीसेट करण्यासाठी या लिंकचे अनुसरण करा", "emails.recovery.footer": "आपण आपला पासवर्ड रीसेट करण्यास सांगितले नसल्यास, आपण या संदेशाकडे दुर्लक्ष करू शकता.", "emails.recovery.thanks": "धन्यवाद,", + "emails.recovery.buttonText": "पासवर्ड रीसेट करा", "emails.recovery.signature": "{{project}} संघ", "emails.invitation.subject": "%s संघ %s येथे सामील होण्यासाठी आमंत्रण", "emails.invitation.hello": "नमस्कार,", "emails.invitation.body": "हा मेल तुम्हाला पाठवला होता कारण {{owner}} तुम्हाला {{project}} येथे {{team}} टीमचे सदस्य होण्यासाठी आमंत्रित करू इच्छित होते.", "emails.invitation.footer": "आपल्याला स्वारस्य नसल्यास, आपण या संदेशाकडे दुर्लक्ष करू शकता.", "emails.invitation.thanks": "धन्यवाद,", + "emails.invitation.buttonText": "{{team}} साठी आमंत्रण स्वीकारा", "emails.invitation.signature": "{{project}} संघ", "locale.country.unknown": "अज्ञात", "countries.af": "अफगानिस्तान", diff --git a/app/config/locale/translations/ms.json b/app/config/locale/translations/ms.json index a02c36b075..448307550e 100644 --- a/app/config/locale/translations/ms.json +++ b/app/config/locale/translations/ms.json @@ -8,6 +8,7 @@ "emails.verification.body": "Tekan pautan ini untuk mengesahkan alamat email anda.", "emails.verification.footer": "Sekiranya anda tidak membuat permintaan untuk mengesahkan email ini, sila abaikan mesej ini.", "emails.verification.thanks": "Terima kasih,", + "emails.verification.buttonText": "Sahkan alamat email", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "Log masuk", "emails.magicSession.hello": "Hey,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Tekan pautan ini untuk menetapkan semula kata laluan {{project}}.", "emails.recovery.footer": "Sekiranya anda tidak membuat permintaan menetap semula kata laluan, sila abaikan mesej ini.", "emails.recovery.thanks": "Terima kasih,", + "emails.recovery.buttonText": "Tetapkan semula kata laluan", "emails.recovery.signature": "{{project}} team", "emails.invitation.subject": "Jemputan ke pasukan %s di %s", "emails.invitation.hello": "Hello,", "emails.invitation.body": "Anda menerima mel ini kerana {{owner}} ingin menjemput anda untuk menjadi ahli pasukan {{team}} di {{project}}.", "emails.invitation.footer": "Sekiranya anda tidak berminat, sila abaikan mesej ini.", "emails.invitation.thanks": "Terima kasih,", + "emails.invitation.buttonText": "Terima jemputan ke {{team}}", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Tidak Diketahui", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/nb.json b/app/config/locale/translations/nb.json index daf18abc1c..cc95bacf9e 100644 --- a/app/config/locale/translations/nb.json +++ b/app/config/locale/translations/nb.json @@ -8,6 +8,7 @@ "emails.verification.body": "Følg denne lenken for å bekrefte din e-postadresse.", "emails.verification.footer": "Dersom du ikke ba om å bekrefte e-postadressen, kan du se bort fra denne meldingen.", "emails.verification.thanks": "Takk,", + "emails.verification.buttonText": "Bekreft e-postadresse", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "Pålogging", "emails.magicSession.hello": "Hei,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Følg denne lenken for å nullstille ditt {{project}} passord.", "emails.recovery.footer": "Dersom du ikke ba om å nullstille passordet ditt, kan du se bort fra denne meldingen.", "emails.recovery.thanks": "Takk,", + "emails.recovery.buttonText": "Tilbakestill passord", "emails.recovery.signature": "{{project}} team", "emails.invitation.subject": "Invitasjon til %s Team ved %s", "emails.invitation.hello": "Hei,", "emails.invitation.body": "Denne meldingen ble sendt til deg fordi {{owner}} ønsket å invitere deg til å bli medlem av {{team}} team ved {{project}}.", "emails.invitation.footer": "Dersom du ikke er interessert, kan du se bort fra denne meldingen.", "emails.invitation.thanks": "Takk,", + "emails.invitation.buttonText": "Godta invitasjon til {{team}}", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Ukjent", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/ne.json b/app/config/locale/translations/ne.json index 4f05a9b5ba..f1ba841fed 100644 --- a/app/config/locale/translations/ne.json +++ b/app/config/locale/translations/ne.json @@ -8,6 +8,7 @@ "emails.verification.body": "इमेल ठेगाना प्रमाणित गर्नको लागी यो लिंकमा जानुहोस।", "emails.verification.footer": "यदि तपाइँले आफ्नो खाता प्रमाणित गर्न सोध्नु भएको छैन भने तपाइँले यो सन्देश लाई बेवास्ता गर्न सक्नुहुन्छ।", "emails.verification.thanks": "धन्यवाद,", + "emails.verification.buttonText": "इमेल ठेगाना पुष्टि गर्नुहोस्", "emails.verification.signature": "{{project}} समूह", "emails.magicSession.subject": "लगइन", "emails.magicSession.hello": "नमस्ते,", @@ -20,12 +21,14 @@ "emails.recovery.body": "{{project}}को पासवर्ड रिसेट गर्नको लागी यो लिंकमा जानुहोस।", "emails.recovery.footer": "यदि तपाइँले आफ्नो पासवर्ड रिसेट गर्न सोध्नु भएको छैन भने तपाइँले यो सन्देश लाई बेवास्ता गर्न सक्नुहुन्छ।", "emails.recovery.thanks": "धन्यवाद,", + "emails.recovery.buttonText": "रिसेट पासवर्ड", "emails.recovery.signature": "{{project}} समूह", "emails.invitation.subject": "%s समूहको लागि %s मा निमन्त्रणा", "emails.invitation.hello": "नमस्ते,", "emails.invitation.body": "{{owner}}ले तपाइँलाई {{project}}मा {{team}}को सदस्य बन्न आमन्त्रित गर्न चाहनु भएको छ। त्येसैले तपाइँलाई यो सन्देश पठाइएको हो।", "emails.invitation.footer": "यदि तपाइँ इच्छुक हुनुहुन्न भने, तपाइँले यो सन्देशलाई बेवास्ता गर्न सक्नुहुन्छ।", "emails.invitation.thanks": "धन्यवाद,", + "emails.invitation.buttonText": "{{team}} मा निमन्त्रणा स्वीकार गर्नुहोस्", "emails.invitation.signature": "{{project}} समूह", "locale.country.unknown": "अज्ञात", "countries.af": "अफगानिस्तान", diff --git a/app/config/locale/translations/nl.json b/app/config/locale/translations/nl.json index cae82a9a37..4f71f67199 100644 --- a/app/config/locale/translations/nl.json +++ b/app/config/locale/translations/nl.json @@ -8,6 +8,7 @@ "emails.verification.body": "Volg deze link om uw e-mail te verifieren", "emails.verification.footer": "Als u geen aanvraag voor verificatie heeft gemaakt, kan u deze mail negeren", "emails.verification.thanks": "Bedankt,", + "emails.verification.buttonText": "Bevestig e-mailadres", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Hoi,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Volg deze link om het wachtwoord van uw project {{project}} te wijzigen", "emails.recovery.footer": "Als u geen aanvraag heeft gemaakt om uw wachtwoord te wijzigen, kan u deze mail negeren", "emails.recovery.thanks": "Bedankt,", + "emails.recovery.buttonText": "Wachtwoord opnieuw instellen", "emails.recovery.signature": "{{project}} team", "emails.invitation.subject": "Uitnodiging van %s Team uit %s", "emails.invitation.hello": "Hallo,", "emails.invitation.body": "U ontvangt deze mail want u was uitgenodig door {{owner}} om lid van het {{team}} team te worden in {{project}} ", "emails.invitation.footer": "Als u niet geintereseerd bent, kan u deze mail negeren.", "emails.invitation.thanks": "Bedankt,", + "emails.invitation.buttonText": "Uitnodiging voor {{team}} accepteren", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Onbekend", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/nn.json b/app/config/locale/translations/nn.json index 44be0f9845..646a57904c 100644 --- a/app/config/locale/translations/nn.json +++ b/app/config/locale/translations/nn.json @@ -8,6 +8,7 @@ "emails.verification.body": "Følg denne lenkja for å bekrefta din e-postadresse.", "emails.verification.footer": "Om du ikkje bad om å bekrefta e-postadressa, kan du ignorera denne meldinga.", "emails.verification.thanks": "Takk,", + "emails.verification.buttonText": "Stadfest e-postadresse", "emails.verification.signature": "{{project}} team", "emails.magicSession.subject": "Pålogging", "emails.magicSession.hello": "Hei,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Følg denne lenkja for å nullstilla ditt {{project}} passord.", "emails.recovery.footer": "Om du ikkje ba om å nullstilla passordet ditt, kan du ignorera denne meldinga.", "emails.recovery.thanks": "Takk,", + "emails.recovery.buttonText": "Nullstill passord", "emails.recovery.signature": "{{project}} team", "emails.invitation.subject": "Innbyding til %s Team ved %s", "emails.invitation.hello": "Hallo,", "emails.invitation.body": "Denne meldinga ble sendt til deg fordi {{owner}} ynskja å invitera deg til å bli medlem av {{team}} team i {{project}}.", "emails.invitation.footer": "Om du ikkje er interessert, kan du ignorera denne meldinga.", "emails.invitation.thanks": "Takk,", + "emails.invitation.buttonText": "Godta invitasjon til {{team}}", "emails.invitation.signature": "{{project}} team", "locale.country.unknown": "Ukjend", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/or.json b/app/config/locale/translations/or.json index efd516f23a..a8e08b8043 100644 --- a/app/config/locale/translations/or.json +++ b/app/config/locale/translations/or.json @@ -8,6 +8,7 @@ "emails.verification.body": "ଆପଣଙ୍କର ଇମେଲ୍ ଠିକଣା ଯାଞ୍ଚ କରିବାକୁ ଏହି ଲିଙ୍କ୍ ଅନୁସରଣ କରନ୍ତୁ |", "emails.verification.footer": "ଯଦି ଆପଣ ଏହି ଠିକଣା ଯାଞ୍ଚ କରିବାକୁ କହି ନାହାଁନ୍ତି, ତେବେ ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଉପେକ୍ଷା କରିପାରିବେ |", "emails.verification.thanks": "ଧନ୍ୟବାଦ,", + "emails.verification.buttonText": "ଇମେଲ ଠିକଣା ନିଶ୍ଚିତ କରନ୍ତୁ", "emails.verification.signature": "{{project}} ଦଳ", "emails.magicSession.subject": "ଲଗଇନ୍ କରନ୍ତୁ", "emails.magicSession.hello": "ନମସ୍କାର,", @@ -20,12 +21,14 @@ "emails.recovery.body": "ଆପଣଙ୍କର {{project}} ପାସୱାର୍ଡ ପୁନଃ ସେଟ୍ କରିବାକୁ ଏହି ଲିଙ୍କକୁ ଅନୁସରଣ କରନ୍ତୁ |", "emails.recovery.footer": "ଯଦି ଆପଣ ଆପଣଙ୍କର ପାସୱାର୍ଡ ପୁନଃ ସେଟ୍ କରିବାକୁ କହି ନାହାଁନ୍ତି, ତେବେ ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଉପେକ୍ଷା କରିପାରିବେ |", "emails.recovery.thanks": "ଧନ୍ୟବାଦ,", + "emails.recovery.buttonText": "ପାସୱାର୍ଡ ପୁନଃସେଟ୍ କରନ୍ତୁ", "emails.recovery.signature": "{{project}} ଦଳ", "emails.invitation.subject": "%s ରେ %s ଦଳକୁ ନିମନ୍ତ୍ରଣ |", "emails.invitation.hello": "ନମସ୍କାର,", "emails.invitation.body": "ଏହି ମେଲ୍ ଆପଣଙ୍କୁ ପଠାଯାଇଥିଲା କାରଣ {{owner}} ଆପଣଙ୍କୁ {{project} ରେ {{team}} ଦଳର ସଦସ୍ୟ ହେବାକୁ ଆମନ୍ତ୍ରଣ କରିବାକୁ ଚାହୁଁଥିଲେ |", "emails.invitation.footer": "ଯଦି ଆପଣ ଆଗ୍ରହୀ ନୁହଁନ୍ତି, ଆପଣ ଏହି ସନ୍ଦେଶକୁ ଅଣଦେଖା କରିପାରିବେ |", "emails.invitation.thanks": "ଧନ୍ୟବାଦ,", + "emails.invitation.buttonText": "{{team}} ପାଇଁ ଆମନ୍ତ୍ରଣ ଗ୍ରହଣ କରନ୍ତୁ", "emails.invitation.signature": "{{project}} ଦଳ", "locale.country.unknown": "ଅଜ୍ଞାତ", "countries.af": "ଆଫଗାନିସ୍ତାନ", diff --git a/app/config/locale/translations/pl.json b/app/config/locale/translations/pl.json index ee5811fb59..75bc3a24f9 100644 --- a/app/config/locale/translations/pl.json +++ b/app/config/locale/translations/pl.json @@ -8,6 +8,7 @@ "emails.verification.body": "Przejdź do tego linku, aby zweryfikować swój adres e-mail.", "emails.verification.footer": "Jeśli to nie Ty prosiłeś o zweryfikowanie tego adresu, zignoruj tę wiadomość.", "emails.verification.thanks": "Dziękujemy,", + "emails.verification.buttonText": "Potwierdź adres e-mail", "emails.verification.signature": "Zespół {{project}}", "emails.magicSession.subject": "Logowanie", "emails.magicSession.hello": "Cześć,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Przejdź do tego linku, aby zresetować hasło dla {{project}}.", "emails.recovery.footer": "Jeśli to nie Ty prosiłeś o zresetowanie swojego hasła, zignoruj tę wiadomość.", "emails.recovery.thanks": "Dziękujemy,", + "emails.recovery.buttonText": "Zresetuj hasło", "emails.recovery.signature": "Zespół {{project}}", "emails.invitation.subject": "Zaproszenie do zespołu %s w %s", "emails.invitation.hello": "Cześć,", "emails.invitation.body": "Otrzymujesz tę wiadomość, ponieważ {{owner}} zaprasza Cię do grona członków zespołu {{team}} w projekcie {{project}}.", "emails.invitation.footer": "Jeśli nie jesteś zainteresowany, zignoruj tę wiadomość.", "emails.invitation.thanks": "Dziękujemy,", + "emails.invitation.buttonText": "Zaakceptuj zaproszenie do {{team}}", "emails.invitation.signature": "Zespół {{project}}", "locale.country.unknown": "Nieznany", "countries.af": "Afganistan", diff --git a/app/config/locale/translations/pt-br.json b/app/config/locale/translations/pt-br.json index a53ca79813..7e3af1d3f1 100644 --- a/app/config/locale/translations/pt-br.json +++ b/app/config/locale/translations/pt-br.json @@ -8,6 +8,7 @@ "emails.verification.body": "Clique neste link para verificar o seu endereço de e-mail.", "emails.verification.footer": "Se você não solicitou a verificação deste e-mail, ignore essa mensagem.", "emails.verification.thanks": "Muito obrigado,", + "emails.verification.buttonText": "Confirmar endereço de e-mail", "emails.verification.signature": "Time {{project}}", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Olá,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Clique neste link para redefinir sua senha do {{project}}.", "emails.recovery.footer": "Se você não solicitou a redefinição da sua senha, você pode ignorar essa mensagem.", "emails.recovery.thanks": "Muito obrigado,", + "emails.recovery.buttonText": "Redefinir senha", "emails.recovery.signature": "Time {{project}}", "emails.invitation.subject": "Convite para o Time %s em %s", "emails.invitation.hello": "Olá,", "emails.invitation.body": "Este e-mail foi enviado porque {{owner}} deseja convidar você a se tornar membro do Time {{team}} em {{project}}.", "emails.invitation.footer": "Caso não tenha interesse, ignore essa mensagem.", "emails.invitation.thanks": "Muito obrigado,", + "emails.invitation.buttonText": "Aceitar convite para {{team}}", "emails.invitation.signature": "Time {{project}}", "locale.country.unknown": "Desconhecido", "countries.af": "Afeganistão", diff --git a/app/config/locale/translations/pt-pt.json b/app/config/locale/translations/pt-pt.json index d85dca9300..c13ce558bf 100644 --- a/app/config/locale/translations/pt-pt.json +++ b/app/config/locale/translations/pt-pt.json @@ -8,6 +8,7 @@ "emails.verification.body": "Siga esta ligação para verificar o seu endereço de correio electrónico.", "emails.verification.footer": "Se não pediu para verificar este endereço, pode ignorar esta mensagem.", "emails.verification.thanks": "Obrigado,", + "emails.verification.buttonText": "Confirmar endereço de email", "emails.verification.signature": "Equipa {{project}}", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Olá ,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Utilize este link para redefinir a palavra-passe do seu projecto {{project}}", "emails.recovery.footer": "Se não pediu para redefinir a sua palavra-passe, pode ignorar esta mensagem.", "emails.recovery.thanks": "Obrigado,", + "emails.recovery.buttonText": "Repor palavra-passe", "emails.recovery.signature": "Equipa {{project}}", "emails.invitation.subject": "Convite à equipa de %s às %s", "emails.invitation.hello": "Olá,", "emails.invitation.body": "Este correio foi-lhe enviado porque {{owner}} queria convidá-lo a tornar-se membro da equipa {{team}} da {{project}}.", "emails.invitation.footer": "Se não estiver interessado, pode ignorar esta mensagem.", "emails.invitation.thanks": "Obrigado,", + "emails.invitation.buttonText": "Aceitar convite para o {{team}}", "emails.invitation.signature": "Equipa {{project}}", "locale.country.unknown": "Desconhecido", "countries.af": "Afeganistão", diff --git a/app/config/locale/translations/ro.json b/app/config/locale/translations/ro.json index 04cb22dd6b..88499ce3f6 100644 --- a/app/config/locale/translations/ro.json +++ b/app/config/locale/translations/ro.json @@ -8,6 +8,7 @@ "emails.verification.body": "Click pe acest link pentru a valida adresa de email.", "emails.verification.footer": "Dacă nu ai cerut validarea adresei de email, poți ignora acest mesaj.", "emails.verification.thanks": "Mulțumim,", + "emails.verification.buttonText": "Confirmă adresa de email", "emails.verification.signature": "Echipa {{project}}", "emails.magicSession.subject": "Login", "emails.magicSession.hello": "Bună ziua,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Click aici pentru a reseta parola pentru {{project}}", "emails.recovery.footer": "Dacă nu ai cerut să îți schimbi parola, ignoră acest mesaj.", "emails.recovery.thanks": "Mulțumim,", + "emails.recovery.buttonText": "Resetează parola", "emails.recovery.signature": "Echipa {{project}}", "emails.invitation.subject": "Invitatie catre %s Echipa la %s", "emails.invitation.hello": "Bună ziua,", "emails.invitation.body": "Acest email a fost trimis pentru că {{owner}} a vrut ca tu să devii membru al echipei {{team}} la {{project}}.", "emails.invitation.footer": "Dacă nu esti interesat, poți ignora acest email.", "emails.invitation.thanks": "Mulțumim,", + "emails.invitation.buttonText": "Acceptă invitația la {{team}}", "emails.invitation.signature": "Echipa {{project}}", "locale.country.unknown": "Necunoscut", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/ru.json b/app/config/locale/translations/ru.json index 029aa06ee7..f61337de80 100644 --- a/app/config/locale/translations/ru.json +++ b/app/config/locale/translations/ru.json @@ -8,6 +8,7 @@ "emails.verification.body": "Перейдите по ссылке, чтобы подтвердить свой адрес электронной почты.", "emails.verification.footer": "Если вы не запрашивали подтверждение этого адреса, проигнорируйте это сообщение.", "emails.verification.thanks": "Спасибо,", + "emails.verification.buttonText": "Подтвердить адрес электронной почты", "emails.verification.signature": "команда {{project}}", "emails.magicSession.subject": "Логин", "emails.magicSession.hello": "Здравствуйте,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Перейдите по этой ссылке для того чтобы сбросить свой пароль для проекта {{project}}", "emails.recovery.footer": "Если вы не запрашивали сброс пароля, проигнорируйте это сообщение.", "emails.recovery.thanks": "Спасибо,", + "emails.recovery.buttonText": "Сбросить пароль", "emails.recovery.signature": "команда {{project}}", "emails.invitation.subject": "Приглашение в команду %s по проекту %s", "emails.invitation.hello": "Здравствуйте,", "emails.invitation.body": "Это письмо отправлено вам, потому что {{owner}} приглашает стать членом команды {{team}} в проекте {{project}}.", "emails.invitation.footer": "Если вы не заинтересованы, проигнорируйте это сообщение.", "emails.invitation.thanks": "Спасибо,", + "emails.invitation.buttonText": "Принять приглашение в {{team}}", "emails.invitation.signature": "команда {{project}}", "locale.country.unknown": "Неизвестно", "countries.af": "Афганистан", diff --git a/app/config/locale/translations/sa.json b/app/config/locale/translations/sa.json index 7aa8c90d77..b3326110d1 100644 --- a/app/config/locale/translations/sa.json +++ b/app/config/locale/translations/sa.json @@ -8,6 +8,7 @@ "emails.verification.body": "ई-पत्रनिर्णायनार्थमिदं संयोगसूत्रमनुसरतु।", "emails.verification.footer": "यदि अस्य संकेतस्य निर्णायनं नेष्यते तर्हि वात्र्तामिमामुपेक्षताम्‌।", "emails.verification.thanks": "धन्यवादः,", + "emails.verification.buttonText": "ईमेल-पत्त्रं सुनिश्चित करें", "emails.verification.signature": "{{project}} गणः", "emails.magicSession.subject": "संप्रवेशः", "emails.magicSession.hello": "अयि,", @@ -20,12 +21,14 @@ "emails.recovery.body": "{{project}} कूटशब्दपुनयाेजनाय संयोगमेनमनुसरतु।", "emails.recovery.footer": "यदि कूटशब्दस्य पुनयाेजनं नेष्यते तर्हि वात्र्तामिमामुपेक्षताम्‌।", "emails.recovery.thanks": "धन्यवादः,", + "emails.recovery.buttonText": "गुप्तशब्दं पुनः स्थापित करें", "emails.recovery.signature": "{{project}} गणः", "emails.invitation.subject": "गणस्य आमन्त्रणम्‌ %s इति %s", "emails.invitation.hello": "अयि भो,", "emails.invitation.body": "{{owner}} {{team}} गणे {{project}} मध्ये भवद्योगदानमच्छितीति हेतोः पत्रमदिं भवत्सकाशं प्रेषतिम्।", "emails.invitation.footer": "यदि भवदनिच्छा तर्हि वात्र्तामिमामुपेक्षताम्‌।", "emails.invitation.thanks": "धन्यवादः,", + "emails.invitation.buttonText": "{{team}} निमन्त्रणं स्वीकुरुत", "emails.invitation.signature": "{{project}} गणः", "locale.country.unknown": "अज्ञातम्‌ ", "countries.af": "आफगानिस्थानम्‌", diff --git a/app/config/locale/translations/sd.json b/app/config/locale/translations/sd.json index 3f1f7678db..26c89a1770 100644 --- a/app/config/locale/translations/sd.json +++ b/app/config/locale/translations/sd.json @@ -8,6 +8,7 @@ "emails.verification.body": "پنھنجي اي ميل ايڊريس جي تصديق ڪرڻ لاءِ ھن لنڪ تي عمل ڪريو.", "emails.verification.footer": "جيڪڏھن توھان نه پ askيا ھئا ھن ايڊريس جي تصديق ڪرڻ لاءِ ، توھان نظر انداز ڪري سگھوٿا ھن پيغام کي.", "emails.verification.thanks": "مهرباني,", + "emails.verification.buttonText": "اي ميل پتو تصديق ڪريو", "emails.verification.signature": "{{project}} ٽيم", "emails.magicSession.subject": "لاگ ان", "emails.magicSession.hello": "هي ,", @@ -20,12 +21,14 @@ "emails.recovery.body": "ھن لنڪ تي عمل ڪريو پنھنجو {{project}} پاسورڊ ري سيٽ ڪرڻ لاءِ.", "emails.recovery.footer": "جيڪڏھن توھان نه پ پيو ھو پنھنجي پاسورڊ کي ري سيٽ ڪرڻ لاءِ ، توھان نظر انداز ڪري سگھوٿا ھن پيغام کي.", "emails.recovery.thanks": "مهرباني,", + "emails.recovery.buttonText": "پاسورڊ ري سيٽ ڪريو", "emails.recovery.signature": "{{project}} ٽيم", "emails.invitation.subject": "%s ٽيم %s تيجي دعوت", "emails.invitation.hello": "هيلو,", "emails.invitation.body": "ھي اي ميل توھان ڏانھن موڪليو ويو آھي {اڪاڻ ته {{owner}} توھان کي دعوت ڏيڻ چاھي ٿو ته توھان {{team}} ٽيم جو ميمبر بڻجي {{project}} تي.", "emails.invitation.footer": "جيڪڏھن توھان دلچسپي نٿا رکو ، توھان نظر انداز ڪري سگھوٿا ھن پيغام کي.", "emails.invitation.thanks": "مهرباني,", + "emails.invitation.buttonText": "{{team}} جي دعوت قبول ڪريو", "emails.invitation.signature": "{{project}} ٽيم", "locale.country.unknown": "نامعلوم", "countries.af": "افغانستان", diff --git a/app/config/locale/translations/si.json b/app/config/locale/translations/si.json index 536e8d3604..e2053407ea 100644 --- a/app/config/locale/translations/si.json +++ b/app/config/locale/translations/si.json @@ -8,6 +8,7 @@ "emails.verification.body": "ඔබගේ විද්‍යුත් තැපැල් ලිපිනය සත්‍යාපනය කිරීමට මෙම සම්බන්ධකය අනුගමනය කරන්න.", "emails.verification.footer": "මෙම ලිපිනය සත්‍යාපනය කරන ලෙස ඔබ ඉල්ලුවේ නැත්නම්, ඔබට මෙම පණිවිඩය නොසලකා හැරිය හැක.", "emails.verification.thanks": "ස්තුතියි,", + "emails.verification.buttonText": "ඊමේල් ලිපිනය තහවුරු කරන්න", "emails.verification.signature": "{{project}} කණ්ඩායම", "emails.magicSession.subject": "ප්‍රවේශ වන්න", "emails.magicSession.hello": "හේයි,", @@ -20,12 +21,14 @@ "emails.recovery.body": "ඔබගේ {{project}} මුරපදය නැවත සැකසීමට මෙම සම්බන්ධකය අනුගමනය කරන්න.", "emails.recovery.footer": "ඔබගේ මුරපදය නැවත සකසන ලෙස ඔබ ඉල්ලුවේ නැත්නම්, ඔබට මෙම පණිවිඩය නොසලකා හැරිය හැක.", "emails.recovery.thanks": "ස්තුතියි,", + "emails.recovery.buttonText": "මුරපදය යළි පිහිටුවන්න", "emails.recovery.signature": "{{project}} කණ්ඩායම", "emails.invitation.subject": "%s කණ්ඩායමට ආරාධනා %s හි", "emails.invitation.hello": "ආයුබෝවන්,", "emails.invitation.body": "මෙම තැපැල් ඔබට එව්වේ, {{owner}} හට {{project}} හි {{team}} කණ්ඩායමේ සාමාජිකයෙකු වීමට ඔබට ආරාධනා කිරීමට අවශ්‍ය වූ බැවිනි.", "emails.invitation.footer": "ඔබ උනන්දුවක් නොදක්වන්නේ නම්, ඔබට මෙම පණිවිඩය නොසලකා හැරිය හැක.", "emails.invitation.thanks": "ස්තුතියි,", + "emails.invitation.buttonText": "{{team}} සඳහා ආරාධනය පිළිගෙනින්න", "emails.invitation.signature": "{{project}} කණ්ඩායම", "locale.country.unknown": "නොදන්නා", "countries.af": "ඇෆ්ගනිස්ථානය", diff --git a/app/config/locale/translations/sk.json b/app/config/locale/translations/sk.json index 93c12c0881..1b41d8031d 100644 --- a/app/config/locale/translations/sk.json +++ b/app/config/locale/translations/sk.json @@ -8,6 +8,7 @@ "emails.verification.body": "Použi tento link pre overenie svojej emailovej adresy.", "emails.verification.footer": "Ak si nepožiadal o overenie tejto adresy, môžeš túto správu ignorovať.", "emails.verification.thanks": "Ďakujeme.,", + "emails.verification.buttonText": "Potvrďte e-mailovú adresu", "emails.verification.signature": "{{project}} tím", "emails.magicSession.subject": "Prihlásenie", "emails.magicSession.hello": "Ahoj,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Použi tento link pre obnovenie svojho {{project}} hesla.", "emails.recovery.footer": "Ak si nepožiadal o obnovu svojho hesla, túto správu môžeš ignorovať.", "emails.recovery.thanks": "Ďakujeme,", + "emails.recovery.buttonText": "Obnoviť heslo", "emails.recovery.signature": "{{project}} tím", "emails.invitation.subject": "Pozvánka do %s Tímu v %s", "emails.invitation.hello": "Ahoj,", "emails.invitation.body": "Tento email ti bol zaslaný, pretože {{owner}} ťa pozval, aby si sa stal členom {{team}} tímu v projekte {{project}}.", "emails.invitation.footer": "Ak nemáš záujem, môžeš túto správu ignorovať.", "emails.invitation.thanks": "Ďakujeme,", + "emails.invitation.buttonText": "Prijať pozvánku do {{team}}", "emails.invitation.signature": "{{project}} tím", "locale.country.unknown": "Neznámy", "countries.af": "Afganistan", diff --git a/app/config/locale/translations/sn.json b/app/config/locale/translations/sn.json index d17a98ff42..9fcadfaa82 100644 --- a/app/config/locale/translations/sn.json +++ b/app/config/locale/translations/sn.json @@ -8,6 +8,7 @@ "emails.verification.body": "Tevedza chinongedzo ichi kuti uratidze kuti kero iyi ndeyako.", "emails.verification.footer": "Kana usina kukumbira kuti uratidze kuti kero iyi ndeyako, unogona kufuratira meseji iyi.", "emails.verification.thanks": "Ndatenda,", + "emails.verification.buttonText": "Simbisa kero yeemail", "emails.verification.signature": "Chikwata che{{project}}", "emails.magicSession.subject": "Pinda", "emails.magicSession.hello": "Hesi,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Baya chinongedzo ichi kuti uchinje pasiwedhi yako ye{{project}}.", "emails.recovery.footer": "Kana usina kukumbira kuchinja pasiwedhi yako, unogona kufuratira meseji iyi.", "emails.recovery.thanks": "Ndatenda,", + "emails.recovery.buttonText": "Gadzirisa password", "emails.recovery.signature": "Chikwata che{{project}}", "emails.invitation.subject": "Kukokwa kuchikwata che%s ku%s", "emails.invitation.hello": "Mhoro,", "emails.invitation.body": "Tsamba iyi yatumirwa kwauri nekuti {{owner}} anga achida kuti uve nhengo yechikwata che{{team}} pachirongwa che{{project}}.", "emails.invitation.footer": "Kana usiri kufarira kuve nhengo yechikwata ichi, unogona kufuratira meseji iyi.", "emails.invitation.thanks": "Ndatenda,", + "emails.invitation.buttonText": "Gamuchira kukokwa ku {{team}}", "emails.invitation.signature": "Chikwata che{{project}}", "locale.country.unknown": "Haizivikanwe", "countries.af": "Afuganisitani", diff --git a/app/config/locale/translations/sv.json b/app/config/locale/translations/sv.json index 8997fd53f8..9bff513f0c 100644 --- a/app/config/locale/translations/sv.json +++ b/app/config/locale/translations/sv.json @@ -8,6 +8,7 @@ "emails.verification.body": "Klicka på denna länk för att verifiera din email", "emails.verification.footer": "Om du inte bad om att verifiera den här e-postadressen kan du ignorera detta mail.", "emails.verification.thanks": "Tack,", + "emails.verification.buttonText": "Bekräfta e-postadress", "emails.verification.signature": "{{project}} teamet", "emails.magicSession.subject": "Logga in", "emails.magicSession.hello": "Hej,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Klicka på denna länk för att återställa lösenordet på {{project}}", "emails.recovery.footer": "Om du inte bad om att återställa ditt lösenord kan du ignorera detta mail.", "emails.recovery.thanks": "Tack,", + "emails.recovery.buttonText": "Återställ lösenord", "emails.recovery.signature": "{{project}} teamet", "emails.invitation.subject": "Inbjudan till %s teamet på %s", "emails.invitation.hello": "Hej,", "emails.invitation.body": "Detta mail skickades till dig eftersom {{owner}} ville bjuda in dig att bli medlem i teamet {{team}} på {{project}}.", "emails.invitation.footer": "Om du inte är intresserad kan du ignorera detta mail.", "emails.invitation.thanks": "Tack,", + "emails.invitation.buttonText": "Acceptera inbjudan till {{team}}", "emails.invitation.signature": "{{project}} teamet", "locale.country.unknown": "Okänt", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/ta.json b/app/config/locale/translations/ta.json index f0695867a9..4afcbe9b63 100644 --- a/app/config/locale/translations/ta.json +++ b/app/config/locale/translations/ta.json @@ -8,6 +8,7 @@ "emails.verification.body": "உங்கள் மின்னஞ்சல் முகவரியைச் சரிபார்க்க இந்த இணைப்பைப் பின்தொடரவும்.", "emails.verification.footer": "இந்த முகவரியைச் சரிபார்க்கும்படி உங்களிடம் கேட்கப்படவில்லை என்றால், இந்தச் செய்தியை நீங்கள் புறக்கணிக்கலாம்.", "emails.verification.thanks": "நன்றி,", + "emails.verification.buttonText": "மின்னஞ்சல் முகவரியை உறுதிப்படுத்தவும்", "emails.verification.signature": "{{project}} குழு ", "emails.magicSession.subject": "உள்நுழைய", "emails.magicSession.hello": "ஏய்,", @@ -20,12 +21,14 @@ "emails.recovery.body": "மீட்டமைக்க இந்த இணைப்பைப் பின்தொடரவும் {{project}} கடவுச்சொல்.", "emails.recovery.footer": "உங்கள் கடவுச்சொல்லை மீட்டமைக்கும்படி உங்களிடம் கேட்கப்படவில்லை என்றால், இந்தச் செய்தியை நீங்கள் புறக்கணிக்கலாம்.", "emails.recovery.thanks": "நன்றி,", + "emails.recovery.buttonText": "கடவுச்சொல்லை மீட்டமைக்கவும்", "emails.recovery.signature": "{{project}} குழு", "emails.invitation.subject": "அழைப்பிதழ் %s குழு %s ", "emails.invitation.hello": "வணக்கம்,", "emails.invitation.body": "{{project}} இல் {{team}} குழுவில் உறுப்பினராக உங்களை {{owner}} அழைக்க விரும்புவதால், இந்த அஞ்சல் உங்களுக்கு அனுப்பப்பட்டது.", "emails.invitation.footer": "உங்களுக்கு ஆர்வம் இல்லை என்றால், இந்த செய்தியை நீங்கள் புறக்கணிக்கலாம்.", "emails.invitation.thanks": "நன்றி,", + "emails.invitation.buttonText": "{{team}} அழைப்பை ஏற்கவும்", "emails.invitation.signature": "{{project}} குழு", "locale.country.unknown": "அறியவில்லை", "countries.af": "ஆப்கானித்தான்", diff --git a/app/config/locale/translations/te.json b/app/config/locale/translations/te.json index 870b0b82a2..4073fc72d9 100644 --- a/app/config/locale/translations/te.json +++ b/app/config/locale/translations/te.json @@ -8,6 +8,7 @@ "emails.verification.body": "ఈ లింక్ ద్వారా ఇమెయిల్ ని ధృవీకరించండి", "emails.verification.footer": "మీరు ఈ చిరునామాను ధృవీకరించమని అడగనట్లయితే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు", "emails.verification.thanks": "ధన్యవాదాలు,", + "emails.verification.buttonText": "ఇమెయిల్ చిరునామాను నిర్ధారించండి", "emails.verification.signature": "{{project}} జట్", "emails.magicSession.subject": "లాగిన్", "emails.magicSession.hello": "నమస్కారము,", @@ -20,12 +21,14 @@ "emails.recovery.body": "మీ {{project}} పాస్వర్డ్ ని రీసెట్ చేయడానికి ఈ లింక్ ని అనుసరించండి", "emails.recovery.footer": "మీరు మీ పాస్వర్డ్ ని రీసెట్ చేయమని అడగనట్లయితే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు", "emails.recovery.thanks": "ధన్యవాదాల,", + "emails.recovery.buttonText": "పాస్‌వర్డ్‌ను రీసెట్ చేయండి", "emails.recovery.signature": "{{project}} జట్", "emails.invitation.subject": "%s వద్ద %s బృందానికి ఆహ్వానం", "emails.invitation.hello": "నమస్కారమ,", "emails.invitation.body": "{{owner}} మిమ్మల్ని {{project}} లో {{team}} బృందంలో సభ్యునిగా ఉండమని ఆహ్వానించాలనుకుంటున్నందున ఈ మెయిల్ మీకు పంపబడింది.", "emails.invitation.footer": "మీకు ఆసక్తి లేకుంటే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు.", "emails.invitation.thanks": "ధన్యవాదాల,", + "emails.invitation.buttonText": "{{team}} కు ఆహ్వానాన్ని ఆమోదించండి", "emails.invitation.signature": "{{project}} జట్", "locale.country.unknown": "తెలియని", "countries.af": "ఆఫ్ఘనిస్తాన్", diff --git a/app/config/locale/translations/th.json b/app/config/locale/translations/th.json index 5a53b16055..4003ece666 100644 --- a/app/config/locale/translations/th.json +++ b/app/config/locale/translations/th.json @@ -8,6 +8,7 @@ "emails.verification.body": "กดเข้าไปที่ลิงก์นี้เพื่อยืนยันอีเมลของท่าน", "emails.verification.footer": "หากท่านไม่ได้ต้องการที่จะยืนยันอีเมลนี้ ท่านสามารถเพิกเฉยข้อความนี้ได้", "emails.verification.thanks": "ขอบคุณ", + "emails.verification.buttonText": "ยืนยันที่อยู่อีเมล", "emails.verification.signature": "ทีม {{project}}", "emails.magicSession.subject": "เข้าสู่ระบบ", "emails.magicSession.hello": "เรียนผู้ใช้งาน", @@ -20,12 +21,14 @@ "emails.recovery.body": "กดเข้าไปที่ลิงก์นี้เพื่อรีเซ็ตรหัสผ่านสำหรับโปรเจกต์ {{project}} ของท่าน", "emails.recovery.footer": "หากท่านไม่ได้ต้องการที่จะรีเซ็ตรหัสผ่านของท่าน ท่านสามารถเพิกเฉยข้อความนี้ได้", "emails.recovery.thanks": "ขอบคุณ", + "emails.recovery.buttonText": "รีเซ็ตรหัสผ่าน", "emails.recovery.signature": "ทีม {{project}}", "emails.invitation.subject": "เรียนเชิญเข้าร่วม ทีม %s จากโปรเจกต์ %s", "emails.invitation.hello": "สวัสดี", "emails.invitation.body": "ท่านได้รับอีเมลฉบับนี้เนื่องจาก {{owner}} ต้องการที่จะเชิญชวนคุณเข้าร่วมเป็นส่วนหนึ่งของ ทีม {{team}} จากโปรเจกต์ {{project}}", "emails.invitation.footer": "หากท่านไม่ได้สนใจที่จะเข้าร่วม ท่านสามารถเพิกเฉยข้อความนี้ได้", "emails.invitation.thanks": "ขอบคุณ", + "emails.invitation.buttonText": "ยอมรับคำเชิญเข้าร่วม {{team}}", "emails.invitation.signature": "ทีม {{project}}", "locale.country.unknown": "ไม่ทราบ", "countries.af": "อัฟกานิสถาน", diff --git a/app/config/locale/translations/tl.json b/app/config/locale/translations/tl.json index 6d0be01095..27ea6c088f 100644 --- a/app/config/locale/translations/tl.json +++ b/app/config/locale/translations/tl.json @@ -8,6 +8,7 @@ "emails.verification.body": "Sundin ang link na ito upang ma-verify ang iyong email address.", "emails.verification.footer": "Kung hindi mo hiningi na i-verify ang address na ito, maaari mong balewalain ang mensahe na ito.", "emails.verification.thanks": "Salamat,", + "emails.verification.buttonText": "Kumpirmahin ang email address", "emails.verification.signature": "Pangkat ng {{project}}", "emails.magicSession.subject": "Mag log in", "emails.magicSession.hello": "Kamusta ,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Sundin ang link na ito upang i-reset ang password ng iyong {{project}}.", "emails.recovery.footer": "Kung hindi mo hiningi na i-reset ang iyong password, maaari mong balewalain ang mensahe na ito.", "emails.recovery.thanks": "Salamat,", + "emails.recovery.buttonText": "I-reset ang password", "emails.recovery.signature": "Pangkat ng {{project}}", "emails.invitation.subject": "Imbitasyon para sa Pangkat %s sa %s", "emails.invitation.hello": "Kamusta,", "emails.invitation.body": "Ipinadala sa iyo ang mail na ito dahil gusto kang imbitahan ni {{owner}} na maging miyembro ng Pangkat {{team}} sa ilalim ng proyektong {{project}}.", "emails.invitation.footer": "Kung ikaw ay hindi interesado, maaari mong balewalain ang mensaheng ito.", "emails.invitation.thanks": "Salamat,", + "emails.invitation.buttonText": "Tanggapin ang paanyaya sa {{team}}", "emails.invitation.signature": "Pangkat ng {{project}}", "locale.country.unknown": "Hindi kilala", "countries.af": "Apganistan", diff --git a/app/config/locale/translations/tr.json b/app/config/locale/translations/tr.json index 115050c2e2..a7183152b6 100644 --- a/app/config/locale/translations/tr.json +++ b/app/config/locale/translations/tr.json @@ -8,6 +8,7 @@ "emails.verification.body": "Eposta adresini doğrulamak için bu bağlantıyı kullanın.", "emails.verification.footer": "Eğer bu eposta adresini doğrulamak isteyen siz değilseniz devam etmeyin.", "emails.verification.thanks": "Teşekkürler,", + "emails.verification.buttonText": "E-posta adresini doğrula", "emails.verification.signature": "{{project}} takımı", "emails.magicSession.subject": "Giriş", "emails.magicSession.hello": "Merhaba,", @@ -20,12 +21,14 @@ "emails.recovery.body": "{{project}} şifrenizi sıfırlamak için bu bağlantıyı kullanın.", "emails.recovery.footer": "Eğer şifre sıfırlama talebinde bulunmadıysanız devam etmeyin.", "emails.recovery.thanks": "Teşekkürler,", + "emails.recovery.buttonText": "Şifreyi sıfırla", "emails.recovery.signature": "{{project}} takımı", "emails.invitation.subject": "%s üzerinde %s Takımına Davet", "emails.invitation.hello": "Merhaba,", "emails.invitation.body": "Bu epostayı aldınız, çünkü {{owner}} sizi {{project}} üzerinde {{team}} takımının üyesi olmaya davet etti.", "emails.invitation.footer": "Eğer ilgilenmiyorsanız devam etmeyin.", "emails.invitation.thanks": "Teşekkürler,", + "emails.invitation.buttonText": "{{team}}'e daveti kabul et", "emails.invitation.signature": "{{project}} takımı", "locale.country.unknown": "Bilinmeyen", "countries.af": "Afganistan", diff --git a/app/config/locale/translations/uk.json b/app/config/locale/translations/uk.json index 3f66bd1c58..daa003754d 100644 --- a/app/config/locale/translations/uk.json +++ b/app/config/locale/translations/uk.json @@ -8,6 +8,7 @@ "emails.verification.body": "Перейдіть за цим посиланням, щоб підтвердити свою електронну адресу.", "emails.verification.footer": "Якщо ви не запитували підтвердження цієї адреси, ви можете ігнорувати це повідомлення.", "emails.verification.thanks": "Дякуємо,", + "emails.verification.buttonText": "Підтвердити адресу електронної пошти", "emails.verification.signature": "команда {{project}}", "emails.magicSession.subject": "Логін", "emails.magicSession.hello": "Вітаємо,", @@ -20,12 +21,14 @@ "emails.recovery.body": "Перейдіть за цим посиланням для того щоб скинути свій пароль для проекту {{project}}", "emails.recovery.footer": "Якщо ви не запитували скидання паролю, проігноруйте це повідомлення.", "emails.recovery.thanks": "Дякуємо,", + "emails.recovery.buttonText": "Скинути пароль", "emails.recovery.signature": "команда {{project}}", "emails.invitation.subject": "Запрошення до %s Команди у %s", "emails.invitation.hello": "Вітаємо,", "emails.invitation.body": "Цей лист був надісланий вам тому що {{owner}} запрошує вас стати членом команди {{team}} у проекті {{project}}.", "emails.invitation.footer": "Якщо ви не зацікавлені, проігноруйте це повідомлення.", "emails.invitation.thanks": "Дякуємо,", + "emails.invitation.buttonText": "Прийняти запрошення до {{team}}", "emails.invitation.signature": "команда {{project}}", "locale.country.unknown": "Невідомо", "countries.af": "Афганістан", diff --git a/app/config/locale/translations/ur.json b/app/config/locale/translations/ur.json index 9d6aa47762..8823e0da2e 100644 --- a/app/config/locale/translations/ur.json +++ b/app/config/locale/translations/ur.json @@ -8,6 +8,7 @@ "emails.verification.body": "براہ کرم اپنے ای میل کی تصدیق کے لیے درج ذیل لنک پر عمل کریں۔", "emails.verification.footer": "اگر آپ نے اس پتے کی تصدیق کے لیے نہیں کہا تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔", "emails.verification.thanks": "شکریہ،", + "emails.verification.buttonText": "ای میل پتہ کی تصدیق کریں", "emails.verification.signature": "ٹیم۔ {{project}}", "emails.magicSession.subject": "اگ ان کریں", "emails.magicSession.hello": "خوش آمدید،", @@ -20,13 +21,15 @@ "emails.recovery.body": "{{project}} کا پاس ورڈ تبدیل کرنے کے لیے درج ذیل لنک پر عمل کریں", "emails.recovery.footer": "اگر آپ نے اپنا پاس ورڈ دوبارہ ترتیب دینے کے لیے نہیں کہا تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔", "emails.recovery.thanks": "شکریہ،", + "emails.recovery.buttonText": "پاس ورڈ ری سیٹ کریں", "emails.recovery.signature": "ٹیم۔ {{project}}", "emails.invitation.subject": "%s پر %s ٹیم کو دعوت", "emails.invitation.hello": "خوش آمدید،", "emails.invitation.body": "یہ پیغام آپ کو اس لیے بھیجا گیا تھا کہ {{owner}} نے آپ کو {{project}} میں {{team}} ٹیم کا رکن بننے کی دعوت بھیجی", "emails.invitation.footer": "اگر آپ دلچسپی نہیں رکھتے تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔", "emails.invitation.thanks": "شکریہ،", - "emails.invitation.signature": "ٹیم۔ {{project}", + "emails.invitation.buttonText": "{{team}} کی دعوت قبول کریں", + "emails.invitation.signature": "ٹیم۔ {{project}}", "locale.country.unknown": "نامعلوم", "countries.af": "افغانستان", "countries.ao": "انگولا", diff --git a/app/config/locale/translations/vi.json b/app/config/locale/translations/vi.json index 76a545a1d4..e9168d9ab8 100644 --- a/app/config/locale/translations/vi.json +++ b/app/config/locale/translations/vi.json @@ -8,6 +8,7 @@ "emails.verification.body": "Nhấn vào đường dẫn sau để xác minh địa chỉ email của bạn.", "emails.verification.footer": "Nếu bạn không yêu cầu xác minh tài khoản, bạn có thể bỏ qua email này.", "emails.verification.thanks": "Cảm ơn", + "emails.verification.buttonText": "Xác nhận địa chỉ email", "emails.verification.signature": "Nhóm {{project}}", "emails.magicSession.subject": "Đăng nhập", "emails.magicSession.hello": "Chào", @@ -20,12 +21,14 @@ "emails.recovery.body": "Nhấn vào đường dẫn sau để thiết lập lại mật khẩu {{project}} của bạn.", "emails.recovery.footer": "Nếu bạn không yêu cầu thiết lập lại mật khẩu, bạn có thể bỏ qua email này.", "emails.recovery.thanks": "Cảm ơn", + "emails.recovery.buttonText": "Đặt lại mật khẩu", "emails.recovery.signature": "Nhóm {{project}}", "emails.invitation.subject": "Lời mời tham gia nhóm %s tại %s", "emails.invitation.hello": "Xin chào", "emails.invitation.body": "Email này được gửi cho bạn vì {{owner}} muốn mời bạn trở thành một thành viên của nhóm {{team}} tại {{project}}.", "emails.invitation.footer": "Nếu bạn không quan tâm, bạn có thể bỏ qua email này.", "emails.invitation.thanks": "Cảm ơn", + "emails.invitation.buttonText": "Chấp nhận lời mời vào {{team}}", "emails.invitation.signature": "Nhóm {{project}}", "locale.country.unknown": "Không xác định", "countries.af": "Afghanistan", diff --git a/app/config/locale/translations/zh-cn.json b/app/config/locale/translations/zh-cn.json index 5e35a89bfe..554b506e9e 100644 --- a/app/config/locale/translations/zh-cn.json +++ b/app/config/locale/translations/zh-cn.json @@ -8,6 +8,7 @@ "emails.verification.body": "点此链接验证您的电子邮件地址。", "emails.verification.footer": "如果您没有要求验证此地址,则可忽略此消息。", "emails.verification.thanks": "谢谢、", + "emails.verification.buttonText": "确认邮箱地址", "emails.verification.signature": "{{project}} 团队", "emails.magicSession.subject": "登录", "emails.magicSession.hello": "你好、", @@ -20,12 +21,14 @@ "emails.recovery.body": "点此链接重置您的 {{project}} 密码。", "emails.recovery.footer": "如果您没有要求重置密码,则可以忽略此消息。", "emails.recovery.thanks": "谢谢、", + "emails.recovery.buttonText": "重置密码", "emails.recovery.signature": "{{project}} 团队", "emails.invitation.subject": "邀请 %s 团队在 %s", "emails.invitation.hello": "你好、", "emails.invitation.body": "这封邮件发送给您是因为 {{owner}} 想邀请您成为 {{team}} 团队在 {{project}}.", "emails.invitation.footer": "如果您不感兴趣,可以忽略此消息。", "emails.invitation.thanks": "谢谢、", + "emails.invitation.buttonText": "接受加入 {{team}} 的邀请", "emails.invitation.signature": "{{project}} 团队", "locale.country.unknown": "未知", "countries.af": "阿富汗", diff --git a/app/config/locale/translations/zh-tw.json b/app/config/locale/translations/zh-tw.json index 146dd0a401..bb9868d679 100644 --- a/app/config/locale/translations/zh-tw.json +++ b/app/config/locale/translations/zh-tw.json @@ -8,6 +8,7 @@ "emails.verification.body": "按照此連結驗證您的電子郵件地址。", "emails.verification.footer": "如果您沒有要求驗證此地址,則可以忽略此消息。", "emails.verification.thanks": "謝謝、", + "emails.verification.buttonText": "確認電子郵件地址", "emails.verification.signature": "{{project}} 團隊", "emails.magicSession.subject": "登入", "emails.magicSession.hello": "嗨、", @@ -20,12 +21,14 @@ "emails.recovery.body": "按照此連結重置您的 {{project}} 密碼。", "emails.recovery.footer": "如果您沒有要求重置密碼,則可以忽略此消息。", "emails.recovery.thanks": "謝謝、", + "emails.recovery.buttonText": "重設密碼", "emails.recovery.signature": "{{project}} 團隊", "emails.invitation.subject": "邀請 %s 團隊在 %s", "emails.invitation.hello": "您好、", "emails.invitation.body": "發送這封郵件給您是因為 {{owner}} 想邀請您成為 {{team}} 團隊在 {{project}}。", "emails.invitation.footer": "如果您不感興趣,可以忽略此消息。", "emails.invitation.thanks": "謝謝、", + "emails.invitation.buttonText": "接受加入 {{team}} 的邀請", "emails.invitation.signature": "{{project}} 團隊", "locale.country.unknown": "未知", "countries.af": "阿富汗", diff --git a/app/config/platforms.php b/app/config/platforms.php index 4e705516fa..15eb8b3893 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -11,7 +11,7 @@ return [ [ 'key' => 'web', 'name' => 'Web', - 'version' => '18.1.1', + 'version' => '18.1.0', 'url' => 'https://github.com/appwrite/sdk-for-web', 'package' => 'https://www.npmjs.com/package/appwrite', 'enabled' => true, @@ -59,7 +59,7 @@ return [ [ 'key' => 'flutter', 'name' => 'Flutter', - 'version' => '17.0.0', + 'version' => '17.0.2', 'url' => 'https://github.com/appwrite/sdk-for-flutter', 'package' => 'https://pub.dev/packages/appwrite', 'enabled' => true, @@ -77,7 +77,7 @@ return [ [ 'key' => 'apple', 'name' => 'Apple', - 'version' => '10.1.0', + 'version' => '10.1.1', 'url' => 'https://github.com/appwrite/sdk-for-apple', 'package' => 'https://github.com/appwrite/sdk-for-apple', 'enabled' => true, @@ -134,7 +134,7 @@ return [ [ 'key' => 'react-native', 'name' => 'React Native', - 'version' => '0.9.2', + 'version' => '0.10.1', 'url' => 'https://github.com/appwrite/sdk-for-react-native', 'package' => 'https://npmjs.com/package/react-native-appwrite', 'enabled' => true, @@ -217,7 +217,7 @@ return [ [ 'key' => 'cli', 'name' => 'Command Line', - 'version' => '6.2.3', + 'version' => '8.2.2', 'url' => 'https://github.com/appwrite/sdk-for-cli', 'package' => 'https://www.npmjs.com/package/appwrite-cli', 'enabled' => true, @@ -231,6 +231,12 @@ return [ 'gitRepoName' => 'sdk-for-cli', 'gitUserName' => 'appwrite', 'gitBranch' => 'dev', + 'repoBranch' => 'master', + 'exclude' => [ + 'services' => [ + ['name' => 'assistant'], + ], + ], ], ], ], @@ -245,7 +251,7 @@ return [ [ 'key' => 'nodejs', 'name' => 'Node.js', - 'version' => '17.0.0', + 'version' => '17.1.0', 'url' => 'https://github.com/appwrite/sdk-for-node', 'package' => 'https://www.npmjs.com/package/node-appwrite', 'enabled' => true, @@ -353,7 +359,7 @@ return [ [ 'key' => 'dotnet', 'name' => '.NET', - 'version' => '0.13.0', + 'version' => '0.14.0', 'url' => 'https://github.com/appwrite/sdk-for-dotnet', 'package' => 'https://www.nuget.org/packages/Appwrite', 'enabled' => true, @@ -371,7 +377,7 @@ return [ [ 'key' => 'dart', 'name' => 'Dart', - 'version' => '16.0.0', + 'version' => '16.1.0', 'url' => 'https://github.com/appwrite/sdk-for-dart', 'package' => 'https://pub.dev/packages/dart_appwrite', 'enabled' => true, @@ -411,7 +417,7 @@ return [ [ 'key' => 'swift', 'name' => 'Swift', - 'version' => '10.0.0', + 'version' => '10.1.0', 'url' => 'https://github.com/appwrite/sdk-for-swift', 'package' => 'https://github.com/appwrite/sdk-for-swift', 'enabled' => true, diff --git a/app/config/specs/open-api3-1.7.x-client.json b/app/config/specs/open-api3-1.7.x-client.json index 16d29c5f28..d09108e51d 100644 --- a/app/config/specs/open-api3-1.7.x-client.json +++ b/app/config/specs/open-api3-1.7.x-client.json @@ -4457,6 +4457,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", "server", "server" @@ -4466,6 +4467,7 @@ { "name": "createDocument", "auth": { + "Admin": [], "Session": [], "Key": [], "JWT": [] @@ -4490,29 +4492,6 @@ } ], "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." - }, - { - "name": "createDocuments", - "auth": { - "Key": [] - }, - "parameters": [ - "databaseId", - "collectionId", - "documents" - ], - "required": [ - "databaseId", - "collectionId", - "documents" - ], - "responses": [ - { - "code": 201, - "model": "#\/components\/schemas\/documentList" - } - ], - "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nCreate new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { @@ -4913,7 +4892,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -4974,6 +4953,236 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, "\/functions\/{functionId}\/executions": { "get": { "summary": "List executions", @@ -4997,7 +5206,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -5072,7 +5281,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -5187,7 +5396,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -5261,7 +5470,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -5313,7 +5522,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 306, "cookies": false, "type": "graphql", "deprecated": false, @@ -5365,7 +5574,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5417,7 +5626,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -5469,7 +5678,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -5521,7 +5730,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -5573,7 +5782,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -5625,7 +5834,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -5677,7 +5886,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -5729,7 +5938,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -5781,7 +5990,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -5864,7 +6073,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -5939,7 +6148,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -6025,7 +6234,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -6123,7 +6332,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6195,7 +6404,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6284,7 +6493,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -6351,7 +6560,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -6429,7 +6638,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -6618,7 +6827,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -6656,7 +6866,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -6741,7 +6951,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -6817,7 +7027,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -6902,7 +7112,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -6964,7 +7174,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7038,7 +7248,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7102,7 +7312,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -7188,7 +7398,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7299,7 +7509,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -7371,7 +7581,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -7458,7 +7668,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -7532,7 +7742,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -7630,7 +7840,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7691,7 +7901,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -8205,6 +8415,12 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, "$collectionId": { "type": "string", "description": "Collection ID.", @@ -8239,6 +8455,7 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", diff --git a/app/config/specs/open-api3-1.7.x-console.json b/app/config/specs/open-api3-1.7.x-console.json index 83525478a4..b7450bc7e6 100644 --- a/app/config/specs/open-api3-1.7.x-console.json +++ b/app/config/specs/open-api3-1.7.x-console.json @@ -4359,7 +4359,7 @@ "x-appwrite": { "method": "chat", "group": "console", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -4419,7 +4419,7 @@ "x-appwrite": { "method": "getResource", "group": null, - "weight": 432, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -4494,7 +4494,7 @@ "x-appwrite": { "method": "variables", "group": "console", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -4694,7 +4694,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 119, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -8016,6 +8016,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", "server", "server" @@ -8025,6 +8026,7 @@ { "name": "createDocument", "auth": { + "Admin": [], "Session": [], "Key": [], "JWT": [] @@ -8053,6 +8055,7 @@ { "name": "createDocuments", "auth": { + "Admin": [], "Key": [] }, "parameters": [ @@ -8167,7 +8170,7 @@ "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -8178,6 +8181,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8227,7 +8231,10 @@ "type": "object" } } - } + }, + "required": [ + "documents" + ] } } } @@ -8239,7 +8246,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nUpdate all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -8255,7 +8262,7 @@ "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -8266,6 +8273,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8348,7 +8356,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -8359,6 +8367,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8741,7 +8750,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -8895,6 +8904,236 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -9362,7 +9601,7 @@ "x-appwrite": { "method": "getCollectionUsage", "group": null, - "weight": 121, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -9527,7 +9766,7 @@ "x-appwrite": { "method": "getDatabaseUsage", "group": null, - "weight": 120, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -9609,7 +9848,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -9682,7 +9921,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -9764,6 +10003,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9789,7 +10029,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9913,7 +10154,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -9962,7 +10203,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -10012,7 +10253,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 402, + "weight": 403, "cookies": false, "type": "", "deprecated": false, @@ -10112,7 +10353,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 401, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -10172,7 +10413,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 395, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -10244,7 +10485,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -10303,7 +10544,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -10392,6 +10633,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -10417,7 +10659,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -10531,7 +10774,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -10592,7 +10835,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -10672,7 +10915,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -10755,7 +10998,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 381, "cookies": false, "type": "upload", "deprecated": false, @@ -10851,7 +11094,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -10936,7 +11179,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -11039,7 +11282,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -11136,7 +11379,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -11198,7 +11441,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -11262,7 +11505,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 388, "cookies": false, "type": "location", "deprecated": false, @@ -11352,7 +11595,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -11423,7 +11666,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -11498,7 +11741,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -11613,7 +11856,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -11678,7 +11921,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -11749,7 +11992,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 394, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -11831,7 +12074,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -11890,7 +12133,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -11981,7 +12224,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -12050,7 +12293,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -12141,7 +12384,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -12212,7 +12455,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -12264,7 +12507,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 306, "cookies": false, "type": "graphql", "deprecated": false, @@ -12316,7 +12559,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12365,7 +12608,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -12414,7 +12657,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12463,7 +12706,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12523,7 +12766,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -12572,7 +12815,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12621,7 +12864,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -12683,7 +12926,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -12745,7 +12988,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -12818,7 +13061,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -12880,7 +13123,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -12968,7 +13211,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -13030,7 +13273,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -13092,7 +13335,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -13154,7 +13397,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13216,7 +13459,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13278,7 +13521,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -13340,7 +13583,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -13402,7 +13645,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -13464,7 +13707,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -13513,7 +13756,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -13562,7 +13805,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -13611,7 +13854,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13663,7 +13906,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -13715,7 +13958,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -13767,7 +14010,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -13819,7 +14062,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -13871,7 +14114,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -13923,7 +14166,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -13975,7 +14218,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -14027,7 +14270,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14103,7 +14346,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -14247,7 +14490,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -14393,7 +14636,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14567,7 +14810,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -14745,7 +14988,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -14854,7 +15097,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -14966,7 +15209,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15019,7 +15262,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15081,7 +15324,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15156,7 +15399,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15231,7 +15474,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -15307,7 +15550,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -15412,7 +15655,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -15520,7 +15763,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -15605,7 +15848,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -15693,7 +15936,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 323, "cookies": false, "type": "", "deprecated": false, @@ -15808,7 +16051,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -15926,7 +16169,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -16021,7 +16264,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -16119,7 +16362,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -16224,7 +16467,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -16332,7 +16575,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -16475,7 +16718,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -16620,7 +16863,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -16715,7 +16958,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -16813,7 +17056,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -16908,7 +17151,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -17006,7 +17249,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -17101,7 +17344,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -17199,7 +17442,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -17294,7 +17537,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -17392,7 +17635,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -17445,7 +17688,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -17507,7 +17750,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -17582,7 +17825,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -17657,7 +17900,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -17731,7 +17974,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -17814,7 +18057,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -17874,7 +18117,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -17951,7 +18194,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -18013,7 +18256,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -18088,7 +18331,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -18172,7 +18415,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -18262,7 +18505,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -18325,7 +18568,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -18400,7 +18643,7 @@ "x-appwrite": { "method": "list", "group": null, - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -18474,7 +18717,7 @@ "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -18562,7 +18805,7 @@ "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 316, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -18655,7 +18898,7 @@ "x-appwrite": { "method": "createCsvMigration", "group": null, - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -18734,7 +18977,7 @@ "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -18810,7 +19053,7 @@ "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 317, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -18882,7 +19125,7 @@ "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -18993,7 +19236,7 @@ "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -19126,7 +19369,7 @@ "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -19231,7 +19474,7 @@ "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -19355,7 +19598,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 315, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -19413,7 +19656,7 @@ "x-appwrite": { "method": "retry", "group": null, - "weight": 320, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -19464,7 +19707,7 @@ "x-appwrite": { "method": "delete", "group": null, - "weight": 321, + "weight": 322, "cookies": false, "type": "", "deprecated": false, @@ -19524,7 +19767,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 200, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -19612,7 +19855,7 @@ "x-appwrite": { "method": "listVariables", "group": null, - "weight": 202, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -19658,7 +19901,7 @@ "x-appwrite": { "method": "createVariable", "group": null, - "weight": 201, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -19736,7 +19979,7 @@ "x-appwrite": { "method": "getVariable", "group": null, - "weight": 203, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -19794,7 +20037,7 @@ "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 204, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -19874,7 +20117,7 @@ "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 205, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -19934,7 +20177,7 @@ "x-appwrite": { "method": "list", "group": "projects", - "weight": 155, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -20006,7 +20249,7 @@ "x-appwrite": { "method": "create", "group": "projects", - "weight": 154, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -20140,7 +20383,7 @@ "x-appwrite": { "method": "get", "group": "projects", - "weight": 156, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -20198,7 +20441,7 @@ "x-appwrite": { "method": "update", "group": "projects", - "weight": 157, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -20313,7 +20556,7 @@ "x-appwrite": { "method": "delete", "group": "projects", - "weight": 174, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -20373,7 +20616,7 @@ "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 161, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -20465,7 +20708,7 @@ "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 162, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -20544,7 +20787,7 @@ "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 167, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20623,7 +20866,7 @@ "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 166, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -20702,7 +20945,7 @@ "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 172, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -20781,7 +21024,7 @@ "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 165, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -20872,7 +21115,7 @@ "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 173, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -20954,7 +21197,7 @@ "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 170, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -21033,7 +21276,7 @@ "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 169, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -21112,7 +21355,7 @@ "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 171, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -21191,7 +21434,7 @@ "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 164, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -21270,7 +21513,7 @@ "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 168, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -21370,7 +21613,7 @@ "x-appwrite": { "method": "listDevKeys", "group": "devKeys", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -21438,7 +21681,7 @@ "x-appwrite": { "method": "createDevKey", "group": "devKeys", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -21523,7 +21766,7 @@ "x-appwrite": { "method": "getDevKey", "group": "devKeys", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -21591,7 +21834,7 @@ "x-appwrite": { "method": "updateDevKey", "group": "devKeys", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -21677,7 +21920,7 @@ "x-appwrite": { "method": "deleteDevKey", "group": "devKeys", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -21747,7 +21990,7 @@ "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 186, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -21834,7 +22077,7 @@ "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 182, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -21892,7 +22135,7 @@ "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 181, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -21985,7 +22228,7 @@ "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 183, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -22053,7 +22296,7 @@ "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 184, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -22147,7 +22390,7 @@ "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 185, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -22217,7 +22460,7 @@ "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 163, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -22355,7 +22598,7 @@ "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 188, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -22413,7 +22656,7 @@ "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 187, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -22532,7 +22775,7 @@ "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 189, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -22600,7 +22843,7 @@ "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 190, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -22695,7 +22938,7 @@ "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 191, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -22765,7 +23008,7 @@ "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 159, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -22866,7 +23109,7 @@ "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 160, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -22945,7 +23188,7 @@ "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 192, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -23063,7 +23306,7 @@ "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 193, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -23194,7 +23437,7 @@ "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 158, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -23273,7 +23516,7 @@ "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 195, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -23497,7 +23740,7 @@ "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 197, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -23761,7 +24004,7 @@ "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 199, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -23987,7 +24230,7 @@ "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 194, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -24208,7 +24451,7 @@ "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 196, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -24448,7 +24691,7 @@ "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 198, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -24671,7 +24914,7 @@ "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 176, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -24729,7 +24972,7 @@ "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 175, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -24844,7 +25087,7 @@ "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 177, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -24912,7 +25155,7 @@ "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 178, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -25028,7 +25271,7 @@ "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 180, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -25098,7 +25341,7 @@ "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 179, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -25168,7 +25411,7 @@ "x-appwrite": { "method": "listRules", "group": null, - "weight": 292, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -25242,7 +25485,7 @@ "x-appwrite": { "method": "createAPIRule", "group": null, - "weight": 433, + "weight": 434, "cookies": false, "type": "", "deprecated": false, @@ -25309,7 +25552,7 @@ "x-appwrite": { "method": "createFunctionRule", "group": null, - "weight": 435, + "weight": 436, "cookies": false, "type": "", "deprecated": false, @@ -25387,7 +25630,7 @@ "x-appwrite": { "method": "createRedirectRule", "group": null, - "weight": 436, + "weight": 437, "cookies": false, "type": "", "deprecated": false, @@ -25443,12 +25686,33 @@ "Temporary Redirect 307", "Permanent Redirect 308" ] + }, + "resourceId": { + "type": "string", + "description": "ID of parent resource.", + "x-example": "" + }, + "resourceType": { + "type": "string", + "description": "Type of parent resource.", + "x-example": "site", + "enum": [ + "site", + "function" + ], + "x-enum-name": "ProxyResourceType", + "x-enum-keys": [ + "Site", + "Function" + ] } }, "required": [ "domain", "url", - "statusCode" + "statusCode", + "resourceId", + "resourceType" ] } } @@ -25479,7 +25743,7 @@ "x-appwrite": { "method": "createSiteRule", "group": null, - "weight": 434, + "weight": 435, "cookies": false, "type": "", "deprecated": false, @@ -25557,7 +25821,7 @@ "x-appwrite": { "method": "getRule", "group": null, - "weight": 293, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -25608,7 +25872,7 @@ "x-appwrite": { "method": "deleteRule", "group": null, - "weight": 294, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -25668,7 +25932,7 @@ "x-appwrite": { "method": "updateRuleVerification", "group": null, - "weight": 295, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -25728,7 +25992,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -25798,7 +26062,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -25933,6 +26197,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -25958,7 +26223,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26045,7 +26311,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -26094,7 +26360,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -26144,7 +26410,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 427, + "weight": 428, "cookies": false, "type": "", "deprecated": false, @@ -26244,7 +26510,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 428, + "weight": 429, "cookies": false, "type": "", "deprecated": false, @@ -26304,7 +26570,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 429, + "weight": 430, "cookies": false, "type": "", "deprecated": false, @@ -26376,7 +26642,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -26435,7 +26701,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -26577,6 +26843,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -26602,7 +26869,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26678,7 +26946,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -26739,7 +27007,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -26819,7 +27087,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -26902,7 +27170,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 410, "cookies": false, "type": "upload", "deprecated": false, @@ -27003,7 +27271,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -27083,7 +27351,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -27186,7 +27454,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -27284,7 +27552,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -27346,7 +27614,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -27410,7 +27678,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 417, "cookies": false, "type": "location", "deprecated": false, @@ -27500,7 +27768,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -27571,7 +27839,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -27642,7 +27910,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -27704,7 +27972,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -27775,7 +28043,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 430, + "weight": 431, "cookies": false, "type": "", "deprecated": false, @@ -27857,7 +28125,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -27916,7 +28184,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -28007,7 +28275,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -28076,7 +28344,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -28167,7 +28435,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -28238,7 +28506,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -28311,7 +28579,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -28438,7 +28706,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -28497,7 +28765,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -28621,7 +28889,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 212, "cookies": false, "type": "", "deprecated": false, @@ -28682,7 +28950,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -28768,7 +29036,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -28866,7 +29134,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -28938,7 +29206,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -29027,7 +29295,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -29094,7 +29362,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -29172,7 +29440,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -29361,7 +29629,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -29399,7 +29668,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -29484,7 +29753,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -29556,7 +29825,7 @@ "x-appwrite": { "method": "getBucketUsage", "group": null, - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -29638,7 +29907,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -29714,7 +29983,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -29799,7 +30068,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -29861,7 +30130,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -29935,7 +30204,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -29999,7 +30268,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 235, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -30072,7 +30341,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -30158,7 +30427,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -30269,7 +30538,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -30341,7 +30610,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -30428,7 +30697,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -30502,7 +30771,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -30599,7 +30868,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -30659,7 +30928,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -30740,7 +31009,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 440, "cookies": false, "type": "", "deprecated": false, @@ -30820,7 +31089,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 438, "cookies": false, "type": "", "deprecated": false, @@ -30909,7 +31178,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 439, "cookies": false, "type": "", "deprecated": false, @@ -30969,7 +31238,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 441, "cookies": false, "type": "", "deprecated": false, @@ -31039,7 +31308,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 442, "cookies": false, "type": "", "deprecated": false, @@ -31101,7 +31370,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -31174,7 +31443,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -31262,7 +31531,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -31347,7 +31616,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -31432,7 +31701,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -31500,7 +31769,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -31561,7 +31830,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -31646,7 +31915,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -31731,7 +32000,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -31846,7 +32115,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -31949,7 +32218,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -32054,7 +32323,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 278, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -32126,7 +32395,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -32178,7 +32447,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -32239,7 +32508,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -32319,7 +32588,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -32401,7 +32670,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -32484,7 +32753,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -32558,7 +32827,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -32643,7 +32912,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -32716,7 +32985,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -32792,7 +33061,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -32853,7 +33122,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -32912,7 +33181,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -32971,7 +33240,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -33032,7 +33301,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -33112,7 +33381,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -33192,7 +33461,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -33272,7 +33541,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -33331,7 +33600,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -33411,7 +33680,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -33470,7 +33739,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -33522,7 +33791,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -33576,7 +33845,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -33647,7 +33916,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -33727,7 +33996,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -33765,7 +34034,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "schema": { "type": "array", @@ -33800,7 +34069,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -33910,7 +34179,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -33980,7 +34249,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -34069,7 +34338,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, @@ -34141,7 +34410,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -34223,7 +34492,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -34303,7 +34572,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -34383,7 +34652,7 @@ "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 282, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -34479,7 +34748,7 @@ "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 283, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -34564,7 +34833,7 @@ "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 284, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -34649,7 +34918,7 @@ "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 285, + "weight": 287, "cookies": false, "type": "", "deprecated": false, @@ -34719,7 +34988,7 @@ "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 286, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -34773,7 +35042,7 @@ "tags": [ "vcs" ], - "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.\n", + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", "responses": { "200": { "description": "VCS Content List", @@ -34789,7 +35058,7 @@ "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 281, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -34843,6 +35112,17 @@ "default": "" }, "in": "query" + }, + { + "name": "providerReference", + "description": "Git reference (branch, tag, commit) to get contents from", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" } ] } @@ -34863,7 +35143,7 @@ "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 291, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -34952,7 +35232,7 @@ "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 288, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -35026,7 +35306,7 @@ "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 289, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -35077,7 +35357,7 @@ "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 290, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -37344,6 +37624,12 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, "$collectionId": { "type": "string", "description": "Collection ID.", @@ -37378,6 +37664,7 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", diff --git a/app/config/specs/open-api3-1.7.x-server.json b/app/config/specs/open-api3-1.7.x-server.json index da05c6a1a7..8056d5f21b 100644 --- a/app/config/specs/open-api3-1.7.x-server.json +++ b/app/config/specs/open-api3-1.7.x-server.json @@ -7497,6 +7497,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", "server", "server" @@ -7506,6 +7507,7 @@ { "name": "createDocument", "auth": { + "Admin": [], "Session": [], "Key": [], "JWT": [] @@ -7534,6 +7536,7 @@ { "name": "createDocuments", "auth": { + "Admin": [], "Key": [] }, "parameters": [ @@ -7650,7 +7653,7 @@ "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -7661,6 +7664,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -7711,7 +7715,10 @@ "type": "object" } } - } + }, + "required": [ + "documents" + ] } } } @@ -7723,7 +7730,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nUpdate all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -7739,7 +7746,7 @@ "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -7750,6 +7757,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -7833,7 +7841,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -7844,6 +7852,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8233,7 +8242,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -8296,6 +8305,240 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -8684,7 +8927,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -8758,7 +9001,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -8841,6 +9084,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -8866,7 +9110,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -8990,7 +9235,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -9040,7 +9285,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -9091,7 +9336,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -9151,7 +9396,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -9241,6 +9486,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9266,7 +9512,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9380,7 +9627,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -9442,7 +9689,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -9523,7 +9770,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -9607,7 +9854,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 381, "cookies": false, "type": "upload", "deprecated": false, @@ -9704,7 +9951,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -9790,7 +10037,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -9894,7 +10141,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -9992,7 +10239,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -10055,7 +10302,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -10120,7 +10367,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 388, "cookies": false, "type": "location", "deprecated": false, @@ -10211,7 +10458,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -10283,7 +10530,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -10360,7 +10607,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -10477,7 +10724,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -10544,7 +10791,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -10616,7 +10863,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -10676,7 +10923,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -10768,7 +11015,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -10838,7 +11085,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -10930,7 +11177,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -11002,7 +11249,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -11056,7 +11303,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 306, "cookies": false, "type": "graphql", "deprecated": false, @@ -11110,7 +11357,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -11160,7 +11407,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -11210,7 +11457,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -11260,7 +11507,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11321,7 +11568,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11371,7 +11618,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11421,7 +11668,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11484,7 +11731,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11547,7 +11794,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11621,7 +11868,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11684,7 +11931,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -11773,7 +12020,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11836,7 +12083,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11899,7 +12146,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -11962,7 +12209,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12025,7 +12272,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -12088,7 +12335,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12151,7 +12398,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -12214,7 +12461,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12277,7 +12524,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -12327,7 +12574,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -12377,7 +12624,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12427,7 +12674,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12481,7 +12728,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -12535,7 +12782,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -12589,7 +12836,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -12643,7 +12890,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -12697,7 +12944,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -12751,7 +12998,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12805,7 +13052,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12859,7 +13106,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -12936,7 +13183,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -13081,7 +13328,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -13228,7 +13475,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -13403,7 +13650,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -13582,7 +13829,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -13692,7 +13939,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -13805,7 +14052,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -13859,7 +14106,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -13922,7 +14169,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -13998,7 +14245,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -14074,7 +14321,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -14151,7 +14398,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -14257,7 +14504,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -14366,7 +14613,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -14452,7 +14699,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -14541,7 +14788,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 323, "cookies": false, "type": "", "deprecated": false, @@ -14657,7 +14904,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -14776,7 +15023,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -14872,7 +15119,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -14971,7 +15218,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -15077,7 +15324,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -15186,7 +15433,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -15330,7 +15577,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -15476,7 +15723,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -15572,7 +15819,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -15671,7 +15918,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -15767,7 +16014,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -15866,7 +16113,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -15962,7 +16209,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -16061,7 +16308,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -16157,7 +16404,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -16256,7 +16503,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -16310,7 +16557,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -16373,7 +16620,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -16449,7 +16696,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -16525,7 +16772,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -16600,7 +16847,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -16684,7 +16931,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -16745,7 +16992,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -16823,7 +17070,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16886,7 +17133,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -16962,7 +17209,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -17047,7 +17294,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -17139,7 +17386,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -17203,7 +17450,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -17280,7 +17527,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -17351,7 +17598,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -17487,6 +17734,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -17512,7 +17760,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -17599,7 +17848,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -17649,7 +17898,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -17700,7 +17949,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -17760,7 +18009,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -17903,6 +18152,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -17928,7 +18178,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -18004,7 +18255,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -18066,7 +18317,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -18147,7 +18398,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -18231,7 +18482,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 410, "cookies": false, "type": "upload", "deprecated": false, @@ -18333,7 +18584,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -18414,7 +18665,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -18518,7 +18769,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -18617,7 +18868,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -18680,7 +18931,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -18745,7 +18996,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 417, "cookies": false, "type": "location", "deprecated": false, @@ -18836,7 +19087,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -18908,7 +19159,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -18980,7 +19231,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -19043,7 +19294,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -19115,7 +19366,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -19175,7 +19426,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -19267,7 +19518,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -19337,7 +19588,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -19429,7 +19680,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -19501,7 +19752,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -19575,7 +19826,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -19703,7 +19954,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -19763,7 +20014,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -19888,7 +20139,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 212, "cookies": false, "type": "", "deprecated": false, @@ -19950,7 +20201,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -20038,7 +20289,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -20138,7 +20389,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -20212,7 +20463,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -20303,7 +20554,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -20372,7 +20623,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -20452,7 +20703,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -20643,7 +20894,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -20681,7 +20933,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -20768,7 +21020,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -20846,7 +21098,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -20933,7 +21185,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -20997,7 +21249,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -21073,7 +21325,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -21139,7 +21391,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -21227,7 +21479,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -21340,7 +21592,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -21414,7 +21666,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -21503,7 +21755,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -21579,7 +21831,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -21678,7 +21930,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -21740,7 +21992,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -21823,7 +22075,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 440, "cookies": false, "type": "", "deprecated": false, @@ -21904,7 +22156,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 438, "cookies": false, "type": "", "deprecated": false, @@ -21994,7 +22246,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 439, "cookies": false, "type": "", "deprecated": false, @@ -22055,7 +22307,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 441, "cookies": false, "type": "", "deprecated": false, @@ -22126,7 +22378,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 442, "cookies": false, "type": "", "deprecated": false, @@ -22189,7 +22441,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -22263,7 +22515,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -22352,7 +22604,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -22438,7 +22690,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -22524,7 +22776,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -22593,7 +22845,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -22655,7 +22907,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -22741,7 +22993,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -22827,7 +23079,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -22943,7 +23195,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -23047,7 +23299,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -23153,7 +23405,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -23206,7 +23458,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -23268,7 +23520,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -23349,7 +23601,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -23432,7 +23684,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -23516,7 +23768,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -23591,7 +23843,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -23677,7 +23929,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -23751,7 +24003,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -23828,7 +24080,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -23890,7 +24142,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -23950,7 +24202,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -24010,7 +24262,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -24072,7 +24324,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -24153,7 +24405,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -24234,7 +24486,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -24315,7 +24567,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -24375,7 +24627,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -24456,7 +24708,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -24516,7 +24768,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -24569,7 +24821,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -24624,7 +24876,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -24696,7 +24948,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -24777,7 +25029,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -24816,7 +25068,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "schema": { "type": "array", @@ -24851,7 +25103,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -24962,7 +25214,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -25033,7 +25285,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -25123,7 +25375,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, @@ -25196,7 +25448,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -25279,7 +25531,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -25360,7 +25612,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -27312,6 +27564,12 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, "$collectionId": { "type": "string", "description": "Collection ID.", @@ -27346,6 +27604,7 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", diff --git a/app/config/specs/open-api3-1.8.x-client.json b/app/config/specs/open-api3-1.8.x-client.json new file mode 100644 index 0000000000..8f03738786 --- /dev/null +++ b/app/config/specs/open-api3-1.8.x-client.json @@ -0,0 +1,10117 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.7.4", + "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@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "servers": [ + { + "url": "https:\/\/cloud.appwrite.io\/v1" + }, + { + "url": "https:\/\/.cloud.appwrite.io\/v1" + } + ], + "paths": { + "\/account": { + "get": { + "summary": "Get account", + "operationId": "accountGet", + "tags": [ + "account" + ], + "description": "Get the currently logged in user.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "account", + "weight": 10, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create account", + "operationId": "accountCreate", + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailSession).", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "create", + "group": "account", + "weight": 9, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/email": { + "patch": { + "summary": "Update email", + "operationId": "accountUpdateEmail", + "tags": [ + "account" + ], + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateEmail", + "group": "account", + "weight": 35, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/identities": { + "get": { + "summary": "List identities", + "operationId": "accountListIdentities", + "tags": [ + "account" + ], + "description": "Get the list of identities for the currently logged in user.", + "responses": { + "200": { + "description": "Identities List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/identityList" + } + } + } + } + }, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 58, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "accountDeleteIdentity", + "tags": [ + "account" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 59, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/account\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "accountCreateJWT", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "x-appwrite": { + "method": "createJWT", + "group": "tokens", + "weight": 30, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/logs": { + "get": { + "summary": "List logs", + "operationId": "accountListLogs", + "tags": [ + "account" + ], + "description": "Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 32, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "accountUpdateMFA", + "tags": [ + "account" + ], + "description": "Enable or disable MFA on an account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMFA", + "group": "mfa", + "weight": 45, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-m-f-a.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaType" + } + } + } + } + }, + "x-appwrite": { + "method": "createMfaAuthenticator", + "group": "mfa", + "weight": 47, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfaAuthenticator", + "group": "mfa", + "weight": 48, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "otp": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "otp" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 52, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/account\/mfa\/challenge": { + "post": { + "summary": "Create MFA challenge", + "operationId": "accountCreateMfaChallenge", + "tags": [ + "account" + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Challenge", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaChallenge" + } + } + } + } + }, + "x-appwrite": { + "method": "createMfaChallenge", + "group": "mfa", + "weight": 53, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "factor": { + "type": "string", + "description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.", + "x-example": "email", + "enum": [ + "email", + "phone", + "totp", + "recoverycode" + ], + "x-enum-name": "AuthenticationFactor", + "x-enum-keys": [] + } + }, + "required": [ + "factor" + ] + } + } + } + } + }, + "put": { + "summary": "Update MFA challenge (confirmation)", + "operationId": "accountUpdateMfaChallenge", + "tags": [ + "account" + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfaChallenge", + "group": "mfa", + "weight": 54, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},challengeId:{param-challengeId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "challengeId": { + "type": "string", + "description": "ID of the challenge.", + "x-example": "" + }, + "otp": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "challengeId", + "otp" + ] + } + } + } + } + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 46, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 51, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 49, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 50, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/name": { + "patch": { + "summary": "Update name", + "operationId": "accountUpdateName", + "tags": [ + "account" + ], + "description": "Update currently logged in user account name.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "account", + "weight": 33, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "\/account\/password": { + "patch": { + "summary": "Update password", + "operationId": "accountUpdatePassword", + "tags": [ + "account" + ], + "description": "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePassword", + "group": "account", + "weight": 34, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "x-example": null + }, + "oldPassword": { + "type": "string", + "description": "Current user password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "password" + ] + } + } + } + } + } + }, + "\/account\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "accountUpdatePhone", + "tags": [ + "account" + ], + "description": "Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createPhoneVerification) endpoint to send a confirmation SMS.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePhone", + "group": "account", + "weight": 36, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "phone", + "password" + ] + } + } + } + } + } + }, + "\/account\/prefs": { + "get": { + "summary": "Get account preferences", + "operationId": "accountGetPrefs", + "tags": [ + "account" + ], + "description": "Get the preferences as a key-value object for the currently logged in user.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "account", + "weight": 31, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update preferences", + "operationId": "accountUpdatePrefs", + "tags": [ + "account" + ], + "description": "Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "account", + "weight": 37, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/account\/recovery": { + "post": { + "summary": "Create password recovery", + "operationId": "accountCreateRecovery", + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createRecovery", + "group": "recovery", + "weight": 39, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "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.", + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "email", + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update password recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/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.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "updateRecovery", + "group": "recovery", + "weight": 40, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid reset token.", + "x-example": "" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "x-example": null + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions": { + "get": { + "summary": "List sessions", + "operationId": "accountListSessions", + "tags": [ + "account" + ], + "description": "Get the list of active sessions across different devices for the currently logged in user.", + "responses": { + "200": { + "description": "Sessions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/sessionList" + } + } + } + } + }, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 12, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "delete": { + "summary": "Delete sessions", + "operationId": "accountDeleteSessions", + "tags": [ + "account" + ], + "description": "Delete all sessions from the user account and remove any sessions cookies from the end client.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 13, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/anonymous": { + "post": { + "summary": "Create anonymous session", + "operationId": "accountCreateAnonymousSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmail) or create an [OAuth2 session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#CreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "createAnonymousSession", + "group": "sessions", + "weight": 18, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-anonymous-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/sessions\/email": { + "post": { + "summary": "Create email password session", + "operationId": "accountCreateEmailPasswordSession", + "tags": [ + "account" + ], + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "createEmailPasswordSession", + "group": "sessions", + "weight": 17, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-email-password-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},email:{param-email}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions\/magic-url": { + "put": { + "summary": "Update magic URL session", + "operationId": "accountUpdateMagicURLSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMagicURLSession", + "group": "sessions", + "weight": 27, + "cookies": false, + "type": "", + "deprecated": true, + "demo": "account\/update-magic-u-r-l-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 session", + "operationId": "accountCreateOAuth2Session", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their 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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "301": { + "description": "File" + } + }, + "x-appwrite": { + "method": "createOAuth2Session", + "group": "sessions", + "weight": 20, + "cookies": false, + "type": "webAuth", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "schema": { + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's 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, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's 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, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/sessions\/phone": { + "put": { + "summary": "Update phone session", + "operationId": "accountUpdatePhoneSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePhoneSession", + "group": "sessions", + "weight": 28, + "cookies": false, + "type": "", + "deprecated": true, + "demo": "account\/update-phone-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/token": { + "post": { + "summary": "Create session", + "operationId": "accountCreateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 19, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/{sessionId}": { + "get": { + "summary": "Get session", + "operationId": "accountGetSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "getSession", + "group": "sessions", + "weight": 14, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/get-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update session", + "operationId": "accountUpdateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSession", + "group": "sessions", + "weight": 16, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete session", + "operationId": "accountDeleteSession", + "tags": [ + "account" + ], + "description": "Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#deleteSessions) instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 15, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to delete the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/account\/status": { + "patch": { + "summary": "Update status", + "operationId": "accountUpdateStatus", + "tags": [ + "account" + ], + "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateStatus", + "group": "account", + "weight": 38, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/targets\/push": { + "post": { + "summary": "Create push target", + "operationId": "accountCreatePushTarget", + "tags": [ + "account" + ], + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", + "responses": { + "201": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "x-appwrite": { + "method": "createPushTarget", + "group": "pushTargets", + "weight": 55, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "x-example": "" + } + }, + "required": [ + "targetId", + "identifier" + ] + } + } + } + } + } + }, + "\/account\/targets\/{targetId}\/push": { + "put": { + "summary": "Update push target", + "operationId": "accountUpdatePushTarget", + "tags": [ + "account" + ], + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePushTarget", + "group": "pushTargets", + "weight": 56, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "" + } + }, + "required": [ + "identifier" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete push target", + "operationId": "accountDeletePushTarget", + "tags": [ + "account" + ], + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deletePushTarget", + "group": "pushTargets", + "weight": 57, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/account\/tokens\/email": { + "post": { + "summary": "Create email token (OTP)", + "operationId": "accountCreateEmailToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createEmailToken", + "group": "tokens", + "weight": 26, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-email-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/magic-url": { + "post": { + "summary": "Create magic URL token", + "operationId": "accountCreateMagicURLToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createMagicURLToken", + "group": "tokens", + "weight": 25, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-magic-u-r-l-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the magic URL login. 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.", + "x-example": "https:\/\/example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 token", + "operationId": "accountCreateOAuth2Token", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their 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. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "301": { + "description": "File" + } + }, + "x-appwrite": { + "method": "createOAuth2Token", + "group": "tokens", + "weight": 24, + "cookies": false, + "type": "webAuth", + "deprecated": false, + "demo": "account\/create-o-auth2token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "schema": { + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's 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, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's 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, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/tokens\/phone": { + "post": { + "summary": "Create phone token", + "operationId": "accountCreatePhoneToken", + "tags": [ + "account" + ], + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createPhoneToken", + "group": "tokens", + "weight": 29, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-phone-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},phone:{param-phone}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + } + }, + "required": [ + "userId", + "phone" + ] + } + } + } + } + } + }, + "\/account\/verification": { + "post": { + "summary": "Create email verification", + "operationId": "accountCreateVerification", + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\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", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createVerification", + "group": "verification", + "weight": 41, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "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.", + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update email verification (confirmation)", + "operationId": "accountUpdateVerification", + "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.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "updateVerification", + "group": "verification", + "weight": 42, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/verification\/phone": { + "post": { + "summary": "Create phone verification", + "operationId": "accountCreatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createPhoneVerification", + "group": "verification", + "weight": 43, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},userId:{userId}", + "url:{url},ip:{ip}" + ], + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "put": { + "summary": "Update phone verification (confirmation)", + "operationId": "accountUpdatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "verification", + "weight": 44, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/avatars\/browsers\/{code}": { + "get": { + "summary": "Get browser icon", + "operationId": "avatarsGetBrowser", + "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 [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getBrowser", + "group": null, + "weight": 61, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Browser Code.", + "required": true, + "schema": { + "type": "string", + "x-example": "aa", + "enum": [ + "aa", + "an", + "ch", + "ci", + "cm", + "cr", + "ff", + "sf", + "mf", + "ps", + "oi", + "om", + "op", + "on" + ], + "x-enum-name": "Browser", + "x-enum-keys": [ + "Avant Browser", + "Android WebView Beta", + "Google Chrome", + "Google Chrome (iOS)", + "Google Chrome (Mobile)", + "Chromium", + "Mozilla Firefox", + "Safari", + "Mobile Safari", + "Microsoft Edge", + "Microsoft Edge (iOS)", + "Opera Mini", + "Opera", + "Opera (Next)" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "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, + "schema": { + "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 keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/credit-cards\/{code}": { + "get": { + "summary": "Get credit card icon", + "operationId": "avatarsGetCreditCard", + "tags": [ + "avatars" + ], + "description": "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getCreditCard", + "group": null, + "weight": 60, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "required": true, + "schema": { + "type": "string", + "x-example": "amex", + "enum": [ + "amex", + "argencard", + "cabal", + "cencosud", + "diners", + "discover", + "elo", + "hipercard", + "jcb", + "mastercard", + "naranja", + "targeta-shopping", + "union-china-pay", + "visa", + "mir", + "maestro", + "rupay" + ], + "x-enum-name": "CreditCard", + "x-enum-keys": [ + "American Express", + "Argencard", + "Cabal", + "Cencosud", + "Diners Club", + "Discover", + "Elo", + "Hipercard", + "JCB", + "Mastercard", + "Naranja", + "Tarjeta Shopping", + "Union China Pay", + "Visa", + "MIR", + "Maestro", + "Rupay" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "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, + "schema": { + "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 keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/favicon": { + "get": { + "summary": "Get favicon", + "operationId": "avatarsGetFavicon", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getFavicon", + "group": null, + "weight": 64, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Website URL which you want to fetch the favicon from.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/flags\/{code}": { + "get": { + "summary": "Get country flag", + "operationId": "avatarsGetFlag", + "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. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getFlag", + "group": null, + "weight": 62, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Country Code. ISO Alpha-2 country code format.", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ao", + "al", + "ad", + "ae", + "ar", + "am", + "ag", + "au", + "at", + "az", + "bi", + "be", + "bj", + "bf", + "bd", + "bg", + "bh", + "bs", + "ba", + "by", + "bz", + "bo", + "br", + "bb", + "bn", + "bt", + "bw", + "cf", + "ca", + "ch", + "cl", + "cn", + "ci", + "cm", + "cd", + "cg", + "co", + "km", + "cv", + "cr", + "cu", + "cy", + "cz", + "de", + "dj", + "dm", + "dk", + "do", + "dz", + "ec", + "eg", + "er", + "es", + "ee", + "et", + "fi", + "fj", + "fr", + "fm", + "ga", + "gb", + "ge", + "gh", + "gn", + "gm", + "gw", + "gq", + "gr", + "gd", + "gt", + "gy", + "hn", + "hr", + "ht", + "hu", + "id", + "in", + "ie", + "ir", + "iq", + "is", + "il", + "it", + "jm", + "jo", + "jp", + "kz", + "ke", + "kg", + "kh", + "ki", + "kn", + "kr", + "kw", + "la", + "lb", + "lr", + "ly", + "lc", + "li", + "lk", + "ls", + "lt", + "lu", + "lv", + "ma", + "mc", + "md", + "mg", + "mv", + "mx", + "mh", + "mk", + "ml", + "mt", + "mm", + "me", + "mn", + "mz", + "mr", + "mu", + "mw", + "my", + "na", + "ne", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nz", + "om", + "pk", + "pa", + "pe", + "ph", + "pw", + "pg", + "pl", + "pf", + "kp", + "pt", + "py", + "qa", + "ro", + "ru", + "rw", + "sa", + "sd", + "sn", + "sg", + "sb", + "sl", + "sv", + "sm", + "so", + "rs", + "ss", + "st", + "sr", + "sk", + "si", + "se", + "sz", + "sc", + "sy", + "td", + "tg", + "th", + "tj", + "tm", + "tl", + "to", + "tt", + "tn", + "tr", + "tv", + "tz", + "ug", + "ua", + "uy", + "us", + "uz", + "va", + "vc", + "ve", + "vn", + "vu", + "ws", + "ye", + "za", + "zm", + "zw" + ], + "x-enum-name": "Flag", + "x-enum-keys": [ + "Afghanistan", + "Angola", + "Albania", + "Andorra", + "United Arab Emirates", + "Argentina", + "Armenia", + "Antigua and Barbuda", + "Australia", + "Austria", + "Azerbaijan", + "Burundi", + "Belgium", + "Benin", + "Burkina Faso", + "Bangladesh", + "Bulgaria", + "Bahrain", + "Bahamas", + "Bosnia and Herzegovina", + "Belarus", + "Belize", + "Bolivia", + "Brazil", + "Barbados", + "Brunei Darussalam", + "Bhutan", + "Botswana", + "Central African Republic", + "Canada", + "Switzerland", + "Chile", + "China", + "C\u00f4te d'Ivoire", + "Cameroon", + "Democratic Republic of the Congo", + "Republic of the Congo", + "Colombia", + "Comoros", + "Cape Verde", + "Costa Rica", + "Cuba", + "Cyprus", + "Czech Republic", + "Germany", + "Djibouti", + "Dominica", + "Denmark", + "Dominican Republic", + "Algeria", + "Ecuador", + "Egypt", + "Eritrea", + "Spain", + "Estonia", + "Ethiopia", + "Finland", + "Fiji", + "France", + "Micronesia (Federated States of)", + "Gabon", + "United Kingdom", + "Georgia", + "Ghana", + "Guinea", + "Gambia", + "Guinea-Bissau", + "Equatorial Guinea", + "Greece", + "Grenada", + "Guatemala", + "Guyana", + "Honduras", + "Croatia", + "Haiti", + "Hungary", + "Indonesia", + "India", + "Ireland", + "Iran (Islamic Republic of)", + "Iraq", + "Iceland", + "Israel", + "Italy", + "Jamaica", + "Jordan", + "Japan", + "Kazakhstan", + "Kenya", + "Kyrgyzstan", + "Cambodia", + "Kiribati", + "Saint Kitts and Nevis", + "South Korea", + "Kuwait", + "Lao People's Democratic Republic", + "Lebanon", + "Liberia", + "Libya", + "Saint Lucia", + "Liechtenstein", + "Sri Lanka", + "Lesotho", + "Lithuania", + "Luxembourg", + "Latvia", + "Morocco", + "Monaco", + "Moldova", + "Madagascar", + "Maldives", + "Mexico", + "Marshall Islands", + "North Macedonia", + "Mali", + "Malta", + "Myanmar", + "Montenegro", + "Mongolia", + "Mozambique", + "Mauritania", + "Mauritius", + "Malawi", + "Malaysia", + "Namibia", + "Niger", + "Nigeria", + "Nicaragua", + "Netherlands", + "Norway", + "Nepal", + "Nauru", + "New Zealand", + "Oman", + "Pakistan", + "Panama", + "Peru", + "Philippines", + "Palau", + "Papua New Guinea", + "Poland", + "French Polynesia", + "North Korea", + "Portugal", + "Paraguay", + "Qatar", + "Romania", + "Russia", + "Rwanda", + "Saudi Arabia", + "Sudan", + "Senegal", + "Singapore", + "Solomon Islands", + "Sierra Leone", + "El Salvador", + "San Marino", + "Somalia", + "Serbia", + "South Sudan", + "Sao Tome and Principe", + "Suriname", + "Slovakia", + "Slovenia", + "Sweden", + "Eswatini", + "Seychelles", + "Syria", + "Chad", + "Togo", + "Thailand", + "Tajikistan", + "Turkmenistan", + "Timor-Leste", + "Tonga", + "Trinidad and Tobago", + "Tunisia", + "Turkey", + "Tuvalu", + "Tanzania", + "Uganda", + "Ukraine", + "Uruguay", + "United States", + "Uzbekistan", + "Vatican City", + "Saint Vincent and the Grenadines", + "Venezuela", + "Vietnam", + "Vanuatu", + "Samoa", + "Yemen", + "South Africa", + "Zambia", + "Zimbabwe" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "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, + "schema": { + "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 keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/image": { + "get": { + "summary": "Get image from URL", + "operationId": "avatarsGetImage", + "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getImage", + "group": null, + "weight": 63, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Image URL which you want to crop.", + "required": true, + "schema": { + "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. Defaults to 400.", + "required": false, + "schema": { + "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. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/initials": { + "get": { + "summary": "Get user initials", + "operationId": "avatarsGetInitials", + "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getInitials", + "group": null, + "weight": 66, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Full Name. When empty, current user name or email will be used. Max length: 128 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "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, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 500 + }, + "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, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/qr": { + "get": { + "summary": "Get QR code", + "operationId": "avatarsGetQR", + "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.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getQR", + "group": null, + "weight": 65, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "text", + "description": "Plain text to be converted to QR code image.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "query" + }, + { + "name": "size", + "description": "QR code size. Pass an integer between 1 to 1000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 400 + }, + "in": "query" + }, + { + "name": "margin", + "description": "Margin from edge. Pass an integer between 0 to 10. Defaults to 1.", + "required": false, + "schema": { + "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, + "schema": { + "type": "boolean", + "x-example": false, + "default": false + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "databasesListDocuments", + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "listDocuments", + "group": "documents", + "weight": 110, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "tags": [ + "databases" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "createDocument", + "group": "documents", + "weight": 109, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createDocument", + "auth": { + "Admin": [], + "Session": [], + "Key": [], + "JWT": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "databasesGetDocument", + "tags": [ + "databases" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "getDocument", + "group": "documents", + "weight": 111, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert document", + "operationId": "databasesUpsertDocument", + "tags": [ + "databases" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "upsertDocument", + "group": "documents", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include all required attributes of the document to be created or updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "patch": { + "summary": "Update document", + "operationId": "databasesUpdateDocument", + "tags": [ + "databases" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDocument", + "group": "documents", + "weight": 113, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete document", + "operationId": "databasesDeleteDocument", + "tags": [ + "databases" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDocument", + "group": "documents", + "weight": 119, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/functions\/{functionId}\/executions": { + "get": { + "summary": "List executions", + "operationId": "functionsListExecutions", + "tags": [ + "functions" + ], + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "x-appwrite": { + "method": "listExecutions", + "group": "executions", + "weight": 394, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-executions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create execution", + "operationId": "functionsCreateExecution", + "tags": [ + "functions" + ], + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "responses": { + "201": { + "description": "Execution", + "content": { + "multipart\/form-data": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "x-appwrite": { + "method": "createExecution", + "group": "executions", + "weight": 392, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "x-example": "" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "x-example": "" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is GET.", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "string", + "description": "HTTP headers of execution. Defaults to empty.", + "x-example": null + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/functions\/{functionId}\/executions\/{executionId}": { + "get": { + "summary": "Get execution", + "operationId": "functionsGetExecution", + "tags": [ + "functions" + ], + "description": "Get a function execution log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "x-appwrite": { + "method": "getExecution", + "group": "executions", + "weight": 393, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/graphql": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlQuery", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "x-appwrite": { + "method": "query", + "group": "graphql", + "weight": 308, + "cookies": false, + "type": "graphql", + "deprecated": false, + "demo": "graphql\/query.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/graphql\/mutation": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlMutation", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "x-appwrite": { + "method": "mutation", + "group": "graphql", + "weight": 307, + "cookies": false, + "type": "graphql", + "deprecated": false, + "demo": "graphql\/mutation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale": { + "get": { + "summary": "Get user locale", + "operationId": "localeGet", + "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))", + "responses": { + "200": { + "description": "Locale", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/locale" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 124, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/codes": { + "get": { + "summary": "List locale codes", + "operationId": "localeListCodes", + "tags": [ + "locale" + ], + "description": "List of all locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes).", + "responses": { + "200": { + "description": "Locale codes list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/localeCodeList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCodes", + "group": null, + "weight": 125, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/continents": { + "get": { + "summary": "List continents", + "operationId": "localeListContinents", + "tags": [ + "locale" + ], + "description": "List of all continents. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Continents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/continentList" + } + } + } + } + }, + "x-appwrite": { + "method": "listContinents", + "group": null, + "weight": 129, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-continents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries": { + "get": { + "summary": "List countries", + "operationId": "localeListCountries", + "tags": [ + "locale" + ], + "description": "List of all countries. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCountries", + "group": null, + "weight": 126, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/eu": { + "get": { + "summary": "List EU countries", + "operationId": "localeListCountriesEU", + "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.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCountriesEU", + "group": null, + "weight": 127, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries-e-u.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/phones": { + "get": { + "summary": "List countries phone codes", + "operationId": "localeListCountriesPhones", + "tags": [ + "locale" + ], + "description": "List of all countries phone codes. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Phones List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/phoneList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCountriesPhones", + "group": null, + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries-phones.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/currencies": { + "get": { + "summary": "List currencies", + "operationId": "localeListCurrencies", + "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.", + "responses": { + "200": { + "description": "Currencies List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/currencyList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCurrencies", + "group": null, + "weight": 130, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-currencies.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/languages": { + "get": { + "summary": "List languages", + "operationId": "localeListLanguages", + "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.", + "responses": { + "200": { + "description": "Languages List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/languageList" + } + } + } + } + }, + "x-appwrite": { + "method": "listLanguages", + "group": null, + "weight": 131, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-languages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers": { + "post": { + "summary": "Create subscriber", + "operationId": "messagingCreateSubscriber", + "tags": [ + "messaging" + ], + "description": "Create a new subscriber.", + "responses": { + "201": { + "description": "Subscriber", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriber" + } + } + } + } + }, + "x-appwrite": { + "method": "createSubscriber", + "group": "subscribers", + "weight": 354, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID to subscribe to.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "subscriberId": { + "type": "string", + "description": "Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.", + "x-example": "" + }, + "targetId": { + "type": "string", + "description": "Target ID. The target ID to link to the specified Topic ID.", + "x-example": "" + } + }, + "required": [ + "subscriberId", + "targetId" + ] + } + } + } + } + } + }, + "\/messaging\/topics\/{topicId}\/subscribers\/{subscriberId}": { + "delete": { + "summary": "Delete subscriber", + "operationId": "messagingDeleteSubscriber", + "tags": [ + "messaging" + ], + "description": "Delete a subscriber by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSubscriber", + "group": "subscribers", + "weight": 358, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files": { + "get": { + "summary": "List files", + "operationId": "storageListFiles", + "tags": [ + "storage" + ], + "description": "Get a list of all the user files. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Files List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/fileList" + } + } + } + } + }, + "x-appwrite": { + "method": "listFiles", + "group": "files", + "weight": 214, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file", + "operationId": "storageCreateFile", + "tags": [ + "storage" + ], + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "x-appwrite": { + "method": "createFile", + "group": "files", + "weight": 213, + "cookies": false, + "type": "upload", + "deprecated": false, + "demo": "storage\/create-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "fileId": { + "type": "string", + "description": "File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "", + "x-upload-id": true + }, + "file": { + "type": "string", + "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", + "x-example": null + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "fileId", + "file" + ] + } + } + } + } + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "Get file", + "operationId": "storageGetFile", + "tags": [ + "storage" + ], + "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "x-appwrite": { + "method": "getFile", + "group": "files", + "weight": 215, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update file", + "operationId": "storageUpdateFile", + "tags": [ + "storage" + ], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "x-appwrite": { + "method": "updateFile", + "group": "files", + "weight": 220, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/update-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the file", + "x-example": "" + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete file", + "operationId": "storageDeleteFile", + "tags": [ + "storage" + ], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteFile", + "group": "files", + "weight": 221, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/delete-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download": { + "get": { + "summary": "Get file for download", + "operationId": "storageGetFileDownload", + "tags": [ + "storage" + ], + "description": "Get a 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.", + "responses": { + "200": { + "description": "File" + } + }, + "x-appwrite": { + "method": "getFileDownload", + "group": "files", + "weight": 217, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/preview": { + "get": { + "summary": "Get file preview", + "operationId": "storageGetFilePreview", + "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. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getFilePreview", + "group": "files", + "weight": 216, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "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, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "schema": { + "type": "string", + "x-example": "center", + "enum": [ + "center", + "top-left", + "top", + "top-right", + "left", + "right", + "bottom-left", + "bottom", + "bottom-right" + ], + "x-enum-name": "ImageGravity", + "x-enum-keys": [], + "default": "center" + }, + "in": "query" + }, + { + "name": "quality", + "description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + }, + { + "name": "borderWidth", + "description": "Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "borderColor", + "description": "Preview image border color. Use a valid HEX color, no # is needed for prefix.", + "required": false, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + }, + { + "name": "borderRadius", + "description": "Preview image border radius in pixels. Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "opacity", + "description": "Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "x-example": 0, + "default": 1 + }, + "in": "query" + }, + { + "name": "rotation", + "description": "Preview image rotation in degrees. Pass an integer between -360 and 360.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -360, + "default": 0 + }, + "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, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "schema": { + "type": "string", + "x-example": "jpg", + "enum": [ + "jpg", + "jpeg", + "png", + "webp", + "heic", + "avif", + "gif" + ], + "x-enum-name": "ImageFormat", + "x-enum-keys": [], + "default": "" + }, + "in": "query" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/view": { + "get": { + "summary": "Get file for view", + "operationId": "storageGetFileView", + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.", + "responses": { + "200": { + "description": "File" + } + }, + "x-appwrite": { + "method": "getFileView", + "group": "files", + "weight": 218, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/teams": { + "get": { + "summary": "List teams", + "operationId": "teamsList", + "tags": [ + "teams" + ], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.", + "responses": { + "200": { + "description": "Teams List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/teamList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "group": "teams", + "weight": 225, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team", + "operationId": "teamsCreate", + "tags": [ + "teams" + ], + "description": "Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "x-appwrite": { + "method": "create", + "group": "teams", + "weight": 224, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "name": { + "type": "string", + "description": "Team name. Max length: 128 chars.", + "x-example": "" + }, + "roles": { + "type": "array", + "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](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "teamId", + "name" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}": { + "get": { + "summary": "Get team", + "operationId": "teamsGet", + "tags": [ + "teams" + ], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "teams", + "weight": 226, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update name", + "operationId": "teamsUpdateName", + "tags": [ + "teams" + ], + "description": "Update the team's name by its unique ID.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "teams", + "weight": 228, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "New team name. Max length: 128 chars.", + "x-example": "" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team", + "operationId": "teamsDelete", + "tags": [ + "teams" + ], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "teams", + "weight": 230, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships": { + "get": { + "summary": "List team memberships", + "operationId": "teamsListMemberships", + "tags": [ + "teams" + ], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Memberships List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membershipList" + } + } + } + } + }, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 232, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team membership", + "operationId": "teamsCreateMembership", + "tags": [ + "teams" + ], + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", + "responses": { + "201": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "x-appwrite": { + "method": "createMembership", + "group": "memberships", + "weight": 231, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/create-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the new team member.", + "x-example": "email@example.com" + }, + "userId": { + "type": "string", + "description": "ID of the user to be added to a team.", + "x-example": "" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "roles": { + "type": "array", + "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](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", + "x-example": "https:\/\/example.com" + }, + "name": { + "type": "string", + "description": "Name of the new team member. Max length: 128 chars.", + "x-example": "" + } + }, + "required": [ + "roles" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}": { + "get": { + "summary": "Get team membership", + "operationId": "teamsGetMembership", + "tags": [ + "teams" + ], + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "x-appwrite": { + "method": "getMembership", + "group": "memberships", + "weight": 233, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/get-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update membership", + "operationId": "teamsUpdateMembership", + "tags": [ + "teams" + ], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMembership", + "group": "memberships", + "weight": 234, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "roles": { + "type": "array", + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "roles" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team membership", + "operationId": "teamsDeleteMembership", + "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 it is not accepted.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMembership", + "group": "memberships", + "weight": 236, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}\/status": { + "patch": { + "summary": "Update team membership status", + "operationId": "teamsUpdateMembershipStatus", + "tags": [ + "teams" + ], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMembershipStatus", + "group": "memberships", + "weight": 235, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/prefs": { + "get": { + "summary": "Get team preferences", + "operationId": "teamsGetPrefs", + "tags": [ + "teams" + ], + "description": "Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getPrefs).", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "teams", + "weight": 227, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update preferences", + "operationId": "teamsUpdatePrefs", + "tags": [ + "teams" + ], + "description": "Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "teams", + "weight": 229, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + } + }, + "tags": [ + { + "name": "account", + "description": "The Account service allows you to authenticate and manage a user account." + }, + { + "name": "avatars", + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + }, + { + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" + }, + { + "name": "locale", + "description": "The Locale service allows you to customize your app based on your users' location." + }, + { + "name": "health", + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." + }, + { + "name": "projects", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "project", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "storage", + "description": "The Storage service allows you to manage your project files." + }, + { + "name": "teams", + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" + }, + { + "name": "users", + "description": "The Users service allows you to manage your project users." + }, + { + "name": "sites", + "description": "The Sites Service allows you view, create and manage your web applications." + }, + { + "name": "functions", + "description": "The Functions Service allows you view, create and manage your Cloud Functions." + }, + { + "name": "proxy", + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." + }, + { + "name": "graphql", + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." + }, + { + "name": "console", + "description": "The Console service allows you to interact with console relevant informations." + }, + { + "name": "migrations", + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." + }, + { + "name": "messaging", + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." + } + ], + "components": { + "schemas": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true + }, + "error": { + "description": "Error", + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Error message.", + "x-example": "Not found" + }, + "code": { + "type": "string", + "description": "Error code.", + "x-example": "404" + }, + "type": { + "type": "string", + "description": "Error type. You can learn more about all the error types at https:\/\/appwrite.io\/docs\/error-codes#errorTypes", + "x-example": "not_found" + }, + "version": { + "type": "string", + "description": "Server version number.", + "x-example": "1.0" + } + }, + "required": [ + "message", + "code", + "type", + "version" + ] + }, + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { + "$ref": "#\/components\/schemas\/document" + }, + "x-example": "" + } + }, + "required": [ + "total", + "documents" + ] + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { + "$ref": "#\/components\/schemas\/session" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sessions" + ] + }, + "identityList": { + "description": "Identities List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of identities documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "identities": { + "type": "array", + "description": "List of identities.", + "items": { + "$ref": "#\/components\/schemas\/identity" + }, + "x-example": "" + } + }, + "required": [ + "total", + "identities" + ] + }, + "logList": { + "description": "Logs List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of logs documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "logs": { + "type": "array", + "description": "List of logs.", + "items": { + "$ref": "#\/components\/schemas\/log" + }, + "x-example": "" + } + }, + "required": [ + "total", + "logs" + ] + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { + "$ref": "#\/components\/schemas\/file" + }, + "x-example": "" + } + }, + "required": [ + "total", + "files" + ] + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { + "$ref": "#\/components\/schemas\/team" + }, + "x-example": "" + } + }, + "required": [ + "total", + "teams" + ] + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { + "$ref": "#\/components\/schemas\/membership" + }, + "x-example": "" + } + }, + "required": [ + "total", + "memberships" + ] + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { + "$ref": "#\/components\/schemas\/execution" + }, + "x-example": "" + } + }, + "required": [ + "total", + "executions" + ] + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { + "$ref": "#\/components\/schemas\/country" + }, + "x-example": "" + } + }, + "required": [ + "total", + "countries" + ] + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { + "$ref": "#\/components\/schemas\/continent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "continents" + ] + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { + "$ref": "#\/components\/schemas\/language" + }, + "x-example": "" + } + }, + "required": [ + "total", + "languages" + ] + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { + "$ref": "#\/components\/schemas\/currency" + }, + "x-example": "" + } + }, + "required": [ + "total", + "currencies" + ] + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { + "$ref": "#\/components\/schemas\/phone" + }, + "x-example": "" + } + }, + "required": [ + "total", + "phones" + ] + }, + "localeCodeList": { + "description": "Locale codes list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of localeCodes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "localeCodes": { + "type": "array", + "description": "List of localeCodes.", + "items": { + "$ref": "#\/components\/schemas\/localeCode" + }, + "x-example": "" + } + }, + "required": [ + "total", + "localeCodes" + ] + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, + "$collectionId": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c15117e" + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e" + }, + "$createdAt": { + "type": "string", + "description": "Document creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Document update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Document permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$collectionId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ] + }, + "log": { + "description": "Log", + "type": "object", + "properties": { + "event": { + "type": "string", + "description": "Event name.", + "x-example": "account.sessions.create" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "610fc2f985ee0" + }, + "userEmail": { + "type": "string", + "description": "User Email.", + "x-example": "john@appwrite.io" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "John Doe" + }, + "mode": { + "type": "string", + "description": "API mode when event triggered.", + "x-example": "admin" + }, + "ip": { + "type": "string", + "description": "IP session in use when the session was created.", + "x-example": "127.0.0.1" + }, + "time": { + "type": "string", + "description": "Log creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "event", + "userId", + "userEmail", + "userName", + "mode", + "ip", + "time", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName" + ] + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "User creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "User update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "User name.", + "x-example": "John Doe" + }, + "password": { + "type": "string", + "description": "Hashed user password.", + "x-example": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "nullable": true + }, + "hash": { + "type": "string", + "description": "Password hashing algorithm.", + "x-example": "argon2", + "nullable": true + }, + "hashOptions": { + "type": "object", + "description": "Password hashing algorithm configuration.", + "x-example": {}, + "items": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/algoArgon2" + }, + { + "$ref": "#\/components\/schemas\/algoScrypt" + }, + { + "$ref": "#\/components\/schemas\/algoScryptModified" + }, + { + "$ref": "#\/components\/schemas\/algoBcrypt" + }, + { + "$ref": "#\/components\/schemas\/algoPhpass" + }, + { + "$ref": "#\/components\/schemas\/algoSha" + }, + { + "$ref": "#\/components\/schemas\/algoMd5" + } + ] + }, + "nullable": true + }, + "registration": { + "type": "string", + "description": "User registration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "x-example": true + }, + "labels": { + "type": "array", + "description": "Labels for the user.", + "items": { + "type": "string" + }, + "x-example": [ + "vip" + ] + }, + "passwordUpdate": { + "type": "string", + "description": "Password update time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "email": { + "type": "string", + "description": "User email address.", + "x-example": "john@appwrite.io" + }, + "phone": { + "type": "string", + "description": "User phone number in E.164 format.", + "x-example": "+4930901820" + }, + "emailVerification": { + "type": "boolean", + "description": "Email verification status.", + "x-example": true + }, + "phoneVerification": { + "type": "boolean", + "description": "Phone verification status.", + "x-example": true + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status.", + "x-example": true + }, + "prefs": { + "type": "object", + "description": "User preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "$ref": "#\/components\/schemas\/preferences" + } + }, + "targets": { + "type": "array", + "description": "A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.", + "items": { + "$ref": "#\/components\/schemas\/target" + }, + "x-example": [] + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "registration", + "status", + "labels", + "passwordUpdate", + "email", + "phone", + "emailVerification", + "phoneVerification", + "mfa", + "prefs", + "targets", + "accessedAt" + ] + }, + "algoMd5": { + "description": "AlgoMD5", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "md5" + } + }, + "required": [ + "type" + ] + }, + "algoSha": { + "description": "AlgoSHA", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "sha" + } + }, + "required": [ + "type" + ] + }, + "algoPhpass": { + "description": "AlgoPHPass", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "phpass" + } + }, + "required": [ + "type" + ] + }, + "algoBcrypt": { + "description": "AlgoBcrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "bcrypt" + } + }, + "required": [ + "type" + ] + }, + "algoScrypt": { + "description": "AlgoScrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scrypt" + }, + "costCpu": { + "type": "integer", + "description": "CPU complexity of computed hash.", + "x-example": 8, + "format": "int32" + }, + "costMemory": { + "type": "integer", + "description": "Memory complexity of computed hash.", + "x-example": 14, + "format": "int32" + }, + "costParallel": { + "type": "integer", + "description": "Parallelization of computed hash.", + "x-example": 1, + "format": "int32" + }, + "length": { + "type": "integer", + "description": "Length used to compute hash.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "type", + "costCpu", + "costMemory", + "costParallel", + "length" + ] + }, + "algoScryptModified": { + "description": "AlgoScryptModified", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scryptMod" + }, + "salt": { + "type": "string", + "description": "Salt used to compute hash.", + "x-example": "UxLMreBr6tYyjQ==" + }, + "saltSeparator": { + "type": "string", + "description": "Separator used to compute hash.", + "x-example": "Bw==" + }, + "signerKey": { + "type": "string", + "description": "Key used to compute hash.", + "x-example": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "required": [ + "type", + "salt", + "saltSeparator", + "signerKey" + ] + }, + "algoArgon2": { + "description": "AlgoArgon2", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "argon2" + }, + "memoryCost": { + "type": "integer", + "description": "Memory used to compute hash.", + "x-example": 65536, + "format": "int32" + }, + "timeCost": { + "type": "integer", + "description": "Amount of time consumed to compute hash", + "x-example": 4, + "format": "int32" + }, + "threads": { + "type": "integer", + "description": "Number of threads used to compute hash.", + "x-example": 3, + "format": "int32" + } + }, + "required": [ + "type", + "memoryCost", + "timeCost", + "threads" + ] + }, + "preferences": { + "description": "Preferences", + "type": "object", + "additionalProperties": true + }, + "session": { + "description": "Session", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Session ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Session creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Session update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "expire": { + "type": "string", + "description": "Session expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "Session Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "Session Provider User ID.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "x-example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "x-example": true + }, + "factors": { + "type": "array", + "description": "Returns a list of active session factors.", + "items": { + "type": "string" + }, + "x-example": [ + "email" + ] + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate the user. Only included if the request was made with an API key", + "x-example": "5e5bb8c16897e" + }, + "mfaUpdatedAt": { + "type": "string", + "description": "Most recent date in ISO 8601 format when the session successfully passed MFA challenge.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "ip", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName", + "current", + "factors", + "secret", + "mfaUpdatedAt" + ] + }, + "identity": { + "description": "Identity", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Identity ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Identity creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Identity update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "provider": { + "type": "string", + "description": "Identity Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "ID of the User in the Identity Provider.", + "x-example": "5e5bb8c16897e" + }, + "providerEmail": { + "type": "string", + "description": "Email of the User in the Identity Provider.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Identity Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Identity Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "provider", + "providerUid", + "providerEmail", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken" + ] + }, + "token": { + "description": "Token", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "secret": { + "type": "string", + "description": "Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "phrase": { + "type": "string", + "description": "Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.", + "x-example": "Golden Fox" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "secret", + "expire", + "phrase" + ] + }, + "jwt": { + "description": "JWT", + "type": "object", + "properties": { + "jwt": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "required": [ + "jwt" + ] + }, + "locale": { + "description": "Locale", + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "User IP address.", + "x-example": "127.0.0.1" + }, + "countryCode": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format", + "x-example": "US" + }, + "country": { + "type": "string", + "description": "Country name. This field support localization.", + "x-example": "United States" + }, + "continentCode": { + "type": "string", + "description": "Continent code. A two character continent code \"AF\" for Africa, \"AN\" for Antarctica, \"AS\" for Asia, \"EU\" for Europe, \"NA\" for North America, \"OC\" for Oceania, and \"SA\" for South America.", + "x-example": "NA" + }, + "continent": { + "type": "string", + "description": "Continent name. This field support localization.", + "x-example": "North America" + }, + "eu": { + "type": "boolean", + "description": "True if country is part of the European Union.", + "x-example": false + }, + "currency": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format", + "x-example": "USD" + } + }, + "required": [ + "ip", + "countryCode", + "country", + "continentCode", + "continent", + "eu", + "currency" + ] + }, + "localeCode": { + "description": "LocaleCode", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes)", + "x-example": "en-us" + }, + "name": { + "type": "string", + "description": "Locale name", + "x-example": "US" + } + }, + "required": [ + "code", + "name" + ] + }, + "file": { + "description": "File", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "File ID.", + "x-example": "5e5ea5c16897e" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "File creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "File update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "File permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "name": { + "type": "string", + "description": "File name.", + "x-example": "Pink.png" + }, + "signature": { + "type": "string", + "description": "File MD5 signature.", + "x-example": "5d529fd02b544198ae075bd57c1762bb" + }, + "mimeType": { + "type": "string", + "description": "File mime type.", + "x-example": "image\/png" + }, + "sizeOriginal": { + "type": "integer", + "description": "File original size in bytes.", + "x-example": 17890, + "format": "int32" + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "x-example": 17890, + "format": "int32" + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "x-example": 17890, + "format": "int32" + } + }, + "required": [ + "$id", + "bucketId", + "$createdAt", + "$updatedAt", + "$permissions", + "name", + "signature", + "mimeType", + "sizeOriginal", + "chunksTotal", + "chunksUploaded" + ] + }, + "team": { + "description": "Team", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Team creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Team update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "x-example": 7, + "format": "int32" + }, + "prefs": { + "type": "object", + "description": "Team preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "$ref": "#\/components\/schemas\/preferences" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "total", + "prefs" + ] + }, + "membership": { + "description": "Membership", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Membership ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Membership creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Membership update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "John Doe" + }, + "userEmail": { + "type": "string", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "john@appwrite.io" + }, + "teamId": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "teamName": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "invited": { + "type": "string", + "description": "Date, the user has been invited to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "joined": { + "type": "string", + "description": "Date, the user has accepted the invitation to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "confirm": { + "type": "boolean", + "description": "User confirmation status, true if the user has joined the team or false otherwise.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", + "x-example": false + }, + "roles": { + "type": "array", + "description": "User list of roles", + "items": { + "type": "string" + }, + "x-example": [ + "owner" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "userName", + "userEmail", + "teamId", + "teamName", + "invited", + "joined", + "confirm", + "mfa", + "roles" + ] + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Execution creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Execution upate date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Execution roles.", + "items": { + "type": "string" + }, + "x-example": [ + "any" + ] + }, + "functionId": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea6g16897e" + }, + "trigger": { + "type": "string", + "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", + "x-example": "http" + }, + "status": { + "type": "string", + "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", + "x-example": "processing" + }, + "requestMethod": { + "type": "string", + "description": "HTTP request method type.", + "x-example": "GET" + }, + "requestPath": { + "type": "string", + "description": "HTTP request path and query.", + "x-example": "\/articles?id=5" + }, + "requestHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "responseStatusCode": { + "type": "integer", + "description": "HTTP response status code.", + "x-example": 200, + "format": "int32" + }, + "responseBody": { + "type": "string", + "description": "HTTP response body. This will return empty unless execution is created as synchronous.", + "x-example": "" + }, + "responseHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "logs": { + "type": "string", + "description": "Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "errors": { + "type": "string", + "description": "Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "duration": { + "type": "number", + "description": "Resource(function\/site) execution duration in seconds.", + "x-example": 0.4, + "format": "double" + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for execution. If left empty, execution will be queued immediately.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "functionId", + "trigger", + "status", + "requestMethod", + "requestPath", + "requestHeaders", + "responseStatusCode", + "responseBody", + "responseHeaders", + "logs", + "errors", + "duration" + ] + }, + "country": { + "description": "Country", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "code": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + } + }, + "required": [ + "name", + "code" + ] + }, + "continent": { + "description": "Continent", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Continent name.", + "x-example": "Europe" + }, + "code": { + "type": "string", + "description": "Continent two letter code.", + "x-example": "EU" + } + }, + "required": [ + "name", + "code" + ] + }, + "language": { + "description": "Language", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Language name.", + "x-example": "Italian" + }, + "code": { + "type": "string", + "description": "Language two-character ISO 639-1 codes.", + "x-example": "it" + }, + "nativeName": { + "type": "string", + "description": "Language native name.", + "x-example": "Italiano" + } + }, + "required": [ + "name", + "code", + "nativeName" + ] + }, + "currency": { + "description": "Currency", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Currency symbol.", + "x-example": "$" + }, + "name": { + "type": "string", + "description": "Currency name.", + "x-example": "US dollar" + }, + "symbolNative": { + "type": "string", + "description": "Currency native symbol.", + "x-example": "$" + }, + "decimalDigits": { + "type": "integer", + "description": "Number of decimal digits.", + "x-example": 2, + "format": "int32" + }, + "rounding": { + "type": "number", + "description": "Currency digit rounding.", + "x-example": 0, + "format": "double" + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.", + "x-example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "x-example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ] + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "x-example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "code", + "countryCode", + "countryName" + ] + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "x-example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "x-example": "application\/json" + } + }, + "required": [ + "name", + "value" + ] + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ] + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "x-example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ] + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "x-example": true + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "x-example": true + } + }, + "required": [ + "secret", + "uri" + ] + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "x-example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "x-example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "x-example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "x-example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode" + ] + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "x-example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "items": { + "$ref": "#\/components\/schemas\/target" + } + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ] + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "x-example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "x-example": "259125845563242502", + "nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ] + } + }, + "securitySchemes": { + "Project": { + "type": "apiKey", + "name": "X-Appwrite-Project", + "description": "Your project ID", + "in": "header", + "x-appwrite": { + "demo": "" + } + }, + "JWT": { + "type": "apiKey", + "name": "X-Appwrite-JWT", + "description": "Your secret JSON Web Token", + "in": "header" + }, + "Locale": { + "type": "apiKey", + "name": "X-Appwrite-Locale", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "en" + } + }, + "Session": { + "type": "apiKey", + "name": "X-Appwrite-Session", + "description": "The user session to authenticate with", + "in": "header" + }, + "DevKey": { + "type": "apiKey", + "name": "X-Appwrite-Dev-Key", + "description": "Your secret dev API key", + "in": "header" + } + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file diff --git a/app/config/specs/open-api3-1.8.x-console.json b/app/config/specs/open-api3-1.8.x-console.json new file mode 100644 index 0000000000..85ef1334d4 --- /dev/null +++ b/app/config/specs/open-api3-1.8.x-console.json @@ -0,0 +1,44056 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.7.4", + "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@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "servers": [ + { + "url": "https:\/\/cloud.appwrite.io\/v1" + }, + { + "url": "https:\/\/.cloud.appwrite.io\/v1" + } + ], + "paths": { + "\/account": { + "get": { + "summary": "Get account", + "operationId": "accountGet", + "tags": [ + "account" + ], + "description": "Get the currently logged in user.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "account", + "weight": 10, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create account", + "operationId": "accountCreate", + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailSession).", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "create", + "group": "account", + "weight": 9, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete account", + "operationId": "accountDelete", + "tags": [ + "account" + ], + "description": "Delete the currently logged in user.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "account", + "weight": 11, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/email": { + "patch": { + "summary": "Update email", + "operationId": "accountUpdateEmail", + "tags": [ + "account" + ], + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateEmail", + "group": "account", + "weight": 35, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/identities": { + "get": { + "summary": "List identities", + "operationId": "accountListIdentities", + "tags": [ + "account" + ], + "description": "Get the list of identities for the currently logged in user.", + "responses": { + "200": { + "description": "Identities List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/identityList" + } + } + } + } + }, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 58, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "accountDeleteIdentity", + "tags": [ + "account" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 59, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/account\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "accountCreateJWT", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "x-appwrite": { + "method": "createJWT", + "group": "tokens", + "weight": 30, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/logs": { + "get": { + "summary": "List logs", + "operationId": "accountListLogs", + "tags": [ + "account" + ], + "description": "Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 32, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "accountUpdateMFA", + "tags": [ + "account" + ], + "description": "Enable or disable MFA on an account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMFA", + "group": "mfa", + "weight": 45, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-m-f-a.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaType" + } + } + } + } + }, + "x-appwrite": { + "method": "createMfaAuthenticator", + "group": "mfa", + "weight": 47, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfaAuthenticator", + "group": "mfa", + "weight": 48, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "otp": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "otp" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 52, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/account\/mfa\/challenge": { + "post": { + "summary": "Create MFA challenge", + "operationId": "accountCreateMfaChallenge", + "tags": [ + "account" + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Challenge", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaChallenge" + } + } + } + } + }, + "x-appwrite": { + "method": "createMfaChallenge", + "group": "mfa", + "weight": 53, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "factor": { + "type": "string", + "description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.", + "x-example": "email", + "enum": [ + "email", + "phone", + "totp", + "recoverycode" + ], + "x-enum-name": "AuthenticationFactor", + "x-enum-keys": [] + } + }, + "required": [ + "factor" + ] + } + } + } + } + }, + "put": { + "summary": "Update MFA challenge (confirmation)", + "operationId": "accountUpdateMfaChallenge", + "tags": [ + "account" + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfaChallenge", + "group": "mfa", + "weight": 54, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},challengeId:{param-challengeId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "challengeId": { + "type": "string", + "description": "ID of the challenge.", + "x-example": "" + }, + "otp": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "challengeId", + "otp" + ] + } + } + } + } + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 46, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 51, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 49, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 50, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/name": { + "patch": { + "summary": "Update name", + "operationId": "accountUpdateName", + "tags": [ + "account" + ], + "description": "Update currently logged in user account name.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "account", + "weight": 33, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "\/account\/password": { + "patch": { + "summary": "Update password", + "operationId": "accountUpdatePassword", + "tags": [ + "account" + ], + "description": "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePassword", + "group": "account", + "weight": 34, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "x-example": null + }, + "oldPassword": { + "type": "string", + "description": "Current user password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "password" + ] + } + } + } + } + } + }, + "\/account\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "accountUpdatePhone", + "tags": [ + "account" + ], + "description": "Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createPhoneVerification) endpoint to send a confirmation SMS.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePhone", + "group": "account", + "weight": 36, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "phone", + "password" + ] + } + } + } + } + } + }, + "\/account\/prefs": { + "get": { + "summary": "Get account preferences", + "operationId": "accountGetPrefs", + "tags": [ + "account" + ], + "description": "Get the preferences as a key-value object for the currently logged in user.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "account", + "weight": 31, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update preferences", + "operationId": "accountUpdatePrefs", + "tags": [ + "account" + ], + "description": "Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "account", + "weight": 37, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/account\/recovery": { + "post": { + "summary": "Create password recovery", + "operationId": "accountCreateRecovery", + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createRecovery", + "group": "recovery", + "weight": 39, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "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.", + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "email", + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update password recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/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.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "updateRecovery", + "group": "recovery", + "weight": 40, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid reset token.", + "x-example": "" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "x-example": null + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions": { + "get": { + "summary": "List sessions", + "operationId": "accountListSessions", + "tags": [ + "account" + ], + "description": "Get the list of active sessions across different devices for the currently logged in user.", + "responses": { + "200": { + "description": "Sessions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/sessionList" + } + } + } + } + }, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 12, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "delete": { + "summary": "Delete sessions", + "operationId": "accountDeleteSessions", + "tags": [ + "account" + ], + "description": "Delete all sessions from the user account and remove any sessions cookies from the end client.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 13, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/anonymous": { + "post": { + "summary": "Create anonymous session", + "operationId": "accountCreateAnonymousSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmail) or create an [OAuth2 session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#CreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "createAnonymousSession", + "group": "sessions", + "weight": 18, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-anonymous-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/sessions\/email": { + "post": { + "summary": "Create email password session", + "operationId": "accountCreateEmailPasswordSession", + "tags": [ + "account" + ], + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "createEmailPasswordSession", + "group": "sessions", + "weight": 17, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-email-password-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},email:{param-email}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions\/magic-url": { + "put": { + "summary": "Update magic URL session", + "operationId": "accountUpdateMagicURLSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMagicURLSession", + "group": "sessions", + "weight": 27, + "cookies": false, + "type": "", + "deprecated": true, + "demo": "account\/update-magic-u-r-l-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 session", + "operationId": "accountCreateOAuth2Session", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their 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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "301": { + "description": "File" + } + }, + "x-appwrite": { + "method": "createOAuth2Session", + "group": "sessions", + "weight": 20, + "cookies": false, + "type": "webAuth", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "schema": { + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's 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, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's 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, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/sessions\/phone": { + "put": { + "summary": "Update phone session", + "operationId": "accountUpdatePhoneSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePhoneSession", + "group": "sessions", + "weight": 28, + "cookies": false, + "type": "", + "deprecated": true, + "demo": "account\/update-phone-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/token": { + "post": { + "summary": "Create session", + "operationId": "accountCreateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 19, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/{sessionId}": { + "get": { + "summary": "Get session", + "operationId": "accountGetSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "getSession", + "group": "sessions", + "weight": 14, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/get-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update session", + "operationId": "accountUpdateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSession", + "group": "sessions", + "weight": 16, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete session", + "operationId": "accountDeleteSession", + "tags": [ + "account" + ], + "description": "Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#deleteSessions) instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 15, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to delete the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/account\/status": { + "patch": { + "summary": "Update status", + "operationId": "accountUpdateStatus", + "tags": [ + "account" + ], + "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateStatus", + "group": "account", + "weight": 38, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/targets\/push": { + "post": { + "summary": "Create push target", + "operationId": "accountCreatePushTarget", + "tags": [ + "account" + ], + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", + "responses": { + "201": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "x-appwrite": { + "method": "createPushTarget", + "group": "pushTargets", + "weight": 55, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "x-example": "" + } + }, + "required": [ + "targetId", + "identifier" + ] + } + } + } + } + } + }, + "\/account\/targets\/{targetId}\/push": { + "put": { + "summary": "Update push target", + "operationId": "accountUpdatePushTarget", + "tags": [ + "account" + ], + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePushTarget", + "group": "pushTargets", + "weight": 56, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "" + } + }, + "required": [ + "identifier" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete push target", + "operationId": "accountDeletePushTarget", + "tags": [ + "account" + ], + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deletePushTarget", + "group": "pushTargets", + "weight": 57, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/account\/tokens\/email": { + "post": { + "summary": "Create email token (OTP)", + "operationId": "accountCreateEmailToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createEmailToken", + "group": "tokens", + "weight": 26, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-email-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/magic-url": { + "post": { + "summary": "Create magic URL token", + "operationId": "accountCreateMagicURLToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createMagicURLToken", + "group": "tokens", + "weight": 25, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-magic-u-r-l-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the magic URL login. 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.", + "x-example": "https:\/\/example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 token", + "operationId": "accountCreateOAuth2Token", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their 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. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "301": { + "description": "File" + } + }, + "x-appwrite": { + "method": "createOAuth2Token", + "group": "tokens", + "weight": 24, + "cookies": false, + "type": "webAuth", + "deprecated": false, + "demo": "account\/create-o-auth2token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "schema": { + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's 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, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's 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, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/tokens\/phone": { + "post": { + "summary": "Create phone token", + "operationId": "accountCreatePhoneToken", + "tags": [ + "account" + ], + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createPhoneToken", + "group": "tokens", + "weight": 29, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-phone-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},phone:{param-phone}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + } + }, + "required": [ + "userId", + "phone" + ] + } + } + } + } + } + }, + "\/account\/verification": { + "post": { + "summary": "Create email verification", + "operationId": "accountCreateVerification", + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\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", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createVerification", + "group": "verification", + "weight": 41, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "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.", + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update email verification (confirmation)", + "operationId": "accountUpdateVerification", + "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.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "updateVerification", + "group": "verification", + "weight": 42, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/verification\/phone": { + "post": { + "summary": "Create phone verification", + "operationId": "accountCreatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createPhoneVerification", + "group": "verification", + "weight": 43, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},userId:{userId}", + "url:{url},ip:{ip}" + ], + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "put": { + "summary": "Update phone verification (confirmation)", + "operationId": "accountUpdatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "verification", + "weight": 44, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/avatars\/browsers\/{code}": { + "get": { + "summary": "Get browser icon", + "operationId": "avatarsGetBrowser", + "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 [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getBrowser", + "group": null, + "weight": 61, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Browser Code.", + "required": true, + "schema": { + "type": "string", + "x-example": "aa", + "enum": [ + "aa", + "an", + "ch", + "ci", + "cm", + "cr", + "ff", + "sf", + "mf", + "ps", + "oi", + "om", + "op", + "on" + ], + "x-enum-name": "Browser", + "x-enum-keys": [ + "Avant Browser", + "Android WebView Beta", + "Google Chrome", + "Google Chrome (iOS)", + "Google Chrome (Mobile)", + "Chromium", + "Mozilla Firefox", + "Safari", + "Mobile Safari", + "Microsoft Edge", + "Microsoft Edge (iOS)", + "Opera Mini", + "Opera", + "Opera (Next)" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "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, + "schema": { + "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 keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/credit-cards\/{code}": { + "get": { + "summary": "Get credit card icon", + "operationId": "avatarsGetCreditCard", + "tags": [ + "avatars" + ], + "description": "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getCreditCard", + "group": null, + "weight": 60, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "required": true, + "schema": { + "type": "string", + "x-example": "amex", + "enum": [ + "amex", + "argencard", + "cabal", + "cencosud", + "diners", + "discover", + "elo", + "hipercard", + "jcb", + "mastercard", + "naranja", + "targeta-shopping", + "union-china-pay", + "visa", + "mir", + "maestro", + "rupay" + ], + "x-enum-name": "CreditCard", + "x-enum-keys": [ + "American Express", + "Argencard", + "Cabal", + "Cencosud", + "Diners Club", + "Discover", + "Elo", + "Hipercard", + "JCB", + "Mastercard", + "Naranja", + "Tarjeta Shopping", + "Union China Pay", + "Visa", + "MIR", + "Maestro", + "Rupay" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "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, + "schema": { + "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 keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/favicon": { + "get": { + "summary": "Get favicon", + "operationId": "avatarsGetFavicon", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getFavicon", + "group": null, + "weight": 64, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Website URL which you want to fetch the favicon from.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/flags\/{code}": { + "get": { + "summary": "Get country flag", + "operationId": "avatarsGetFlag", + "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. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getFlag", + "group": null, + "weight": 62, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Country Code. ISO Alpha-2 country code format.", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ao", + "al", + "ad", + "ae", + "ar", + "am", + "ag", + "au", + "at", + "az", + "bi", + "be", + "bj", + "bf", + "bd", + "bg", + "bh", + "bs", + "ba", + "by", + "bz", + "bo", + "br", + "bb", + "bn", + "bt", + "bw", + "cf", + "ca", + "ch", + "cl", + "cn", + "ci", + "cm", + "cd", + "cg", + "co", + "km", + "cv", + "cr", + "cu", + "cy", + "cz", + "de", + "dj", + "dm", + "dk", + "do", + "dz", + "ec", + "eg", + "er", + "es", + "ee", + "et", + "fi", + "fj", + "fr", + "fm", + "ga", + "gb", + "ge", + "gh", + "gn", + "gm", + "gw", + "gq", + "gr", + "gd", + "gt", + "gy", + "hn", + "hr", + "ht", + "hu", + "id", + "in", + "ie", + "ir", + "iq", + "is", + "il", + "it", + "jm", + "jo", + "jp", + "kz", + "ke", + "kg", + "kh", + "ki", + "kn", + "kr", + "kw", + "la", + "lb", + "lr", + "ly", + "lc", + "li", + "lk", + "ls", + "lt", + "lu", + "lv", + "ma", + "mc", + "md", + "mg", + "mv", + "mx", + "mh", + "mk", + "ml", + "mt", + "mm", + "me", + "mn", + "mz", + "mr", + "mu", + "mw", + "my", + "na", + "ne", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nz", + "om", + "pk", + "pa", + "pe", + "ph", + "pw", + "pg", + "pl", + "pf", + "kp", + "pt", + "py", + "qa", + "ro", + "ru", + "rw", + "sa", + "sd", + "sn", + "sg", + "sb", + "sl", + "sv", + "sm", + "so", + "rs", + "ss", + "st", + "sr", + "sk", + "si", + "se", + "sz", + "sc", + "sy", + "td", + "tg", + "th", + "tj", + "tm", + "tl", + "to", + "tt", + "tn", + "tr", + "tv", + "tz", + "ug", + "ua", + "uy", + "us", + "uz", + "va", + "vc", + "ve", + "vn", + "vu", + "ws", + "ye", + "za", + "zm", + "zw" + ], + "x-enum-name": "Flag", + "x-enum-keys": [ + "Afghanistan", + "Angola", + "Albania", + "Andorra", + "United Arab Emirates", + "Argentina", + "Armenia", + "Antigua and Barbuda", + "Australia", + "Austria", + "Azerbaijan", + "Burundi", + "Belgium", + "Benin", + "Burkina Faso", + "Bangladesh", + "Bulgaria", + "Bahrain", + "Bahamas", + "Bosnia and Herzegovina", + "Belarus", + "Belize", + "Bolivia", + "Brazil", + "Barbados", + "Brunei Darussalam", + "Bhutan", + "Botswana", + "Central African Republic", + "Canada", + "Switzerland", + "Chile", + "China", + "C\u00f4te d'Ivoire", + "Cameroon", + "Democratic Republic of the Congo", + "Republic of the Congo", + "Colombia", + "Comoros", + "Cape Verde", + "Costa Rica", + "Cuba", + "Cyprus", + "Czech Republic", + "Germany", + "Djibouti", + "Dominica", + "Denmark", + "Dominican Republic", + "Algeria", + "Ecuador", + "Egypt", + "Eritrea", + "Spain", + "Estonia", + "Ethiopia", + "Finland", + "Fiji", + "France", + "Micronesia (Federated States of)", + "Gabon", + "United Kingdom", + "Georgia", + "Ghana", + "Guinea", + "Gambia", + "Guinea-Bissau", + "Equatorial Guinea", + "Greece", + "Grenada", + "Guatemala", + "Guyana", + "Honduras", + "Croatia", + "Haiti", + "Hungary", + "Indonesia", + "India", + "Ireland", + "Iran (Islamic Republic of)", + "Iraq", + "Iceland", + "Israel", + "Italy", + "Jamaica", + "Jordan", + "Japan", + "Kazakhstan", + "Kenya", + "Kyrgyzstan", + "Cambodia", + "Kiribati", + "Saint Kitts and Nevis", + "South Korea", + "Kuwait", + "Lao People's Democratic Republic", + "Lebanon", + "Liberia", + "Libya", + "Saint Lucia", + "Liechtenstein", + "Sri Lanka", + "Lesotho", + "Lithuania", + "Luxembourg", + "Latvia", + "Morocco", + "Monaco", + "Moldova", + "Madagascar", + "Maldives", + "Mexico", + "Marshall Islands", + "North Macedonia", + "Mali", + "Malta", + "Myanmar", + "Montenegro", + "Mongolia", + "Mozambique", + "Mauritania", + "Mauritius", + "Malawi", + "Malaysia", + "Namibia", + "Niger", + "Nigeria", + "Nicaragua", + "Netherlands", + "Norway", + "Nepal", + "Nauru", + "New Zealand", + "Oman", + "Pakistan", + "Panama", + "Peru", + "Philippines", + "Palau", + "Papua New Guinea", + "Poland", + "French Polynesia", + "North Korea", + "Portugal", + "Paraguay", + "Qatar", + "Romania", + "Russia", + "Rwanda", + "Saudi Arabia", + "Sudan", + "Senegal", + "Singapore", + "Solomon Islands", + "Sierra Leone", + "El Salvador", + "San Marino", + "Somalia", + "Serbia", + "South Sudan", + "Sao Tome and Principe", + "Suriname", + "Slovakia", + "Slovenia", + "Sweden", + "Eswatini", + "Seychelles", + "Syria", + "Chad", + "Togo", + "Thailand", + "Tajikistan", + "Turkmenistan", + "Timor-Leste", + "Tonga", + "Trinidad and Tobago", + "Tunisia", + "Turkey", + "Tuvalu", + "Tanzania", + "Uganda", + "Ukraine", + "Uruguay", + "United States", + "Uzbekistan", + "Vatican City", + "Saint Vincent and the Grenadines", + "Venezuela", + "Vietnam", + "Vanuatu", + "Samoa", + "Yemen", + "South Africa", + "Zambia", + "Zimbabwe" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "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, + "schema": { + "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 keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/image": { + "get": { + "summary": "Get image from URL", + "operationId": "avatarsGetImage", + "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getImage", + "group": null, + "weight": 63, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Image URL which you want to crop.", + "required": true, + "schema": { + "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. Defaults to 400.", + "required": false, + "schema": { + "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. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/initials": { + "get": { + "summary": "Get user initials", + "operationId": "avatarsGetInitials", + "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getInitials", + "group": null, + "weight": 66, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Full Name. When empty, current user name or email will be used. Max length: 128 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "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, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 500 + }, + "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, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/qr": { + "get": { + "summary": "Get QR code", + "operationId": "avatarsGetQR", + "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.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getQR", + "group": null, + "weight": 65, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "text", + "description": "Plain text to be converted to QR code image.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "query" + }, + { + "name": "size", + "description": "QR code size. Pass an integer between 1 to 1000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 400 + }, + "in": "query" + }, + { + "name": "margin", + "description": "Margin from edge. Pass an integer between 0 to 10. Defaults to 1.", + "required": false, + "schema": { + "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, + "schema": { + "type": "boolean", + "x-example": false, + "default": false + }, + "in": "query" + } + ] + } + }, + "\/console\/assistant": { + "post": { + "summary": "Create assistant query", + "operationId": "assistantChat", + "tags": [ + "assistant" + ], + "description": "Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite's AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream. ", + "responses": { + "200": { + "description": "File" + } + }, + "x-appwrite": { + "method": "chat", + "group": "console", + "weight": 310, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "assistant\/chat.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/assistant\/chat.md", + "rate-limit": 15, + "rate-time": 3600, + "rate-key": "userId:{userId}", + "scope": "assistant.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "description": "Prompt. A string containing questions asked to the AI assistant.", + "x-example": "" + } + }, + "required": [ + "prompt" + ] + } + } + } + } + } + }, + "\/console\/resources": { + "get": { + "summary": "Check resource ID availability", + "operationId": "consoleGetResource", + "tags": [ + "console" + ], + "description": "Check if a resource ID is available.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "getResource", + "group": null, + "weight": 434, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "console\/get-resource.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCheck if a resource ID is available.", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "value", + "description": "Resource value.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "query" + }, + { + "name": "type", + "description": "Resource type.", + "required": true, + "schema": { + "type": "string", + "x-example": "rules", + "enum": [ + "rules" + ], + "x-enum-name": "ConsoleResourceType", + "x-enum-keys": [] + }, + "in": "query" + } + ] + } + }, + "\/console\/variables": { + "get": { + "summary": "Get variables", + "operationId": "consoleVariables", + "tags": [ + "console" + ], + "description": "Get all Environment Variables that are relevant for the console.", + "responses": { + "200": { + "description": "Console Variables", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/consoleVariables" + } + } + } + } + }, + "x-appwrite": { + "method": "variables", + "group": "console", + "weight": 309, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "console\/variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/console\/variables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/databases": { + "get": { + "summary": "List databases", + "operationId": "databasesList", + "tags": [ + "databases" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "group": "databases", + "weight": 71, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "databasesCreate", + "tags": [ + "databases" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "x-appwrite": { + "method": "create", + "group": "databases", + "weight": 70, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/databases\/usage": { + "get": { + "summary": "Get databases usage stats", + "operationId": "databasesGetUsage", + "tags": [ + "databases" + ], + "description": "Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabases", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageDatabases" + } + } + } + } + }, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 121, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "`Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "DatabaseUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "databasesGet", + "tags": [ + "databases" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "databases", + "weight": 72, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "databasesUpdate", + "tags": [ + "databases" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "x-appwrite": { + "method": "update", + "group": "databases", + "weight": 74, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "databasesDelete", + "tags": [ + "databases" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "databases", + "weight": 75, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections": { + "get": { + "summary": "List collections", + "operationId": "databasesListCollections", + "tags": [ + "databases" + ], + "description": "Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Collections List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collectionList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCollections", + "group": "collections", + "weight": 77, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-collections.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create collection", + "operationId": "databasesCreateCollection", + "tags": [ + "databases" + ], + "description": "Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "x-appwrite": { + "method": "createCollection", + "group": "collections", + "weight": 76, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "collectionId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "x-example": "" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "collectionId", + "name" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}": { + "get": { + "summary": "Get collection", + "operationId": "databasesGetCollection", + "tags": [ + "databases" + ], + "description": "Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "x-appwrite": { + "method": "getCollection", + "group": "collections", + "weight": 78, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update collection", + "operationId": "databasesUpdateCollection", + "tags": [ + "databases" + ], + "description": "Update a collection by its unique ID.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "x-appwrite": { + "method": "updateCollection", + "group": "collections", + "weight": 80, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "x-example": "" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete collection", + "operationId": "databasesDeleteCollection", + "tags": [ + "databases" + ], + "description": "Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteCollection", + "group": "collections", + "weight": 81, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes": { + "get": { + "summary": "List attributes", + "operationId": "databasesListAttributes", + "tags": [ + "databases" + ], + "description": "List attributes in the collection.", + "responses": { + "200": { + "description": "Attributes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeList" + } + } + } + } + }, + "x-appwrite": { + "method": "listAttributes", + "group": "attributes", + "weight": 92, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-attributes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean": { + "post": { + "summary": "Create boolean attribute", + "operationId": "databasesCreateBooleanAttribute", + "tags": [ + "databases" + ], + "description": "Create a boolean attribute.\n", + "responses": { + "202": { + "description": "AttributeBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBoolean" + } + } + } + } + }, + "x-appwrite": { + "method": "createBooleanAttribute", + "group": "attributes", + "weight": 89, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean\/{key}": { + "patch": { + "summary": "Update boolean attribute", + "operationId": "databasesUpdateBooleanAttribute", + "tags": [ + "databases" + ], + "description": "Update a boolean attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBoolean" + } + } + } + } + }, + "x-appwrite": { + "method": "updateBooleanAttribute", + "group": "attributes", + "weight": 101, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime": { + "post": { + "summary": "Create datetime attribute", + "operationId": "databasesCreateDatetimeAttribute", + "tags": [ + "databases" + ], + "description": "Create a date time attribute according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "AttributeDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeDatetime" + } + } + } + } + }, + "x-appwrite": { + "method": "createDatetimeAttribute", + "group": "attributes", + "weight": 90, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime\/{key}": { + "patch": { + "summary": "Update dateTime attribute", + "operationId": "databasesUpdateDatetimeAttribute", + "tags": [ + "databases" + ], + "description": "Update a date time attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeDatetime" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDatetimeAttribute", + "group": "attributes", + "weight": 102, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email": { + "post": { + "summary": "Create email attribute", + "operationId": "databasesCreateEmailAttribute", + "tags": [ + "databases" + ], + "description": "Create an email attribute.\n", + "responses": { + "202": { + "description": "AttributeEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEmail" + } + } + } + } + }, + "x-appwrite": { + "method": "createEmailAttribute", + "group": "attributes", + "weight": 83, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email\/{key}": { + "patch": { + "summary": "Update email attribute", + "operationId": "databasesUpdateEmailAttribute", + "tags": [ + "databases" + ], + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEmail" + } + } + } + } + }, + "x-appwrite": { + "method": "updateEmailAttribute", + "group": "attributes", + "weight": 95, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum": { + "post": { + "summary": "Create enum attribute", + "operationId": "databasesCreateEnumAttribute", + "tags": [ + "databases" + ], + "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", + "responses": { + "202": { + "description": "AttributeEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEnum" + } + } + } + } + }, + "x-appwrite": { + "method": "createEnumAttribute", + "group": "attributes", + "weight": 84, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum\/{key}": { + "patch": { + "summary": "Update enum attribute", + "operationId": "databasesUpdateEnumAttribute", + "tags": [ + "databases" + ], + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEnum" + } + } + } + } + }, + "x-appwrite": { + "method": "updateEnumAttribute", + "group": "attributes", + "weight": 96, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float": { + "post": { + "summary": "Create float attribute", + "operationId": "databasesCreateFloatAttribute", + "tags": [ + "databases" + ], + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeFloat" + } + } + } + } + }, + "x-appwrite": { + "method": "createFloatAttribute", + "group": "attributes", + "weight": 88, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value to enforce on new documents", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value to enforce on new documents", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float\/{key}": { + "patch": { + "summary": "Update float attribute", + "operationId": "databasesUpdateFloatAttribute", + "tags": [ + "databases" + ], + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeFloat" + } + } + } + } + }, + "x-appwrite": { + "method": "updateFloatAttribute", + "group": "attributes", + "weight": 100, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value to enforce on new documents", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value to enforce on new documents", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer": { + "post": { + "summary": "Create integer attribute", + "operationId": "databasesCreateIntegerAttribute", + "tags": [ + "databases" + ], + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeInteger" + } + } + } + } + }, + "x-appwrite": { + "method": "createIntegerAttribute", + "group": "attributes", + "weight": 87, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce on new documents", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce on new documents", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer\/{key}": { + "patch": { + "summary": "Update integer attribute", + "operationId": "databasesUpdateIntegerAttribute", + "tags": [ + "databases" + ], + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeInteger" + } + } + } + } + }, + "x-appwrite": { + "method": "updateIntegerAttribute", + "group": "attributes", + "weight": 99, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce on new documents", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce on new documents", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip": { + "post": { + "summary": "Create IP address attribute", + "operationId": "databasesCreateIpAttribute", + "tags": [ + "databases" + ], + "description": "Create IP address attribute.\n", + "responses": { + "202": { + "description": "AttributeIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeIp" + } + } + } + } + }, + "x-appwrite": { + "method": "createIpAttribute", + "group": "attributes", + "weight": 85, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "patch": { + "summary": "Update IP address attribute", + "operationId": "databasesUpdateIpAttribute", + "tags": [ + "databases" + ], + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeIp" + } + } + } + } + }, + "x-appwrite": { + "method": "updateIpAttribute", + "group": "attributes", + "weight": 97, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { + "post": { + "summary": "Create relationship attribute", + "operationId": "databasesCreateRelationshipAttribute", + "tags": [ + "databases" + ], + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "202": { + "description": "AttributeRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeRelationship" + } + } + } + } + }, + "x-appwrite": { + "method": "createRelationshipAttribute", + "group": "attributes", + "weight": 91, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "relatedCollectionId": { + "type": "string", + "description": "Related Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "x-example": "" + }, + "type": { + "type": "string", + "description": "Relation type", + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "x-example": false + }, + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Attribute Key.", + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedCollectionId", + "type" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string": { + "post": { + "summary": "Create string attribute", + "operationId": "databasesCreateStringAttribute", + "tags": [ + "databases" + ], + "description": "Create a string attribute.\n", + "responses": { + "202": { + "description": "AttributeString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeString" + } + } + } + } + }, + "x-appwrite": { + "method": "createStringAttribute", + "group": "attributes", + "weight": 82, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "size": { + "type": "integer", + "description": "Attribute size for text attributes, in number of characters.", + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string\/{key}": { + "patch": { + "summary": "Update string attribute", + "operationId": "databasesUpdateStringAttribute", + "tags": [ + "databases" + ], + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeString" + } + } + } + } + }, + "x-appwrite": { + "method": "updateStringAttribute", + "group": "attributes", + "weight": 94, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string attribute.", + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url": { + "post": { + "summary": "Create URL attribute", + "operationId": "databasesCreateUrlAttribute", + "tags": [ + "databases" + ], + "description": "Create a URL attribute.\n", + "responses": { + "202": { + "description": "AttributeURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeUrl" + } + } + } + } + }, + "x-appwrite": { + "method": "createUrlAttribute", + "group": "attributes", + "weight": 86, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url\/{key}": { + "patch": { + "summary": "Update URL attribute", + "operationId": "databasesUpdateUrlAttribute", + "tags": [ + "databases" + ], + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeUrl" + } + } + } + } + }, + "x-appwrite": { + "method": "updateUrlAttribute", + "group": "attributes", + "weight": 98, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}": { + "get": { + "summary": "Get attribute", + "operationId": "databasesGetAttribute", + "tags": [ + "databases" + ], + "description": "Get attribute by ID.", + "responses": { + "200": { + "description": "AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeDatetime, or AttributeRelationship, or AttributeString", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ] + } + } + } + } + }, + "x-appwrite": { + "method": "getAttribute", + "group": "attributes", + "weight": 93, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete attribute", + "operationId": "databasesDeleteAttribute", + "tags": [ + "databases" + ], + "description": "Deletes an attribute.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteAttribute", + "group": "attributes", + "weight": 104, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}\/relationship": { + "patch": { + "summary": "Update relationship attribute", + "operationId": "databasesUpdateRelationshipAttribute", + "tags": [ + "databases" + ], + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "200": { + "description": "AttributeRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeRelationship" + } + } + } + } + }, + "x-appwrite": { + "method": "updateRelationshipAttribute", + "group": "attributes", + "weight": 103, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "databasesListDocuments", + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "listDocuments", + "group": "documents", + "weight": 110, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "tags": [ + "databases" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "createDocument", + "group": "documents", + "weight": 109, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createDocument", + "auth": { + "Admin": [], + "Session": [], + "Key": [], + "JWT": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + }, + { + "name": "createDocuments", + "auth": { + "Admin": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + } + } + }, + "put": { + "summary": "Create or update documents", + "operationId": "databasesUpsertDocuments", + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 118, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documents": { + "type": "array", + "description": "Array of document data as JSON objects. May contain partial documents.", + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "documents" + ] + } + } + } + } + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDocuments", + "group": "documents", + "weight": 117, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "deleteDocuments", + "group": "documents", + "weight": 120, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "databasesGetDocument", + "tags": [ + "databases" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "getDocument", + "group": "documents", + "weight": 111, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert document", + "operationId": "databasesUpsertDocument", + "tags": [ + "databases" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "upsertDocument", + "group": "documents", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include all required attributes of the document to be created or updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "patch": { + "summary": "Update document", + "operationId": "databasesUpdateDocument", + "tags": [ + "databases" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDocument", + "group": "documents", + "weight": 113, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete document", + "operationId": "databasesDeleteDocument", + "tags": [ + "databases" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDocument", + "group": "documents", + "weight": 119, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/logs": { + "get": { + "summary": "List document logs", + "operationId": "databasesListDocumentLogs", + "tags": [ + "databases" + ], + "description": "Get the document activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listDocumentLogs", + "group": "logs", + "weight": 112, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-document-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "databasesListIndexes", + "tags": [ + "databases" + ], + "description": "List indexes in the collection.", + "responses": { + "200": { + "description": "Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/indexList" + } + } + } + } + }, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 106, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "databasesCreateIndex", + "tags": [ + "databases" + ], + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "x-appwrite": { + "method": "createIndex", + "group": "collections", + "weight": 105, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "attributes": { + "type": "array", + "description": "Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "attributes" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "databasesGetIndex", + "tags": [ + "databases" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 107, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "databasesDeleteIndex", + "tags": [ + "databases" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/logs": { + "get": { + "summary": "List collection logs", + "operationId": "databasesListCollectionLogs", + "tags": [ + "databases" + ], + "description": "Get the collection activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCollectionLogs", + "group": "collections", + "weight": 79, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-collection-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/usage": { + "get": { + "summary": "Get collection usage stats", + "operationId": "databasesGetCollectionUsage", + "tags": [ + "databases" + ], + "description": "Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageCollection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageCollection" + } + } + } + } + }, + "x-appwrite": { + "method": "getCollectionUsage", + "group": null, + "weight": 123, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-collection-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "DatabaseUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/logs": { + "get": { + "summary": "List database logs", + "operationId": "databasesListLogs", + "tags": [ + "databases" + ], + "description": "Get the database activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 73, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/usage": { + "get": { + "summary": "Get database usage stats", + "operationId": "databasesGetDatabaseUsage", + "tags": [ + "databases" + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabase", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageDatabase" + } + } + } + } + }, + "x-appwrite": { + "method": "getDatabaseUsage", + "group": null, + "weight": 122, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-database-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "range", + "description": "`Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "DatabaseUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/functions": { + "get": { + "summary": "List functions", + "operationId": "functionsList", + "tags": [ + "functions" + ], + "description": "Get a list of all the project's functions. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Functions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/functionList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "group": "functions", + "weight": 378, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's functions. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create function", + "operationId": "functionsCreate", + "tags": [ + "functions" + ], + "description": "Create a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "responses": { + "201": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "x-appwrite": { + "method": "create", + "group": "functions", + "weight": 375, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "functionId": { + "type": "string", + "description": "Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "x-example": "" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Function maximum execution time in seconds.", + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "x-example": "" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "x-example": "" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "x-example": "" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function.", + "x-example": "" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function.", + "x-example": "" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "x-example": "" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "x-example": null + } + }, + "required": [ + "functionId", + "name", + "runtime" + ] + } + } + } + } + } + }, + "\/functions\/runtimes": { + "get": { + "summary": "List runtimes", + "operationId": "functionsListRuntimes", + "tags": [ + "functions" + ], + "description": "Get a list of all runtimes that are currently active on your instance.", + "responses": { + "200": { + "description": "Runtimes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/runtimeList" + } + } + } + } + }, + "x-appwrite": { + "method": "listRuntimes", + "group": "runtimes", + "weight": 380, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-runtimes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all runtimes that are currently active on your instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "functionsListSpecifications", + "tags": [ + "functions" + ], + "description": "List allowed function specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/specificationList" + } + } + } + } + }, + "x-appwrite": { + "method": "listSpecifications", + "group": "runtimes", + "weight": 381, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed function specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/templates": { + "get": { + "summary": "List templates", + "operationId": "functionsListTemplates", + "tags": [ + "functions" + ], + "description": "List available function templates. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "responses": { + "200": { + "description": "Function Templates List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/templateFunctionList" + } + } + } + } + }, + "x-appwrite": { + "method": "listTemplates", + "group": "templates", + "weight": 404, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-templates.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList available function templates. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "runtimes", + "description": "List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "useCases", + "description": "List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "limit", + "description": "Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 25 + }, + "in": "query" + }, + { + "name": "offset", + "description": "Offset the list of returned templates. Maximum offset is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + } + ] + } + }, + "\/functions\/templates\/{templateId}": { + "get": { + "summary": "Get function template", + "operationId": "functionsGetTemplate", + "tags": [ + "functions" + ], + "description": "Get a function template using ID. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "responses": { + "200": { + "description": "Template Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/templateFunction" + } + } + } + } + }, + "x-appwrite": { + "method": "getTemplate", + "group": "templates", + "weight": 403, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function template using ID. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "templateId", + "description": "Template ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/functions\/usage": { + "get": { + "summary": "Get functions usage", + "operationId": "functionsListUsage", + "tags": [ + "functions" + ], + "description": "Get usage metrics and statistics for all functions in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageFunctions", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageFunctions" + } + } + } + } + }, + "x-appwrite": { + "method": "listUsage", + "group": null, + "weight": 397, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for all functions in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "FunctionUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}": { + "get": { + "summary": "Get function", + "operationId": "functionsGet", + "tags": [ + "functions" + ], + "description": "Get a function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "functions", + "weight": 376, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update function", + "operationId": "functionsUpdate", + "tags": [ + "functions" + ], + "description": "Update function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "x-appwrite": { + "method": "update", + "group": "functions", + "weight": 377, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "x-example": "" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Maximum execution time in seconds.", + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "x-example": "" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "x-example": "" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Controle System) deployment.", + "x-example": "" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function", + "x-example": "", + "x-nullable": true + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function", + "x-example": "" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "x-example": "" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "x-example": null + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete function", + "operationId": "functionsDelete", + "tags": [ + "functions" + ], + "description": "Delete a function by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "functions", + "weight": 379, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployment": { + "patch": { + "summary": "Update function's deployment", + "operationId": "functionsUpdateFunctionDeployment", + "tags": [ + "functions" + ], + "description": "Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "x-appwrite": { + "method": "updateFunctionDeployment", + "group": "functions", + "weight": 384, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update-function-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "functionsListDeployments", + "tags": [ + "functions" + ], + "description": "Get a list of all the function's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deploymentList" + } + } + } + } + }, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 385, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the function's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "functionsCreateDeployment", + "tags": [ + "functions" + ], + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 382, + "cookies": false, + "type": "upload", + "deprecated": false, + "demo": "functions\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "entrypoint": { + "type": "string", + "description": "Entrypoint File.", + "x-example": "" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "x-example": "" + }, + "code": { + "type": "string", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "x-example": null + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "code", + "activate" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "functionsCreateDuplicateDeployment", + "tags": [ + "functions" + ], + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 390, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "" + }, + "buildId": { + "type": "string", + "description": "Build unique ID.", + "x-example": "" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "functionsCreateTemplateDeployment", + "tags": [ + "functions" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 387, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "x-example": "" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "x-example": "" + }, + "rootDirectory": { + "type": "string", + "description": "Path to function code in the template repo.", + "x-example": "" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the function template.", + "x-example": "" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "functionsCreateVcsDeployment", + "tags": [ + "functions" + ], + "description": "Create a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 388, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "x-example": "branch", + "enum": [ + "branch", + "commit" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "x-example": "" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "functionsGetDeployment", + "tags": [ + "functions" + ], + "description": "Get a function deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 383, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "functionsDeleteDeployment", + "tags": [ + "functions" + ], + "description": "Delete a code deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 386, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a code deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "functionsGetDeploymentDownload", + "tags": [ + "functions" + ], + "description": "Get a function deployment 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.", + "responses": { + "200": { + "description": "File" + } + }, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 389, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "functions\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment 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.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "schema": { + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source" + }, + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "functionsUpdateDeploymentStatus", + "tags": [ + "functions" + ], + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 391, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/executions": { + "get": { + "summary": "List executions", + "operationId": "functionsListExecutions", + "tags": [ + "functions" + ], + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "x-appwrite": { + "method": "listExecutions", + "group": "executions", + "weight": 394, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-executions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create execution", + "operationId": "functionsCreateExecution", + "tags": [ + "functions" + ], + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "responses": { + "201": { + "description": "Execution", + "content": { + "multipart\/form-data": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "x-appwrite": { + "method": "createExecution", + "group": "executions", + "weight": 392, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "x-example": "" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "x-example": "" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is GET.", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "string", + "description": "HTTP headers of execution. Defaults to empty.", + "x-example": null + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/functions\/{functionId}\/executions\/{executionId}": { + "get": { + "summary": "Get execution", + "operationId": "functionsGetExecution", + "tags": [ + "functions" + ], + "description": "Get a function execution log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "x-appwrite": { + "method": "getExecution", + "group": "executions", + "weight": 393, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete execution", + "operationId": "functionsDeleteExecution", + "tags": [ + "functions" + ], + "description": "Delete a function execution by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteExecution", + "group": "executions", + "weight": 395, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function execution by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/usage": { + "get": { + "summary": "Get function usage", + "operationId": "functionsGetUsage", + "tags": [ + "functions" + ], + "description": "Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageFunction", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageFunction" + } + } + } + } + }, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 396, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "FunctionUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "functionsListVariables", + "tags": [ + "functions" + ], + "description": "Get a list of all variables of a specific function.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 400, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "functionsCreateVariable", + "tags": [ + "functions" + ], + "description": "Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 398, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "functionsGetVariable", + "tags": [ + "functions" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 399, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "functionsUpdateVariable", + "tags": [ + "functions" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 401, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete variable", + "operationId": "functionsDeleteVariable", + "tags": [ + "functions" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 402, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ] + } + }, + "\/graphql": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlQuery", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "x-appwrite": { + "method": "query", + "group": "graphql", + "weight": 308, + "cookies": false, + "type": "graphql", + "deprecated": false, + "demo": "graphql\/query.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/graphql\/mutation": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlMutation", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "x-appwrite": { + "method": "mutation", + "group": "graphql", + "weight": 307, + "cookies": false, + "type": "graphql", + "deprecated": false, + "demo": "graphql\/mutation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/health": { + "get": { + "summary": "Get HTTP", + "operationId": "healthGet", + "tags": [ + "health" + ], + "description": "Check the Appwrite HTTP server is up and responsive.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "health", + "weight": 132, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/anti-virus": { + "get": { + "summary": "Get antivirus", + "operationId": "healthGetAntivirus", + "tags": [ + "health" + ], + "description": "Check the Appwrite Antivirus server is up and connection is successful.", + "responses": { + "200": { + "description": "Health Antivirus", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthAntivirus" + } + } + } + } + }, + "x-appwrite": { + "method": "getAntivirus", + "group": "health", + "weight": 153, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-antivirus.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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/cache": { + "get": { + "summary": "Get cache", + "operationId": "healthGetCache", + "tags": [ + "health" + ], + "description": "Check the Appwrite in-memory cache servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "x-appwrite": { + "method": "getCache", + "group": "health", + "weight": 135, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/certificate": { + "get": { + "summary": "Get the SSL certificate for a domain", + "operationId": "healthGetCertificate", + "tags": [ + "health" + ], + "description": "Get the SSL certificate for a domain", + "responses": { + "200": { + "description": "Health Certificate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthCertificate" + } + } + } + } + }, + "x-appwrite": { + "method": "getCertificate", + "group": "health", + "weight": 140, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-certificate.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-certificate.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "domain", + "description": "string", + "required": false, + "schema": { + "type": "string" + }, + "in": "query" + } + ] + } + }, + "\/health\/db": { + "get": { + "summary": "Get DB", + "operationId": "healthGetDB", + "tags": [ + "health" + ], + "description": "Check the Appwrite database servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "x-appwrite": { + "method": "getDB", + "group": "health", + "weight": 134, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/pubsub": { + "get": { + "summary": "Get pubsub", + "operationId": "healthGetPubSub", + "tags": [ + "health" + ], + "description": "Check the Appwrite pub-sub servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "x-appwrite": { + "method": "getPubSub", + "group": "health", + "weight": 136, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-pub-sub.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-pubsub.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/queue\/builds": { + "get": { + "summary": "Get builds queue", + "operationId": "healthGetQueueBuilds", + "tags": [ + "health" + ], + "description": "Get the number of builds that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueBuilds", + "group": "queue", + "weight": 142, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-builds.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-builds.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/certificates": { + "get": { + "summary": "Get certificates queue", + "operationId": "healthGetQueueCertificates", + "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.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueCertificates", + "group": "queue", + "weight": 141, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/databases": { + "get": { + "summary": "Get databases queue", + "operationId": "healthGetQueueDatabases", + "tags": [ + "health" + ], + "description": "Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueDatabases", + "group": "queue", + "weight": 143, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-databases.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-databases.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Queue name for which to check the queue size", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "database_db_main" + }, + "in": "query" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/deletes": { + "get": { + "summary": "Get deletes queue", + "operationId": "healthGetQueueDeletes", + "tags": [ + "health" + ], + "description": "Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueDeletes", + "group": "queue", + "weight": 144, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-deletes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-deletes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/failed\/{name}": { + "get": { + "summary": "Get number of failed queue jobs", + "operationId": "healthGetFailedJobs", + "tags": [ + "health" + ], + "description": "Returns the amount of failed jobs in a given queue.\n", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getFailedJobs", + "group": "queue", + "weight": 154, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-failed-jobs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-failed-queue-jobs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "The name of the queue", + "required": true, + "schema": { + "type": "string", + "x-example": "v1-database", + "enum": [ + "v1-database", + "v1-deletes", + "v1-audits", + "v1-mails", + "v1-functions", + "v1-stats-resources", + "v1-stats-usage", + "v1-webhooks", + "v1-certificates", + "v1-builds", + "v1-messaging", + "v1-migrations" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/functions": { + "get": { + "summary": "Get functions queue", + "operationId": "healthGetQueueFunctions", + "tags": [ + "health" + ], + "description": "Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueFunctions", + "group": "queue", + "weight": 148, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/logs": { + "get": { + "summary": "Get logs queue", + "operationId": "healthGetQueueLogs", + "tags": [ + "health" + ], + "description": "Get the number of logs that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueLogs", + "group": "queue", + "weight": 139, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/mails": { + "get": { + "summary": "Get mails queue", + "operationId": "healthGetQueueMails", + "tags": [ + "health" + ], + "description": "Get the number of mails that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueMails", + "group": "queue", + "weight": 145, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-mails.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-mails.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/messaging": { + "get": { + "summary": "Get messaging queue", + "operationId": "healthGetQueueMessaging", + "tags": [ + "health" + ], + "description": "Get the number of messages that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueMessaging", + "group": "queue", + "weight": 146, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-messaging.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-messaging.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/migrations": { + "get": { + "summary": "Get migrations queue", + "operationId": "healthGetQueueMigrations", + "tags": [ + "health" + ], + "description": "Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueMigrations", + "group": "queue", + "weight": 147, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-migrations.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-migrations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-resources": { + "get": { + "summary": "Get stats resources queue", + "operationId": "healthGetQueueStatsResources", + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueStatsResources", + "group": "queue", + "weight": 149, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-stats-resources.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-usage": { + "get": { + "summary": "Get stats usage queue", + "operationId": "healthGetQueueUsage", + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueUsage", + "group": "queue", + "weight": 150, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/webhooks": { + "get": { + "summary": "Get webhooks queue", + "operationId": "healthGetQueueWebhooks", + "tags": [ + "health" + ], + "description": "Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueWebhooks", + "group": "queue", + "weight": 138, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/storage": { + "get": { + "summary": "Get storage", + "operationId": "healthGetStorage", + "tags": [ + "health" + ], + "description": "Check the Appwrite storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "x-appwrite": { + "method": "getStorage", + "group": "storage", + "weight": 152, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-storage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/storage\/local": { + "get": { + "summary": "Get local storage", + "operationId": "healthGetStorageLocal", + "tags": [ + "health" + ], + "description": "Check the Appwrite local storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "x-appwrite": { + "method": "getStorageLocal", + "group": "storage", + "weight": 151, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/time": { + "get": { + "summary": "Get time", + "operationId": "healthGetTime", + "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.", + "responses": { + "200": { + "description": "Health Time", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthTime" + } + } + } + } + }, + "x-appwrite": { + "method": "getTime", + "group": "health", + "weight": 137, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/locale": { + "get": { + "summary": "Get user locale", + "operationId": "localeGet", + "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))", + "responses": { + "200": { + "description": "Locale", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/locale" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 124, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/codes": { + "get": { + "summary": "List locale codes", + "operationId": "localeListCodes", + "tags": [ + "locale" + ], + "description": "List of all locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes).", + "responses": { + "200": { + "description": "Locale codes list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/localeCodeList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCodes", + "group": null, + "weight": 125, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/continents": { + "get": { + "summary": "List continents", + "operationId": "localeListContinents", + "tags": [ + "locale" + ], + "description": "List of all continents. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Continents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/continentList" + } + } + } + } + }, + "x-appwrite": { + "method": "listContinents", + "group": null, + "weight": 129, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-continents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries": { + "get": { + "summary": "List countries", + "operationId": "localeListCountries", + "tags": [ + "locale" + ], + "description": "List of all countries. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCountries", + "group": null, + "weight": 126, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/eu": { + "get": { + "summary": "List EU countries", + "operationId": "localeListCountriesEU", + "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.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCountriesEU", + "group": null, + "weight": 127, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries-e-u.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/phones": { + "get": { + "summary": "List countries phone codes", + "operationId": "localeListCountriesPhones", + "tags": [ + "locale" + ], + "description": "List of all countries phone codes. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Phones List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/phoneList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCountriesPhones", + "group": null, + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries-phones.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/currencies": { + "get": { + "summary": "List currencies", + "operationId": "localeListCurrencies", + "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.", + "responses": { + "200": { + "description": "Currencies List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/currencyList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCurrencies", + "group": null, + "weight": 130, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-currencies.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/languages": { + "get": { + "summary": "List languages", + "operationId": "localeListLanguages", + "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.", + "responses": { + "200": { + "description": "Languages List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/languageList" + } + } + } + } + }, + "x-appwrite": { + "method": "listLanguages", + "group": null, + "weight": 131, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-languages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/messages": { + "get": { + "summary": "List messages", + "operationId": "messagingListMessages", + "tags": [ + "messaging" + ], + "description": "Get a list of all messages from the current Appwrite project.", + "responses": { + "200": { + "description": "Message list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/messageList" + } + } + } + } + }, + "x-appwrite": { + "method": "listMessages", + "group": "messages", + "weight": 362, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-messages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-messages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/email": { + "post": { + "summary": "Create email", + "operationId": "messagingCreateEmail", + "tags": [ + "messaging" + ], + "description": "Create a new email message.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "createEmail", + "group": "messages", + "weight": 359, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "x-example": "" + }, + "content": { + "type": "string", + "description": "Email Content.", + "x-example": "" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as :.", + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + } + }, + "required": [ + "messageId", + "subject", + "content" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/email\/{messageId}": { + "patch": { + "summary": "Update email", + "operationId": "messagingUpdateEmail", + "tags": [ + "messaging" + ], + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "updateEmail", + "group": "messages", + "weight": 366, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "x-example": "" + }, + "content": { + "type": "string", + "description": "Email Content.", + "x-example": "" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "x-example": false + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as :.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/push": { + "post": { + "summary": "Create push notification", + "operationId": "messagingCreatePush", + "tags": [ + "messaging" + ], + "description": "Create a new push notification.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "createPush", + "group": "messages", + "weight": 361, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "" + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "x-example": "" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "x-example": "<BODY>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "data": { + "type": "object", + "description": "Additional key-value pair data for push notification.", + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web Platform.", + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS Platform.", + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android Platform.", + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android Platform.", + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + }, + "required": [ + "messageId" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/push\/{messageId}": { + "patch": { + "summary": "Update push notification", + "operationId": "messagingUpdatePush", + "tags": [ + "messaging" + ], + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePush", + "group": "messages", + "weight": 368, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "x-example": "<TITLE>" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "x-example": "<BODY>" + }, + "data": { + "type": "object", + "description": "Additional Data for push notification.", + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web platforms.", + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS platforms.", + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android platforms.", + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android platforms.", + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS platforms.", + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/sms": { + "post": { + "summary": "Create SMS", + "operationId": "messagingCreateSms", + "tags": [ + "messaging" + ], + "description": "Create a new SMS message.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "createSms", + "group": "messages", + "weight": 360, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<MESSAGE_ID>" + }, + "content": { + "type": "string", + "description": "SMS Content.", + "x-example": "<CONTENT>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + } + }, + "required": [ + "messageId", + "content" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/sms\/{messageId}": { + "patch": { + "summary": "Update SMS", + "operationId": "messagingUpdateSms", + "tags": [ + "messaging" + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSms", + "group": "messages", + "weight": 367, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "content": { + "type": "string", + "description": "Email Content.", + "x-example": "<CONTENT>" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/{messageId}": { + "get": { + "summary": "Get message", + "operationId": "messagingGetMessage", + "tags": [ + "messaging" + ], + "description": "Get a message by its unique ID.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "getMessage", + "group": "messages", + "weight": 365, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-message.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete message", + "operationId": "messagingDelete", + "tags": [ + "messaging" + ], + "description": "Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "messages", + "weight": 369, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/logs": { + "get": { + "summary": "List message logs", + "operationId": "messagingListMessageLogs", + "tags": [ + "messaging" + ], + "description": "Get the message activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listMessageLogs", + "group": "logs", + "weight": 363, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-message-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/targets": { + "get": { + "summary": "List message targets", + "operationId": "messagingListTargets", + "tags": [ + "messaging" + ], + "description": "Get a list of the targets associated with a message.", + "responses": { + "200": { + "description": "Target list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/targetList" + } + } + } + } + }, + "x-appwrite": { + "method": "listTargets", + "group": "messages", + "weight": 364, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/providers": { + "get": { + "summary": "List providers", + "operationId": "messagingListProviders", + "tags": [ + "messaging" + ], + "description": "Get a list of all providers from the current Appwrite project.", + "responses": { + "200": { + "description": "Provider list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/providerList" + } + } + } + } + }, + "x-appwrite": { + "method": "listProviders", + "group": "providers", + "weight": 334, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-providers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-providers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/messaging\/providers\/apns": { + "post": { + "summary": "Create APNS provider", + "operationId": "messagingCreateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Apple Push Notification service provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createApnsProvider", + "group": "providers", + "weight": 333, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/apns\/{providerId}": { + "patch": { + "summary": "Update APNS provider", + "operationId": "messagingUpdateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateApnsProvider", + "group": "providers", + "weight": 346, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "x-example": false + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/fcm": { + "post": { + "summary": "Create FCM provider", + "operationId": "messagingCreateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createFcmProvider", + "group": "providers", + "weight": 332, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "x-example": "{}" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/fcm\/{providerId}": { + "patch": { + "summary": "Update FCM provider", + "operationId": "messagingUpdateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateFcmProvider", + "group": "providers", + "weight": 345, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "x-example": "{}" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/mailgun": { + "post": { + "summary": "Create Mailgun provider", + "operationId": "messagingCreateMailgunProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Mailgun provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createMailgunProvider", + "group": "providers", + "weight": 324, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/mailgun\/{providerId}": { + "patch": { + "summary": "Update Mailgun provider", + "operationId": "messagingUpdateMailgunProvider", + "tags": [ + "messaging" + ], + "description": "Update a Mailgun provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMailgunProvider", + "group": "providers", + "weight": 337, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/msg91": { + "post": { + "summary": "Create Msg91 provider", + "operationId": "messagingCreateMsg91Provider", + "tags": [ + "messaging" + ], + "description": "Create a new MSG91 provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createMsg91Provider", + "group": "providers", + "weight": 327, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-msg91provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "x-example": "<AUTH_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/msg91\/{providerId}": { + "patch": { + "summary": "Update Msg91 provider", + "operationId": "messagingUpdateMsg91Provider", + "tags": [ + "messaging" + ], + "description": "Update a MSG91 provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMsg91Provider", + "group": "providers", + "weight": 340, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-msg91provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID.", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "x-example": "<AUTH_KEY>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/sendgrid": { + "post": { + "summary": "Create Sendgrid provider", + "operationId": "messagingCreateSendgridProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Sendgrid provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createSendgridProvider", + "group": "providers", + "weight": 325, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/sendgrid\/{providerId}": { + "patch": { + "summary": "Update Sendgrid provider", + "operationId": "messagingUpdateSendgridProvider", + "tags": [ + "messaging" + ], + "description": "Update a Sendgrid provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSendgridProvider", + "group": "providers", + "weight": 338, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/smtp": { + "post": { + "summary": "Create SMTP provider", + "operationId": "messagingCreateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Create a new SMTP provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createSmtpProvider", + "group": "providers", + "weight": 326, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "The default SMTP server port.", + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be omitted, 'ssl', or 'tls'", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name", + "host" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/smtp\/{providerId}": { + "patch": { + "summary": "Update SMTP provider", + "operationId": "messagingUpdateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Update a SMTP provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSmtpProvider", + "group": "providers", + "weight": 339, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "SMTP port.", + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be 'ssl' or 'tls'", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "x-example": "<REPLY_TO_EMAIL>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/telesign": { + "post": { + "summary": "Create Telesign provider", + "operationId": "messagingCreateTelesignProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Telesign provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createTelesignProvider", + "group": "providers", + "weight": 328, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/telesign\/{providerId}": { + "patch": { + "summary": "Update Telesign provider", + "operationId": "messagingUpdateTelesignProvider", + "tags": [ + "messaging" + ], + "description": "Update a Telesign provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateTelesignProvider", + "group": "providers", + "weight": 341, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/textmagic": { + "post": { + "summary": "Create Textmagic provider", + "operationId": "messagingCreateTextmagicProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Textmagic provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createTextmagicProvider", + "group": "providers", + "weight": 329, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/textmagic\/{providerId}": { + "patch": { + "summary": "Update Textmagic provider", + "operationId": "messagingUpdateTextmagicProvider", + "tags": [ + "messaging" + ], + "description": "Update a Textmagic provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateTextmagicProvider", + "group": "providers", + "weight": 342, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/twilio": { + "post": { + "summary": "Create Twilio provider", + "operationId": "messagingCreateTwilioProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Twilio provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createTwilioProvider", + "group": "providers", + "weight": 330, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "x-example": "<AUTH_TOKEN>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/twilio\/{providerId}": { + "patch": { + "summary": "Update Twilio provider", + "operationId": "messagingUpdateTwilioProvider", + "tags": [ + "messaging" + ], + "description": "Update a Twilio provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateTwilioProvider", + "group": "providers", + "weight": 343, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "x-example": "<AUTH_TOKEN>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/vonage": { + "post": { + "summary": "Create Vonage provider", + "operationId": "messagingCreateVonageProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Vonage provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createVonageProvider", + "group": "providers", + "weight": 331, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "x-example": "<API_SECRET>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/vonage\/{providerId}": { + "patch": { + "summary": "Update Vonage provider", + "operationId": "messagingUpdateVonageProvider", + "tags": [ + "messaging" + ], + "description": "Update a Vonage provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateVonageProvider", + "group": "providers", + "weight": 344, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "x-example": "<API_SECRET>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/{providerId}": { + "get": { + "summary": "Get provider", + "operationId": "messagingGetProvider", + "tags": [ + "messaging" + ], + "description": "Get a provider by its unique ID.\n", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "getProvider", + "group": "providers", + "weight": 336, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete provider", + "operationId": "messagingDeleteProvider", + "tags": [ + "messaging" + ], + "description": "Delete a provider by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteProvider", + "group": "providers", + "weight": 347, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/providers\/{providerId}\/logs": { + "get": { + "summary": "List provider logs", + "operationId": "messagingListProviderLogs", + "tags": [ + "messaging" + ], + "description": "Get the provider activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listProviderLogs", + "group": "providers", + "weight": 335, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-provider-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-provider-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/subscribers\/{subscriberId}\/logs": { + "get": { + "summary": "List subscriber logs", + "operationId": "messagingListSubscriberLogs", + "tags": [ + "messaging" + ], + "description": "Get the subscriber activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listSubscriberLogs", + "group": "subscribers", + "weight": 356, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-subscriber-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscriber-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SUBSCRIBER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/topics": { + "get": { + "summary": "List topics", + "operationId": "messagingListTopics", + "tags": [ + "messaging" + ], + "description": "Get a list of all topics from the current Appwrite project.", + "responses": { + "200": { + "description": "Topic list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topicList" + } + } + } + } + }, + "x-appwrite": { + "method": "listTopics", + "group": "topics", + "weight": 349, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-topics.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topics.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create topic", + "operationId": "messagingCreateTopic", + "tags": [ + "messaging" + ], + "description": "Create a new topic.", + "responses": { + "201": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "x-appwrite": { + "method": "createTopic", + "group": "topics", + "weight": 348, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topicId": { + "type": "string", + "description": "Topic ID. Choose a custom Topic ID or a new Topic ID.", + "x-example": "<TOPIC_ID>" + }, + "name": { + "type": "string", + "description": "Topic Name.", + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "topicId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/topics\/{topicId}": { + "get": { + "summary": "Get topic", + "operationId": "messagingGetTopic", + "tags": [ + "messaging" + ], + "description": "Get a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "x-appwrite": { + "method": "getTopic", + "group": "topics", + "weight": 351, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update topic", + "operationId": "messagingUpdateTopic", + "tags": [ + "messaging" + ], + "description": "Update a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "x-appwrite": { + "method": "updateTopic", + "group": "topics", + "weight": 352, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Topic Name.", + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete topic", + "operationId": "messagingDeleteTopic", + "tags": [ + "messaging" + ], + "description": "Delete a topic by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteTopic", + "group": "topics", + "weight": 353, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/logs": { + "get": { + "summary": "List topic logs", + "operationId": "messagingListTopicLogs", + "tags": [ + "messaging" + ], + "description": "Get the topic activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listTopicLogs", + "group": "topics", + "weight": 350, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-topic-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topic-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers": { + "get": { + "summary": "List subscribers", + "operationId": "messagingListSubscribers", + "tags": [ + "messaging" + ], + "description": "Get a list of all subscribers from the current Appwrite project.", + "responses": { + "200": { + "description": "Subscriber list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriberList" + } + } + } + } + }, + "x-appwrite": { + "method": "listSubscribers", + "group": "subscribers", + "weight": 355, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-subscribers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscribers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create subscriber", + "operationId": "messagingCreateSubscriber", + "tags": [ + "messaging" + ], + "description": "Create a new subscriber.", + "responses": { + "201": { + "description": "Subscriber", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriber" + } + } + } + } + }, + "x-appwrite": { + "method": "createSubscriber", + "group": "subscribers", + "weight": 354, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID to subscribe to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "subscriberId": { + "type": "string", + "description": "Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.", + "x-example": "<SUBSCRIBER_ID>" + }, + "targetId": { + "type": "string", + "description": "Target ID. The target ID to link to the specified Topic ID.", + "x-example": "<TARGET_ID>" + } + }, + "required": [ + "subscriberId", + "targetId" + ] + } + } + } + } + } + }, + "\/messaging\/topics\/{topicId}\/subscribers\/{subscriberId}": { + "get": { + "summary": "Get subscriber", + "operationId": "messagingGetSubscriber", + "tags": [ + "messaging" + ], + "description": "Get a subscriber by its unique ID.\n", + "responses": { + "200": { + "description": "Subscriber", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriber" + } + } + } + } + }, + "x-appwrite": { + "method": "getSubscriber", + "group": "subscribers", + "weight": 357, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SUBSCRIBER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete subscriber", + "operationId": "messagingDeleteSubscriber", + "tags": [ + "messaging" + ], + "description": "Delete a subscriber by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSubscriber", + "group": "subscribers", + "weight": 358, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SUBSCRIBER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/migrations": { + "get": { + "summary": "List migrations", + "operationId": "migrationsList", + "tags": [ + "migrations" + ], + "description": "List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.", + "responses": { + "200": { + "description": "Migrations List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migrationList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "group": null, + "weight": 316, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/list-migrations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/migrations\/appwrite": { + "post": { + "summary": "Create Appwrite migration", + "operationId": "migrationsCreateAppwriteMigration", + "tags": [ + "migrations" + ], + "description": "Migrate data from another Appwrite project to your current project. This endpoint allows you to migrate resources like databases, collections, documents, users, and files from an existing Appwrite project. ", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "x-appwrite": { + "method": "createAppwriteMigration", + "group": null, + "weight": 311, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/create-appwrite-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-appwrite.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "x-example": null, + "items": { + "type": "string" + } + }, + "endpoint": { + "type": "string", + "description": "Source Appwrite endpoint", + "x-example": "https:\/\/example.com" + }, + "projectId": { + "type": "string", + "description": "Source Project ID", + "x-example": "<PROJECT_ID>" + }, + "apiKey": { + "type": "string", + "description": "Source API Key", + "x-example": "<API_KEY>" + } + }, + "required": [ + "resources", + "endpoint", + "projectId", + "apiKey" + ] + } + } + } + } + } + }, + "\/migrations\/appwrite\/report": { + "get": { + "summary": "Get Appwrite migration report", + "operationId": "migrationsGetAppwriteReport", + "tags": [ + "migrations" + ], + "description": "Generate a report of the data in an Appwrite project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", + "responses": { + "200": { + "description": "Migration Report", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migrationReport" + } + } + } + } + }, + "x-appwrite": { + "method": "getAppwriteReport", + "group": null, + "weight": 318, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/get-appwrite-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-appwrite-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "in": "query" + }, + { + "name": "endpoint", + "description": "Source's Appwrite Endpoint", + "required": true, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com" + }, + "in": "query" + }, + { + "name": "projectID", + "description": "Source's Project ID", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "query" + }, + { + "name": "key", + "description": "Source's API Key", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY>" + }, + "in": "query" + } + ] + } + }, + "\/migrations\/csv": { + "post": { + "summary": "Import documents from a CSV", + "operationId": "migrationsCreateCsvMigration", + "tags": [ + "migrations" + ], + "description": "Import documents from a CSV file into your Appwrite database. This endpoint allows you to import documents from a CSV file uploaded to Appwrite Storage bucket.", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "x-appwrite": { + "method": "createCsvMigration", + "group": null, + "weight": 315, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/create-csv-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-csv.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "x-example": "<BUCKET_ID>" + }, + "fileId": { + "type": "string", + "description": "File ID.", + "x-example": "<FILE_ID>" + }, + "resourceId": { + "type": "string", + "description": "Composite ID in the format {databaseId:collectionId}, identifying a collection within a database.", + "x-example": "[ID1:ID2]" + } + }, + "required": [ + "bucketId", + "fileId", + "resourceId" + ] + } + } + } + } + } + }, + "\/migrations\/firebase": { + "post": { + "summary": "Create Firebase migration", + "operationId": "migrationsCreateFirebaseMigration", + "tags": [ + "migrations" + ], + "description": "Migrate data from a Firebase project to your Appwrite project. This endpoint allows you to migrate resources like authentication and other supported services from a Firebase project. ", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "x-appwrite": { + "method": "createFirebaseMigration", + "group": null, + "weight": 312, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/create-firebase-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "x-example": null, + "items": { + "type": "string" + } + }, + "serviceAccount": { + "type": "string", + "description": "JSON of the Firebase service account credentials", + "x-example": "<SERVICE_ACCOUNT>" + } + }, + "required": [ + "resources", + "serviceAccount" + ] + } + } + } + } + } + }, + "\/migrations\/firebase\/report": { + "get": { + "summary": "Get Firebase migration report", + "operationId": "migrationsGetFirebaseReport", + "tags": [ + "migrations" + ], + "description": "Generate a report of the data in a Firebase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", + "responses": { + "200": { + "description": "Migration Report", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migrationReport" + } + } + } + } + }, + "x-appwrite": { + "method": "getFirebaseReport", + "group": null, + "weight": 319, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/get-firebase-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "in": "query" + }, + { + "name": "serviceAccount", + "description": "JSON of the Firebase service account credentials", + "required": true, + "schema": { + "type": "string", + "x-example": "<SERVICE_ACCOUNT>" + }, + "in": "query" + } + ] + } + }, + "\/migrations\/nhost": { + "post": { + "summary": "Create NHost migration", + "operationId": "migrationsCreateNHostMigration", + "tags": [ + "migrations" + ], + "description": "Migrate data from an NHost project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from an NHost project. ", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "x-appwrite": { + "method": "createNHostMigration", + "group": null, + "weight": 314, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/create-n-host-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-nhost.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "x-example": null, + "items": { + "type": "string" + } + }, + "subdomain": { + "type": "string", + "description": "Source's Subdomain", + "x-example": "<SUBDOMAIN>" + }, + "region": { + "type": "string", + "description": "Source's Region", + "x-example": "<REGION>" + }, + "adminSecret": { + "type": "string", + "description": "Source's Admin Secret", + "x-example": "<ADMIN_SECRET>" + }, + "database": { + "type": "string", + "description": "Source's Database Name", + "x-example": "<DATABASE>" + }, + "username": { + "type": "string", + "description": "Source's Database Username", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Source's Database Password", + "x-example": "<PASSWORD>" + }, + "port": { + "type": "integer", + "description": "Source's Database Port", + "x-example": null + } + }, + "required": [ + "resources", + "subdomain", + "region", + "adminSecret", + "database", + "username", + "password" + ] + } + } + } + } + } + }, + "\/migrations\/nhost\/report": { + "get": { + "summary": "Get NHost migration report", + "operationId": "migrationsGetNHostReport", + "tags": [ + "migrations" + ], + "description": "Generate a detailed report of the data in an NHost project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", + "responses": { + "200": { + "description": "Migration Report", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migrationReport" + } + } + } + } + }, + "x-appwrite": { + "method": "getNHostReport", + "group": null, + "weight": 321, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/get-n-host-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-nhost-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate.", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "in": "query" + }, + { + "name": "subdomain", + "description": "Source's Subdomain.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SUBDOMAIN>" + }, + "in": "query" + }, + { + "name": "region", + "description": "Source's Region.", + "required": true, + "schema": { + "type": "string", + "x-example": "<REGION>" + }, + "in": "query" + }, + { + "name": "adminSecret", + "description": "Source's Admin Secret.", + "required": true, + "schema": { + "type": "string", + "x-example": "<ADMIN_SECRET>" + }, + "in": "query" + }, + { + "name": "database", + "description": "Source's Database Name.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE>" + }, + "in": "query" + }, + { + "name": "username", + "description": "Source's Database Username.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USERNAME>" + }, + "in": "query" + }, + { + "name": "password", + "description": "Source's Database Password.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PASSWORD>" + }, + "in": "query" + }, + { + "name": "port", + "description": "Source's Database Port.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5432 + }, + "in": "query" + } + ] + } + }, + "\/migrations\/supabase": { + "post": { + "summary": "Create Supabase migration", + "operationId": "migrationsCreateSupabaseMigration", + "tags": [ + "migrations" + ], + "description": "Migrate data from a Supabase project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from a Supabase project. ", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "x-appwrite": { + "method": "createSupabaseMigration", + "group": null, + "weight": 313, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/create-supabase-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-supabase.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "x-example": null, + "items": { + "type": "string" + } + }, + "endpoint": { + "type": "string", + "description": "Source's Supabase Endpoint", + "x-example": "https:\/\/example.com" + }, + "apiKey": { + "type": "string", + "description": "Source's API Key", + "x-example": "<API_KEY>" + }, + "databaseHost": { + "type": "string", + "description": "Source's Database Host", + "x-example": "<DATABASE_HOST>" + }, + "username": { + "type": "string", + "description": "Source's Database Username", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Source's Database Password", + "x-example": "<PASSWORD>" + }, + "port": { + "type": "integer", + "description": "Source's Database Port", + "x-example": null + } + }, + "required": [ + "resources", + "endpoint", + "apiKey", + "databaseHost", + "username", + "password" + ] + } + } + } + } + } + }, + "\/migrations\/supabase\/report": { + "get": { + "summary": "Get Supabase migration report", + "operationId": "migrationsGetSupabaseReport", + "tags": [ + "migrations" + ], + "description": "Generate a report of the data in a Supabase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", + "responses": { + "200": { + "description": "Migration Report", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migrationReport" + } + } + } + } + }, + "x-appwrite": { + "method": "getSupabaseReport", + "group": null, + "weight": 320, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/get-supabase-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-supabase-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "in": "query" + }, + { + "name": "endpoint", + "description": "Source's Supabase Endpoint.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com" + }, + "in": "query" + }, + { + "name": "apiKey", + "description": "Source's API Key.", + "required": true, + "schema": { + "type": "string", + "x-example": "<API_KEY>" + }, + "in": "query" + }, + { + "name": "databaseHost", + "description": "Source's Database Host.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_HOST>" + }, + "in": "query" + }, + { + "name": "username", + "description": "Source's Database Username.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USERNAME>" + }, + "in": "query" + }, + { + "name": "password", + "description": "Source's Database Password.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PASSWORD>" + }, + "in": "query" + }, + { + "name": "port", + "description": "Source's Database Port.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5432 + }, + "in": "query" + } + ] + } + }, + "\/migrations\/{migrationId}": { + "get": { + "summary": "Get migration", + "operationId": "migrationsGet", + "tags": [ + "migrations" + ], + "description": "Get a migration by its unique ID. This endpoint returns detailed information about a specific migration including its current status, progress, and any errors that occurred during the migration process. ", + "responses": { + "200": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 317, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/get-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "migrationId", + "description": "Migration unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MIGRATION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update retry migration", + "operationId": "migrationsRetry", + "tags": [ + "migrations" + ], + "description": "Retry a failed migration. This endpoint allows you to retry a migration that has previously failed.", + "responses": { + "202": { + "description": "Migration", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/migration" + } + } + } + } + }, + "x-appwrite": { + "method": "retry", + "group": null, + "weight": 322, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/retry.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/retry-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "migrationId", + "description": "Migration unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MIGRATION_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete migration", + "operationId": "migrationsDelete", + "tags": [ + "migrations" + ], + "description": "Delete a migration by its unique ID. This endpoint allows you to remove a migration from your project's migration history. ", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": null, + "weight": 323, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/delete-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "migrationId", + "description": "Migration ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MIGRATION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/project\/usage": { + "get": { + "summary": "Get project usage stats", + "operationId": "projectGetUsage", + "tags": [ + "project" + ], + "description": "Get comprehensive usage statistics for your project. View metrics including network requests, bandwidth, storage, function executions, database usage, and user activity. Specify a time range with startDate and endDate, and optionally set the data granularity with period (1h or 1d). The response includes both total counts and detailed breakdowns by resource, along with historical data over the specified period.", + "responses": { + "200": { + "description": "UsageProject", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageProject" + } + } + } + } + }, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 202, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "project\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "startDate", + "description": "Starting date for the usage", + "required": true, + "schema": { + "type": "string" + }, + "in": "query" + }, + { + "name": "endDate", + "description": "End date for the usage", + "required": true, + "schema": { + "type": "string" + }, + "in": "query" + }, + { + "name": "period", + "description": "Period used", + "required": false, + "schema": { + "type": "string", + "x-example": "1h", + "enum": [ + "1h", + "1d" + ], + "x-enum-name": "ProjectUsageRange", + "x-enum-keys": [ + "One Hour", + "One Day" + ], + "default": "1d" + }, + "in": "query" + } + ] + } + }, + "\/project\/variables": { + "get": { + "summary": "List variables", + "operationId": "projectListVariables", + "tags": [ + "project" + ], + "description": "Get a list of all project variables. These variables will be accessible in all Appwrite Functions at runtime.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "x-appwrite": { + "method": "listVariables", + "group": null, + "weight": 204, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "project\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/list-variables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "projectCreateVariable", + "tags": [ + "project" + ], + "description": "Create a new project variable. This variable will be accessible in all Appwrite Functions at runtime.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "x-appwrite": { + "method": "createVariable", + "group": null, + "weight": 203, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "project\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/create-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only projects can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + } + } + } + }, + "\/project\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "projectGetVariable", + "tags": [ + "project" + ], + "description": "Get a project variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "x-appwrite": { + "method": "getVariable", + "group": null, + "weight": 205, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "project\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "projectUpdateVariable", + "tags": [ + "project" + ], + "description": "Update project variable by its unique ID. This variable will be accessible in all Appwrite Functions at runtime.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "x-appwrite": { + "method": "updateVariable", + "group": null, + "weight": 206, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "project\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/update-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only projects can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete variable", + "operationId": "projectDeleteVariable", + "tags": [ + "project" + ], + "description": "Delete a project variable by its unique ID. ", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteVariable", + "group": null, + "weight": 207, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "project\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/delete-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects": { + "get": { + "summary": "List projects", + "operationId": "projectsList", + "tags": [ + "projects" + ], + "description": "Get a list of all projects. You can use the query params to filter your results. ", + "responses": { + "200": { + "description": "Projects List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/projectList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "group": "projects", + "weight": 157, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create project", + "operationId": "projectsCreate", + "tags": [ + "projects" + ], + "description": "Create a new project. You can create a maximum of 100 projects per account. ", + "responses": { + "201": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "create", + "group": "projects", + "weight": 156, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "projectId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars.", + "x-example": null + }, + "name": { + "type": "string", + "description": "Project name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "teamId": { + "type": "string", + "description": "Team unique ID.", + "x-example": "<TEAM_ID>" + }, + "region": { + "type": "string", + "description": "Project Region.", + "x-example": "default", + "enum": [ + "default" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "description": { + "type": "string", + "description": "Project description. Max length: 256 chars.", + "x-example": "<DESCRIPTION>" + }, + "logo": { + "type": "string", + "description": "Project logo.", + "x-example": "<LOGO>" + }, + "url": { + "type": "string", + "description": "Project URL.", + "x-example": "https:\/\/example.com" + }, + "legalName": { + "type": "string", + "description": "Project legal Name. Max length: 256 chars.", + "x-example": "<LEGAL_NAME>" + }, + "legalCountry": { + "type": "string", + "description": "Project legal Country. Max length: 256 chars.", + "x-example": "<LEGAL_COUNTRY>" + }, + "legalState": { + "type": "string", + "description": "Project legal State. Max length: 256 chars.", + "x-example": "<LEGAL_STATE>" + }, + "legalCity": { + "type": "string", + "description": "Project legal City. Max length: 256 chars.", + "x-example": "<LEGAL_CITY>" + }, + "legalAddress": { + "type": "string", + "description": "Project legal Address. Max length: 256 chars.", + "x-example": "<LEGAL_ADDRESS>" + }, + "legalTaxId": { + "type": "string", + "description": "Project legal Tax ID. Max length: 256 chars.", + "x-example": "<LEGAL_TAX_ID>" + } + }, + "required": [ + "projectId", + "name", + "teamId" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}": { + "get": { + "summary": "Get project", + "operationId": "projectsGet", + "tags": [ + "projects" + ], + "description": "Get a project by its unique ID. This endpoint allows you to retrieve the project's details, including its name, description, team, region, and other metadata. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "projects", + "weight": 158, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update project", + "operationId": "projectsUpdate", + "tags": [ + "projects" + ], + "description": "Update a project by its unique ID.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "update", + "group": "projects", + "weight": 159, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Project name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "description": { + "type": "string", + "description": "Project description. Max length: 256 chars.", + "x-example": "<DESCRIPTION>" + }, + "logo": { + "type": "string", + "description": "Project logo.", + "x-example": "<LOGO>" + }, + "url": { + "type": "string", + "description": "Project URL.", + "x-example": "https:\/\/example.com" + }, + "legalName": { + "type": "string", + "description": "Project legal name. Max length: 256 chars.", + "x-example": "<LEGAL_NAME>" + }, + "legalCountry": { + "type": "string", + "description": "Project legal country. Max length: 256 chars.", + "x-example": "<LEGAL_COUNTRY>" + }, + "legalState": { + "type": "string", + "description": "Project legal state. Max length: 256 chars.", + "x-example": "<LEGAL_STATE>" + }, + "legalCity": { + "type": "string", + "description": "Project legal city. Max length: 256 chars.", + "x-example": "<LEGAL_CITY>" + }, + "legalAddress": { + "type": "string", + "description": "Project legal address. Max length: 256 chars.", + "x-example": "<LEGAL_ADDRESS>" + }, + "legalTaxId": { + "type": "string", + "description": "Project legal tax ID. Max length: 256 chars.", + "x-example": "<LEGAL_TAX_ID>" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete project", + "operationId": "projectsDelete", + "tags": [ + "projects" + ], + "description": "Delete a project by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "projects", + "weight": 176, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/api": { + "patch": { + "summary": "Update API status", + "operationId": "projectsUpdateApiStatus", + "tags": [ + "projects" + ], + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateApiStatus", + "group": "projects", + "weight": 163, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-api-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "api": { + "type": "string", + "description": "API name.", + "x-example": "rest", + "enum": [ + "rest", + "graphql", + "realtime" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "status": { + "type": "boolean", + "description": "API status.", + "x-example": false + } + }, + "required": [ + "api", + "status" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/api\/all": { + "patch": { + "summary": "Update all API status", + "operationId": "projectsUpdateApiStatusAll", + "tags": [ + "projects" + ], + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateApiStatusAll", + "group": "projects", + "weight": 164, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-api-status-all.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status-all.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "API status.", + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/duration": { + "patch": { + "summary": "Update project authentication duration", + "operationId": "projectsUpdateAuthDuration", + "tags": [ + "projects" + ], + "description": "Update how long sessions created within a project should stay active for.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateAuthDuration", + "group": "auth", + "weight": 169, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-auth-duration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-duration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "duration": { + "type": "integer", + "description": "Project session length in seconds. Max length: 31536000 seconds.", + "x-example": 0 + } + }, + "required": [ + "duration" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/limit": { + "patch": { + "summary": "Update project users limit", + "operationId": "projectsUpdateAuthLimit", + "tags": [ + "projects" + ], + "description": "Update the maximum number of users allowed in this project. Set to 0 for unlimited users. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateAuthLimit", + "group": "auth", + "weight": 168, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-auth-limit.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-limit.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "description": "Set the max number of users allowed in this project. Use 0 for unlimited.", + "x-example": 0 + } + }, + "required": [ + "limit" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/max-sessions": { + "patch": { + "summary": "Update project user sessions limit", + "operationId": "projectsUpdateAuthSessionsLimit", + "tags": [ + "projects" + ], + "description": "Update the maximum number of sessions allowed per user within the project, if the limit is hit the oldest session will be deleted to make room for new sessions.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateAuthSessionsLimit", + "group": "auth", + "weight": 174, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-auth-sessions-limit.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-sessions-limit.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "description": "Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10", + "x-example": 1 + } + }, + "required": [ + "limit" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/memberships-privacy": { + "patch": { + "summary": "Update project memberships privacy attributes", + "operationId": "projectsUpdateMembershipsPrivacy", + "tags": [ + "projects" + ], + "description": "Update project membership privacy settings. Use this endpoint to control what user information is visible to other team members, such as user name, email, and MFA status. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMembershipsPrivacy", + "group": "auth", + "weight": 167, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-memberships-privacy.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-memberships-privacy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userName": { + "type": "boolean", + "description": "Set to true to show userName to members of a team.", + "x-example": false + }, + "userEmail": { + "type": "boolean", + "description": "Set to true to show email to members of a team.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Set to true to show mfa to members of a team.", + "x-example": false + } + }, + "required": [ + "userName", + "userEmail", + "mfa" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/mock-numbers": { + "patch": { + "summary": "Update the mock numbers for the project", + "operationId": "projectsUpdateMockNumbers", + "tags": [ + "projects" + ], + "description": "Update the list of mock phone numbers for testing. Use these numbers to bypass SMS verification in development. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMockNumbers", + "group": "auth", + "weight": 175, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-mock-numbers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-mock-numbers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "numbers": { + "type": "array", + "description": "An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.", + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "numbers" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/password-dictionary": { + "patch": { + "summary": "Update authentication password dictionary status. Use this endpoint to enable or disable the dicitonary check for user password", + "operationId": "projectsUpdateAuthPasswordDictionary", + "tags": [ + "projects" + ], + "description": "Enable or disable checking user passwords against common passwords dictionary. This helps ensure users don't use common and insecure passwords. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateAuthPasswordDictionary", + "group": "auth", + "weight": 172, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-auth-password-dictionary.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-dictionary.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Set whether or not to enable checking user's password against most commonly used passwords. Default is false.", + "x-example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/password-history": { + "patch": { + "summary": "Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history.", + "operationId": "projectsUpdateAuthPasswordHistory", + "tags": [ + "projects" + ], + "description": "Update the authentication password history requirement. Use this endpoint to require new passwords to be different than the last X amount of previously used ones.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateAuthPasswordHistory", + "group": "auth", + "weight": 171, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-auth-password-history.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-history.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "description": "Set the max number of passwords to store in user history. User can't choose a new password that is already stored in the password history list. Max number of passwords allowed in history is20. Default value is 0", + "x-example": 0 + } + }, + "required": [ + "limit" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/personal-data": { + "patch": { + "summary": "Update personal data check", + "operationId": "projectsUpdatePersonalDataCheck", + "tags": [ + "projects" + ], + "description": "Enable or disable checking user passwords against their personal data. This helps prevent users from using personal information in their passwords. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePersonalDataCheck", + "group": "auth", + "weight": 173, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-personal-data-check.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-personal-data-check.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Set whether or not to check a password for similarity with personal data. Default is false.", + "x-example": false + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/session-alerts": { + "patch": { + "summary": "Update project sessions emails", + "operationId": "projectsUpdateSessionAlerts", + "tags": [ + "projects" + ], + "description": "Enable or disable session email alerts. When enabled, users will receive email notifications when new sessions are created.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSessionAlerts", + "group": "auth", + "weight": 166, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-session-alerts.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-session-alerts.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "alerts": { + "type": "boolean", + "description": "Set to true to enable session emails.", + "x-example": false + } + }, + "required": [ + "alerts" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/auth\/{method}": { + "patch": { + "summary": "Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.", + "operationId": "projectsUpdateAuthStatus", + "tags": [ + "projects" + ], + "description": "Update the status of a specific authentication method. Use this endpoint to enable or disable different authentication methods such as email, magic urls or sms in your project. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateAuthStatus", + "group": "auth", + "weight": 170, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-auth-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "method", + "description": "Auth Method. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone", + "required": true, + "schema": { + "type": "string", + "x-example": "email-password", + "enum": [ + "email-password", + "magic-url", + "email-otp", + "anonymous", + "invites", + "jwt", + "phone" + ], + "x-enum-name": "AuthMethod", + "x-enum-keys": [] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "Set the status of this auth method.", + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/dev-keys": { + "get": { + "summary": "List dev keys", + "operationId": "projectsListDevKeys", + "tags": [ + "projects" + ], + "description": "List all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", + "responses": { + "200": { + "description": "Dev Keys List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKeyList" + } + } + } + } + }, + "x-appwrite": { + "method": "listDevKeys", + "group": "devKeys", + "weight": 373, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/list-dev-keys.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: accessedAt, expire", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create dev key", + "operationId": "projectsCreateDevKey", + "tags": [ + "projects" + ], + "description": "Create a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", + "responses": { + "201": { + "description": "DevKey", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKey" + } + } + } + } + }, + "x-appwrite": { + "method": "createDevKey", + "group": "devKeys", + "weight": 370, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/dev-keys\/{keyId}": { + "get": { + "summary": "Get dev key", + "operationId": "projectsGetDevKey", + "tags": [ + "projects" + ], + "description": "Get a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", + "responses": { + "200": { + "description": "DevKey", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKey" + } + } + } + } + }, + "x-appwrite": { + "method": "getDevKey", + "group": "devKeys", + "weight": 372, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update dev key", + "operationId": "projectsUpdateDevKey", + "tags": [ + "projects" + ], + "description": "Update a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", + "responses": { + "200": { + "description": "DevKey", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/devKey" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDevKey", + "group": "devKeys", + "weight": 371, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete dev key", + "operationId": "projectsDeleteDevKey", + "tags": [ + "projects" + ], + "description": "Delete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDevKey", + "group": "devKeys", + "weight": 374, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "projectsCreateJWT", + "tags": [ + "projects" + ], + "description": "Create a new JWT token. This token can be used to authenticate users with custom scopes and expiration time. ", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "x-appwrite": { + "method": "createJWT", + "group": "auth", + "weight": 188, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-jwt.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "scopes": { + "type": "array", + "description": "List of scopes allowed for JWT key. Maximum of 100 scopes are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "duration": { + "type": "integer", + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "x-example": 0 + } + }, + "required": [ + "scopes" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/keys": { + "get": { + "summary": "List keys", + "operationId": "projectsListKeys", + "tags": [ + "projects" + ], + "description": "Get a list of all API keys from the current project. ", + "responses": { + "200": { + "description": "API Keys List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/keyList" + } + } + } + } + }, + "x-appwrite": { + "method": "listKeys", + "group": "keys", + "weight": 184, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/list-keys.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-keys.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create key", + "operationId": "projectsCreateKey", + "tags": [ + "projects" + ], + "description": "Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.", + "responses": { + "201": { + "description": "Key", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/key" + } + } + } + } + }, + "x-appwrite": { + "method": "createKey", + "group": "keys", + "weight": 183, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "scopes": { + "type": "array", + "description": "Key scopes list. Maximum of 100 scopes are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.", + "x-example": null + } + }, + "required": [ + "name", + "scopes" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/keys\/{keyId}": { + "get": { + "summary": "Get key", + "operationId": "projectsGetKey", + "tags": [ + "projects" + ], + "description": "Get a key by its unique ID. This endpoint returns details about a specific API key in your project including it's scopes.", + "responses": { + "200": { + "description": "Key", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/key" + } + } + } + } + }, + "x-appwrite": { + "method": "getKey", + "group": "keys", + "weight": 185, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update key", + "operationId": "projectsUpdateKey", + "tags": [ + "projects" + ], + "description": "Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. ", + "responses": { + "200": { + "description": "Key", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/key" + } + } + } + } + }, + "x-appwrite": { + "method": "updateKey", + "group": "keys", + "weight": 186, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "scopes": { + "type": "array", + "description": "Key scopes list. Maximum of 100 events are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.", + "x-example": null + } + }, + "required": [ + "name", + "scopes" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete key", + "operationId": "projectsDeleteKey", + "tags": [ + "projects" + ], + "description": "Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. ", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteKey", + "group": "keys", + "weight": 187, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "keyId", + "description": "Key unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<KEY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/oauth2": { + "patch": { + "summary": "Update project OAuth2", + "operationId": "projectsUpdateOAuth2", + "tags": [ + "projects" + ], + "description": "Update the OAuth2 provider configurations. Use this endpoint to set up or update the OAuth2 provider credentials or enable\/disable providers. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateOAuth2", + "group": "auth", + "weight": 165, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-o-auth2.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-oauth2.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "Provider Name", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [] + }, + "appId": { + "type": "string", + "description": "Provider app ID. Max length: 256 chars.", + "x-example": "<APP_ID>" + }, + "secret": { + "type": "string", + "description": "Provider secret key. Max length: 512 chars.", + "x-example": "<SECRET>" + }, + "enabled": { + "type": "boolean", + "description": "Provider status. Set to 'false' to disable new session creation.", + "x-example": false + } + }, + "required": [ + "provider" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/platforms": { + "get": { + "summary": "List platforms", + "operationId": "projectsListPlatforms", + "tags": [ + "projects" + ], + "description": "Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. ", + "responses": { + "200": { + "description": "Platforms List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platformList" + } + } + } + } + }, + "x-appwrite": { + "method": "listPlatforms", + "group": "platforms", + "weight": 190, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/list-platforms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-platforms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create platform", + "operationId": "projectsCreatePlatform", + "tags": [ + "projects" + ], + "description": "Create a new platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API.", + "responses": { + "201": { + "description": "Platform", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platform" + } + } + } + } + }, + "x-appwrite": { + "method": "createPlatform", + "group": "platforms", + "weight": 189, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Platform type.", + "x-example": "web", + "enum": [ + "web", + "flutter-web", + "flutter-ios", + "flutter-android", + "flutter-linux", + "flutter-macos", + "flutter-windows", + "apple-ios", + "apple-macos", + "apple-watchos", + "apple-tvos", + "android", + "unity", + "react-native-ios", + "react-native-android" + ], + "x-enum-name": "PlatformType", + "x-enum-keys": [] + }, + "name": { + "type": "string", + "description": "Platform name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "key": { + "type": "string", + "description": "Package name for Android or bundle ID for iOS or macOS. Max length: 256 chars.", + "x-example": "<KEY>" + }, + "store": { + "type": "string", + "description": "App store or Google Play store ID. Max length: 256 chars.", + "x-example": "<STORE>" + }, + "hostname": { + "type": "string", + "description": "Platform client hostname. Max length: 256 chars.", + "x-example": null + } + }, + "required": [ + "type", + "name" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/platforms\/{platformId}": { + "get": { + "summary": "Get platform", + "operationId": "projectsGetPlatform", + "tags": [ + "projects" + ], + "description": "Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. ", + "responses": { + "200": { + "description": "Platform", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platform" + } + } + } + } + }, + "x-appwrite": { + "method": "getPlatform", + "group": "platforms", + "weight": 191, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "platformId", + "description": "Platform unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PLATFORM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update platform", + "operationId": "projectsUpdatePlatform", + "tags": [ + "projects" + ], + "description": "Update a platform by its unique ID. Use this endpoint to update the platform's name, key, platform store ID, or hostname. ", + "responses": { + "200": { + "description": "Platform", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/platform" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePlatform", + "group": "platforms", + "weight": 192, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "platformId", + "description": "Platform unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PLATFORM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Platform name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "key": { + "type": "string", + "description": "Package name for android or bundle ID for iOS. Max length: 256 chars.", + "x-example": "<KEY>" + }, + "store": { + "type": "string", + "description": "App store or Google Play store ID. Max length: 256 chars.", + "x-example": "<STORE>" + }, + "hostname": { + "type": "string", + "description": "Platform client URL. Max length: 256 chars.", + "x-example": null + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete platform", + "operationId": "projectsDeletePlatform", + "tags": [ + "projects" + ], + "description": "Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. ", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deletePlatform", + "group": "platforms", + "weight": 193, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "platformId", + "description": "Platform unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PLATFORM_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/service": { + "patch": { + "summary": "Update service status", + "operationId": "projectsUpdateServiceStatus", + "tags": [ + "projects" + ], + "description": "Update the status of a specific service. Use this endpoint to enable or disable a service in your project. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateServiceStatus", + "group": "projects", + "weight": 161, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-service-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "service": { + "type": "string", + "description": "Service name.", + "x-example": "account", + "enum": [ + "account", + "avatars", + "databases", + "locale", + "health", + "storage", + "teams", + "users", + "sites", + "functions", + "graphql", + "messaging" + ], + "x-enum-name": "ApiService", + "x-enum-keys": [] + }, + "status": { + "type": "boolean", + "description": "Service status.", + "x-example": false + } + }, + "required": [ + "service", + "status" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/service\/all": { + "patch": { + "summary": "Update all service status", + "operationId": "projectsUpdateServiceStatusAll", + "tags": [ + "projects" + ], + "description": "Update the status of all services. Use this endpoint to enable or disable all optional services at once. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateServiceStatusAll", + "group": "projects", + "weight": 162, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-service-status-all.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status-all.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "Service status.", + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/smtp": { + "patch": { + "summary": "Update SMTP", + "operationId": "projectsUpdateSmtp", + "tags": [ + "projects" + ], + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSmtp", + "group": "templates", + "weight": 194, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-smtp.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-smtp.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable custom SMTP service", + "x-example": false + }, + "senderName": { + "type": "string", + "description": "Name of the email sender", + "x-example": "<SENDER_NAME>" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "x-example": "email@example.com" + }, + "replyTo": { + "type": "string", + "description": "Reply to email", + "x-example": "email@example.com" + }, + "host": { + "type": "string", + "description": "SMTP server host name", + "x-example": null + }, + "port": { + "type": "integer", + "description": "SMTP server port", + "x-example": null + }, + "username": { + "type": "string", + "description": "SMTP server username", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "SMTP server password", + "x-example": "<PASSWORD>" + }, + "secure": { + "type": "string", + "description": "Does SMTP server use secure connection", + "x-example": "tls", + "enum": [ + "tls", + "ssl" + ], + "x-enum-name": "SMTPSecure", + "x-enum-keys": [] + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/smtp\/tests": { + "post": { + "summary": "Create SMTP test", + "operationId": "projectsCreateSmtpTest", + "tags": [ + "projects" + ], + "description": "Send a test email to verify SMTP configuration. ", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "createSmtpTest", + "group": "templates", + "weight": 195, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-smtp-test.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-smtp-test.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "emails": { + "type": "array", + "description": "Array of emails to send test email to. Maximum of 10 emails are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "senderName": { + "type": "string", + "description": "Name of the email sender", + "x-example": "<SENDER_NAME>" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "x-example": "email@example.com" + }, + "replyTo": { + "type": "string", + "description": "Reply to email", + "x-example": "email@example.com" + }, + "host": { + "type": "string", + "description": "SMTP server host name", + "x-example": null + }, + "port": { + "type": "integer", + "description": "SMTP server port", + "x-example": null + }, + "username": { + "type": "string", + "description": "SMTP server username", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "SMTP server password", + "x-example": "<PASSWORD>" + }, + "secure": { + "type": "string", + "description": "Does SMTP server use secure connection", + "x-example": "tls", + "enum": [ + "tls", + "ssl" + ], + "x-enum-name": "SMTPSecure", + "x-enum-keys": [] + } + }, + "required": [ + "emails", + "senderName", + "senderEmail", + "host" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/team": { + "patch": { + "summary": "Update project team", + "operationId": "projectsUpdateTeam", + "tags": [ + "projects" + ], + "description": "Update the team ID of a project allowing for it to be transferred to another team.", + "responses": { + "200": { + "description": "Project", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/project" + } + } + } + } + }, + "x-appwrite": { + "method": "updateTeam", + "group": "projects", + "weight": 160, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-team.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID of the team to transfer project to.", + "x-example": "<TEAM_ID>" + } + }, + "required": [ + "teamId" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/templates\/email\/{type}\/{locale}": { + "get": { + "summary": "Get custom email template", + "operationId": "projectsGetEmailTemplate", + "tags": [ + "projects" + ], + "description": "Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. ", + "responses": { + "200": { + "description": "EmailTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/emailTemplate" + } + } + } + } + }, + "x-appwrite": { + "method": "getEmailTemplate", + "group": "templates", + "weight": 197, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-email-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "schema": { + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "magicsession", + "recovery", + "invitation", + "mfachallenge", + "sessionalert", + "otpsession" + ], + "x-enum-name": "EmailTemplateType", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "EmailTemplateLocale", + "x-enum-keys": [] + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update custom email templates", + "operationId": "projectsUpdateEmailTemplate", + "tags": [ + "projects" + ], + "description": "Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.", + "responses": { + "200": { + "description": "EmailTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/emailTemplate" + } + } + } + } + }, + "x-appwrite": { + "method": "updateEmailTemplate", + "group": "templates", + "weight": 199, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-email-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "schema": { + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "magicsession", + "recovery", + "invitation", + "mfachallenge", + "sessionalert", + "otpsession" + ], + "x-enum-name": "EmailTemplateType", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "EmailTemplateLocale", + "x-enum-keys": [] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "Email Subject", + "x-example": "<SUBJECT>" + }, + "message": { + "type": "string", + "description": "Template message", + "x-example": "<MESSAGE>" + }, + "senderName": { + "type": "string", + "description": "Name of the email sender", + "x-example": "<SENDER_NAME>" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "x-example": "email@example.com" + }, + "replyTo": { + "type": "string", + "description": "Reply to email", + "x-example": "email@example.com" + } + }, + "required": [ + "subject", + "message" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete custom email template", + "operationId": "projectsDeleteEmailTemplate", + "tags": [ + "projects" + ], + "description": "Reset a custom email template to its default value. This endpoint removes any custom content and restores the template to its original state. ", + "responses": { + "200": { + "description": "EmailTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/emailTemplate" + } + } + } + } + }, + "x-appwrite": { + "method": "deleteEmailTemplate", + "group": "templates", + "weight": 201, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-email-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "schema": { + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "magicsession", + "recovery", + "invitation", + "mfachallenge", + "sessionalert", + "otpsession" + ], + "x-enum-name": "EmailTemplateType", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "EmailTemplateLocale", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/templates\/sms\/{type}\/{locale}": { + "get": { + "summary": "Get custom SMS template", + "operationId": "projectsGetSmsTemplate", + "tags": [ + "projects" + ], + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", + "responses": { + "200": { + "description": "SmsTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/smsTemplate" + } + } + } + } + }, + "x-appwrite": { + "method": "getSmsTemplate", + "group": "templates", + "weight": 196, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-sms-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-sms-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "schema": { + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "login", + "invitation", + "mfachallenge" + ], + "x-enum-name": "SmsTemplateType", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "SmsTemplateLocale", + "x-enum-keys": [] + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update custom SMS template", + "operationId": "projectsUpdateSmsTemplate", + "tags": [ + "projects" + ], + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", + "responses": { + "200": { + "description": "SmsTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/smsTemplate" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSmsTemplate", + "group": "templates", + "weight": 198, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-sms-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-sms-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "schema": { + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "login", + "invitation", + "mfachallenge" + ], + "x-enum-name": "SmsTemplateType", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "SmsTemplateLocale", + "x-enum-keys": [] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Template message", + "x-example": "<MESSAGE>" + } + }, + "required": [ + "message" + ] + } + } + } + } + }, + "delete": { + "summary": "Reset custom SMS template", + "operationId": "projectsDeleteSmsTemplate", + "tags": [ + "projects" + ], + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", + "responses": { + "200": { + "description": "SmsTemplate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/smsTemplate" + } + } + } + } + }, + "x-appwrite": { + "method": "deleteSmsTemplate", + "group": "templates", + "weight": 200, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-sms-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-sms-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "schema": { + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "login", + "invitation", + "mfachallenge" + ], + "x-enum-name": "SmsTemplateType", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "SmsTemplateLocale", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/webhooks": { + "get": { + "summary": "List webhooks", + "operationId": "projectsListWebhooks", + "tags": [ + "projects" + ], + "description": "Get a list of all webhooks belonging to the project. You can use the query params to filter your results. ", + "responses": { + "200": { + "description": "Webhooks List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhookList" + } + } + } + } + }, + "x-appwrite": { + "method": "listWebhooks", + "group": "webhooks", + "weight": 178, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/list-webhooks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-webhooks.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create webhook", + "operationId": "projectsCreateWebhook", + "tags": [ + "projects" + ], + "description": "Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. ", + "responses": { + "201": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "x-appwrite": { + "method": "createWebhook", + "group": "webhooks", + "weight": 177, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Webhook name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Enable or disable a webhook.", + "x-example": false + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "Webhook URL.", + "x-example": null + }, + "security": { + "type": "boolean", + "description": "Certificate verification, false for disabled or true for enabled.", + "x-example": false + }, + "httpUser": { + "type": "string", + "description": "Webhook HTTP user. Max length: 256 chars.", + "x-example": "<HTTP_USER>" + }, + "httpPass": { + "type": "string", + "description": "Webhook HTTP password. Max length: 256 chars.", + "x-example": "<HTTP_PASS>" + } + }, + "required": [ + "name", + "events", + "url", + "security" + ] + } + } + } + } + } + }, + "\/projects\/{projectId}\/webhooks\/{webhookId}": { + "get": { + "summary": "Get webhook", + "operationId": "projectsGetWebhook", + "tags": [ + "projects" + ], + "description": "Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. ", + "responses": { + "200": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "x-appwrite": { + "method": "getWebhook", + "group": "webhooks", + "weight": 179, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "webhookId", + "description": "Webhook unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update webhook", + "operationId": "projectsUpdateWebhook", + "tags": [ + "projects" + ], + "description": "Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. ", + "responses": { + "200": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "x-appwrite": { + "method": "updateWebhook", + "group": "webhooks", + "weight": 180, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "webhookId", + "description": "Webhook unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Webhook name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Enable or disable a webhook.", + "x-example": false + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "Webhook URL.", + "x-example": null + }, + "security": { + "type": "boolean", + "description": "Certificate verification, false for disabled or true for enabled.", + "x-example": false + }, + "httpUser": { + "type": "string", + "description": "Webhook HTTP user. Max length: 256 chars.", + "x-example": "<HTTP_USER>" + }, + "httpPass": { + "type": "string", + "description": "Webhook HTTP password. Max length: 256 chars.", + "x-example": "<HTTP_PASS>" + } + }, + "required": [ + "name", + "events", + "url", + "security" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete webhook", + "operationId": "projectsDeleteWebhook", + "tags": [ + "projects" + ], + "description": "Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. ", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteWebhook", + "group": "webhooks", + "weight": 182, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "webhookId", + "description": "Webhook unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/webhooks\/{webhookId}\/signature": { + "patch": { + "summary": "Update webhook signature key", + "operationId": "projectsUpdateWebhookSignature", + "tags": [ + "projects" + ], + "description": "Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. ", + "responses": { + "200": { + "description": "Webhook", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/webhook" + } + } + } + } + }, + "x-appwrite": { + "method": "updateWebhookSignature", + "group": "webhooks", + "weight": 181, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-webhook-signature.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook-signature.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROJECT_ID>" + }, + "in": "path" + }, + { + "name": "webhookId", + "description": "Webhook unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<WEBHOOK_ID>" + }, + "in": "path" + } + ] + } + }, + "\/proxy\/rules": { + "get": { + "summary": "List rules", + "operationId": "proxyListRules", + "tags": [ + "proxy" + ], + "description": "Get a list of all the proxy rules. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rule List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRuleList" + } + } + } + } + }, + "x-appwrite": { + "method": "listRules", + "group": null, + "weight": 294, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/list-rules.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/list-rules.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/proxy\/rules\/api": { + "post": { + "summary": "Create API rule", + "operationId": "proxyCreateAPIRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for serving Appwrite's API on custom domain.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "x-appwrite": { + "method": "createAPIRule", + "group": null, + "weight": 435, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/create-a-p-i-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for serving Appwrite's API on custom domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "x-example": null + } + }, + "required": [ + "domain" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/function": { + "post": { + "summary": "Create function rule", + "operationId": "proxyCreateFunctionRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for executing Appwrite Function on custom domain.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "x-appwrite": { + "method": "createFunctionRule", + "group": null, + "weight": 437, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/create-function-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for executing Appwrite Function on custom domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "x-example": null + }, + "functionId": { + "type": "string", + "description": "ID of function to be executed.", + "x-example": "<FUNCTION_ID>" + }, + "branch": { + "type": "string", + "description": "Name of VCS branch to deploy changes automatically", + "x-example": "<BRANCH>" + } + }, + "required": [ + "domain", + "functionId" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/redirect": { + "post": { + "summary": "Create Redirect rule", + "operationId": "proxyCreateRedirectRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for to redirect from custom domain to another domain.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "x-appwrite": { + "method": "createRedirectRule", + "group": null, + "weight": 438, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/create-redirect-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for to redirect from custom domain to another domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "x-example": null + }, + "url": { + "type": "string", + "description": "Target URL of redirection", + "x-example": "https:\/\/example.com" + }, + "statusCode": { + "type": "string", + "description": "Status code of redirection", + "x-example": "301", + "enum": [ + "301", + "302", + "307", + "308" + ], + "x-enum-name": null, + "x-enum-keys": [ + "Moved Permanently 301", + "Found 302", + "Temporary Redirect 307", + "Permanent Redirect 308" + ] + }, + "resourceId": { + "type": "string", + "description": "ID of parent resource.", + "x-example": "<RESOURCE_ID>" + }, + "resourceType": { + "type": "string", + "description": "Type of parent resource.", + "x-example": "site", + "enum": [ + "site", + "function" + ], + "x-enum-name": "ProxyResourceType", + "x-enum-keys": [ + "Site", + "Function" + ] + } + }, + "required": [ + "domain", + "url", + "statusCode", + "resourceId", + "resourceType" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/site": { + "post": { + "summary": "Create site rule", + "operationId": "proxyCreateSiteRule", + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for serving Appwrite Site on custom domain.", + "responses": { + "201": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "x-appwrite": { + "method": "createSiteRule", + "group": null, + "weight": 436, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/create-site-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for serving Appwrite Site on custom domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "x-example": null + }, + "siteId": { + "type": "string", + "description": "ID of site to be executed.", + "x-example": "<SITE_ID>" + }, + "branch": { + "type": "string", + "description": "Name of VCS branch to deploy changes automatically", + "x-example": "<BRANCH>" + } + }, + "required": [ + "domain", + "siteId" + ] + } + } + } + } + } + }, + "\/proxy\/rules\/{ruleId}": { + "get": { + "summary": "Get rule", + "operationId": "proxyGetRule", + "tags": [ + "proxy" + ], + "description": "Get a proxy rule by its unique ID.", + "responses": { + "200": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "x-appwrite": { + "method": "getRule", + "group": null, + "weight": 295, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/get-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/get-rule.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<RULE_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete rule", + "operationId": "proxyDeleteRule", + "tags": [ + "proxy" + ], + "description": "Delete a proxy rule by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteRule", + "group": null, + "weight": 296, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/delete-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/delete-rule.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<RULE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/proxy\/rules\/{ruleId}\/verification": { + "patch": { + "summary": "Update rule verification status", + "operationId": "proxyUpdateRuleVerification", + "tags": [ + "proxy" + ], + "description": "Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.", + "responses": { + "200": { + "description": "Rule", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/proxyRule" + } + } + } + } + }, + "x-appwrite": { + "method": "updateRuleVerification", + "group": null, + "weight": 297, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/update-rule-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/update-rule-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<RULE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites": { + "get": { + "summary": "List sites", + "operationId": "sitesList", + "tags": [ + "sites" + ], + "description": "Get a list of all the project's sites. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Sites List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/siteList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "group": "sites", + "weight": 407, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's sites. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create site", + "operationId": "sitesCreate", + "tags": [ + "sites" + ], + "description": "Create a new site.", + "responses": { + "201": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "x-appwrite": { + "method": "create", + "group": "sites", + "weight": 405, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "siteId": { + "type": "string", + "description": "Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<SITE_ID>" + }, + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "x-example": "<INSTALLATION_ID>" + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "x-example": "<FALLBACK_FILE>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "x-example": null + } + }, + "required": [ + "siteId", + "name", + "framework", + "buildRuntime" + ] + } + } + } + } + } + }, + "\/sites\/frameworks": { + "get": { + "summary": "List frameworks", + "operationId": "sitesListFrameworks", + "tags": [ + "sites" + ], + "description": "Get a list of all frameworks that are currently available on the server instance.", + "responses": { + "200": { + "description": "Frameworks List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/frameworkList" + } + } + } + } + }, + "x-appwrite": { + "method": "listFrameworks", + "group": "frameworks", + "weight": 410, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-frameworks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all frameworks that are currently available on the server instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "sitesListSpecifications", + "tags": [ + "sites" + ], + "description": "List allowed site specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/specificationList" + } + } + } + } + }, + "x-appwrite": { + "method": "listSpecifications", + "group": "frameworks", + "weight": 433, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed site specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/templates": { + "get": { + "summary": "List templates", + "operationId": "sitesListTemplates", + "tags": [ + "sites" + ], + "description": "List available site templates. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "responses": { + "200": { + "description": "Site Templates List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/templateSiteList" + } + } + } + } + }, + "x-appwrite": { + "method": "listTemplates", + "group": "templates", + "weight": 429, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-templates.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList available site templates. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "frameworks", + "description": "List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "useCases", + "description": "List of use cases allowed for filtering site templates. Maximum of 100 use cases are allowed.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "limit", + "description": "Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 25 + }, + "in": "query" + }, + { + "name": "offset", + "description": "Offset the list of returned templates. Maximum offset is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + } + ] + } + }, + "\/sites\/templates\/{templateId}": { + "get": { + "summary": "Get site template", + "operationId": "sitesGetTemplate", + "tags": [ + "sites" + ], + "description": "Get a site template using ID. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "responses": { + "200": { + "description": "Template Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/templateSite" + } + } + } + } + }, + "x-appwrite": { + "method": "getTemplate", + "group": "templates", + "weight": 430, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site template using ID. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "templateId", + "description": "Template ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEMPLATE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/usage": { + "get": { + "summary": "Get sites usage", + "operationId": "sitesListUsage", + "tags": [ + "sites" + ], + "description": "Get usage metrics and statistics for all sites in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageSites", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageSites" + } + } + } + } + }, + "x-appwrite": { + "method": "listUsage", + "group": null, + "weight": 431, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for all sites in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "SiteUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}": { + "get": { + "summary": "Get site", + "operationId": "sitesGet", + "tags": [ + "sites" + ], + "description": "Get a site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "sites", + "weight": 406, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update site", + "operationId": "sitesUpdate", + "tags": [ + "sites" + ], + "description": "Update site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "x-appwrite": { + "method": "update", + "group": "sites", + "weight": 408, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "x-example": "<FALLBACK_FILE>" + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "x-example": null + } + }, + "required": [ + "name", + "framework" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete site", + "operationId": "sitesDelete", + "tags": [ + "sites" + ], + "description": "Delete a site by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "sites", + "weight": 409, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployment": { + "patch": { + "summary": "Update site's deployment", + "operationId": "sitesUpdateSiteDeployment", + "tags": [ + "sites" + ], + "description": "Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSiteDeployment", + "group": "sites", + "weight": 416, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update-site-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "sitesListDeployments", + "tags": [ + "sites" + ], + "description": "Get a list of all the site's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deploymentList" + } + } + } + } + }, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 415, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the site's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "sitesCreateDeployment", + "tags": [ + "sites" + ], + "description": "Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 411, + "cookies": false, + "type": "upload", + "deprecated": false, + "demo": "sites\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "installCommand": { + "type": "string", + "description": "Install Commands.", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Commands.", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory.", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "code": { + "type": "string", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "x-example": null + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "code", + "activate" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "sitesCreateDuplicateDeployment", + "tags": [ + "sites" + ], + "description": "Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 419, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "sitesCreateTemplateDeployment", + "tags": [ + "sites" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 412, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "x-example": "<REPOSITORY>" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "x-example": "<OWNER>" + }, + "rootDirectory": { + "type": "string", + "description": "Path to site code in the template repo.", + "x-example": "<ROOT_DIRECTORY>" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the site template.", + "x-example": "<VERSION>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "sitesCreateVcsDeployment", + "tags": [ + "sites" + ], + "description": "Create a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 413, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "x-example": "branch", + "enum": [ + "branch", + "commit", + "tag" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "x-example": "<REFERENCE>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "sitesGetDeployment", + "tags": [ + "sites" + ], + "description": "Get a site deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 414, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "sitesDeleteDeployment", + "tags": [ + "sites" + ], + "description": "Delete a site deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 417, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "sitesGetDeploymentDownload", + "tags": [ + "sites" + ], + "description": "Get a site deployment 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.", + "responses": { + "200": { + "description": "File" + } + }, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 418, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "sites\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment 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.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "schema": { + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source" + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "sitesUpdateDeploymentStatus", + "tags": [ + "sites" + ], + "description": "Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 420, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/logs": { + "get": { + "summary": "List logs", + "operationId": "sitesListLogs", + "tags": [ + "sites" + ], + "description": "Get a list of all site logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 422, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all site logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/logs\/{logId}": { + "get": { + "summary": "Get log", + "operationId": "sitesGetLog", + "tags": [ + "sites" + ], + "description": "Get a site request log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "x-appwrite": { + "method": "getLog", + "group": "logs", + "weight": 421, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site request log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<LOG_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete log", + "operationId": "sitesDeleteLog", + "tags": [ + "sites" + ], + "description": "Delete a site log by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteLog", + "group": "logs", + "weight": 423, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<LOG_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/usage": { + "get": { + "summary": "Get site usage", + "operationId": "sitesGetUsage", + "tags": [ + "sites" + ], + "description": "Get usage metrics and statistics for a for a specific site. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageSite", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageSite" + } + } + } + } + }, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 432, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for a for a specific site. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "SiteUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "sitesListVariables", + "tags": [ + "sites" + ], + "description": "Get a list of all variables of a specific site.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 426, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "sitesCreateVariable", + "tags": [ + "sites" + ], + "description": "Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 424, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "sitesGetVariable", + "tags": [ + "sites" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 425, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "sitesUpdateVariable", + "tags": [ + "sites" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 427, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete variable", + "operationId": "sitesDeleteVariable", + "tags": [ + "sites" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 428, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets": { + "get": { + "summary": "List buckets", + "operationId": "storageListBuckets", + "tags": [ + "storage" + ], + "description": "Get a list of all the storage buckets. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Buckets List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucketList" + } + } + } + } + }, + "x-appwrite": { + "method": "listBuckets", + "group": "buckets", + "weight": 209, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/list-buckets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create bucket", + "operationId": "storageCreateBucket", + "tags": [ + "storage" + ], + "description": "Create a new storage bucket.", + "responses": { + "201": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "x-appwrite": { + "method": "createBucket", + "group": "buckets", + "weight": 208, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/create-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<BUCKET_ID>" + }, + "name": { + "type": "string", + "description": "Bucket name", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "x-example": false + } + }, + "required": [ + "bucketId", + "name" + ] + } + } + } + } + } + }, + "\/storage\/buckets\/{bucketId}": { + "get": { + "summary": "Get bucket", + "operationId": "storageGetBucket", + "tags": [ + "storage" + ], + "description": "Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.", + "responses": { + "200": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "x-appwrite": { + "method": "getBucket", + "group": "buckets", + "weight": 210, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/get-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update bucket", + "operationId": "storageUpdateBucket", + "tags": [ + "storage" + ], + "description": "Update a storage bucket by its unique ID.", + "responses": { + "200": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "x-appwrite": { + "method": "updateBucket", + "group": "buckets", + "weight": 211, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/update-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Bucket name", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete bucket", + "operationId": "storageDeleteBucket", + "tags": [ + "storage" + ], + "description": "Delete a storage bucket by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteBucket", + "group": "buckets", + "weight": 212, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/delete-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files": { + "get": { + "summary": "List files", + "operationId": "storageListFiles", + "tags": [ + "storage" + ], + "description": "Get a list of all the user files. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Files List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/fileList" + } + } + } + } + }, + "x-appwrite": { + "method": "listFiles", + "group": "files", + "weight": 214, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file", + "operationId": "storageCreateFile", + "tags": [ + "storage" + ], + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "x-appwrite": { + "method": "createFile", + "group": "files", + "weight": 213, + "cookies": false, + "type": "upload", + "deprecated": false, + "demo": "storage\/create-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "fileId": { + "type": "string", + "description": "File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<FILE_ID>", + "x-upload-id": true + }, + "file": { + "type": "string", + "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", + "x-example": null + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "fileId", + "file" + ] + } + } + } + } + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "Get file", + "operationId": "storageGetFile", + "tags": [ + "storage" + ], + "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "x-appwrite": { + "method": "getFile", + "group": "files", + "weight": 215, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update file", + "operationId": "storageUpdateFile", + "tags": [ + "storage" + ], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "x-appwrite": { + "method": "updateFile", + "group": "files", + "weight": 220, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/update-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the file", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete file", + "operationId": "storageDeleteFile", + "tags": [ + "storage" + ], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteFile", + "group": "files", + "weight": 221, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/delete-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download": { + "get": { + "summary": "Get file for download", + "operationId": "storageGetFileDownload", + "tags": [ + "storage" + ], + "description": "Get a 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.", + "responses": { + "200": { + "description": "File" + } + }, + "x-appwrite": { + "method": "getFileDownload", + "group": "files", + "weight": 217, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/preview": { + "get": { + "summary": "Get file preview", + "operationId": "storageGetFilePreview", + "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. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getFilePreview", + "group": "files", + "weight": 216, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "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, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "schema": { + "type": "string", + "x-example": "center", + "enum": [ + "center", + "top-left", + "top", + "top-right", + "left", + "right", + "bottom-left", + "bottom", + "bottom-right" + ], + "x-enum-name": "ImageGravity", + "x-enum-keys": [], + "default": "center" + }, + "in": "query" + }, + { + "name": "quality", + "description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + }, + { + "name": "borderWidth", + "description": "Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "borderColor", + "description": "Preview image border color. Use a valid HEX color, no # is needed for prefix.", + "required": false, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + }, + { + "name": "borderRadius", + "description": "Preview image border radius in pixels. Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "opacity", + "description": "Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "x-example": 0, + "default": 1 + }, + "in": "query" + }, + { + "name": "rotation", + "description": "Preview image rotation in degrees. Pass an integer between -360 and 360.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -360, + "default": 0 + }, + "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, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "schema": { + "type": "string", + "x-example": "jpg", + "enum": [ + "jpg", + "jpeg", + "png", + "webp", + "heic", + "avif", + "gif" + ], + "x-enum-name": "ImageFormat", + "x-enum-keys": [], + "default": "" + }, + "in": "query" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/view": { + "get": { + "summary": "Get file for view", + "operationId": "storageGetFileView", + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.", + "responses": { + "200": { + "description": "File" + } + }, + "x-appwrite": { + "method": "getFileView", + "group": "files", + "weight": 218, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/usage": { + "get": { + "summary": "Get storage usage stats", + "operationId": "storageGetUsage", + "tags": [ + "storage" + ], + "description": "Get usage metrics and statistics for all buckets in the project. You can view the total number of buckets, files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", + "responses": { + "200": { + "description": "StorageUsage", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageStorage" + } + } + } + } + }, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 222, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "StorageUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/storage\/{bucketId}\/usage": { + "get": { + "summary": "Get bucket usage stats", + "operationId": "storageGetBucketUsage", + "tags": [ + "storage" + ], + "description": "Get usage metrics and statistics a specific bucket in the project. You can view the total number of files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", + "responses": { + "200": { + "description": "UsageBuckets", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageBuckets" + } + } + } + } + }, + "x-appwrite": { + "method": "getBucketUsage", + "group": null, + "weight": 223, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/get-bucket-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "StorageUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/teams": { + "get": { + "summary": "List teams", + "operationId": "teamsList", + "tags": [ + "teams" + ], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.", + "responses": { + "200": { + "description": "Teams List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/teamList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "group": "teams", + "weight": 225, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team", + "operationId": "teamsCreate", + "tags": [ + "teams" + ], + "description": "Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "x-appwrite": { + "method": "create", + "group": "teams", + "weight": 224, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<TEAM_ID>" + }, + "name": { + "type": "string", + "description": "Team name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "roles": { + "type": "array", + "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](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "teamId", + "name" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}": { + "get": { + "summary": "Get team", + "operationId": "teamsGet", + "tags": [ + "teams" + ], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "teams", + "weight": 226, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update name", + "operationId": "teamsUpdateName", + "tags": [ + "teams" + ], + "description": "Update the team's name by its unique ID.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "teams", + "weight": 228, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "New team name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team", + "operationId": "teamsDelete", + "tags": [ + "teams" + ], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "teams", + "weight": 230, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/logs": { + "get": { + "summary": "List team logs", + "operationId": "teamsListLogs", + "tags": [ + "teams" + ], + "description": "Get the team activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 237, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/teams\/{teamId}\/memberships": { + "get": { + "summary": "List team memberships", + "operationId": "teamsListMemberships", + "tags": [ + "teams" + ], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Memberships List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membershipList" + } + } + } + } + }, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 232, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team membership", + "operationId": "teamsCreateMembership", + "tags": [ + "teams" + ], + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", + "responses": { + "201": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "x-appwrite": { + "method": "createMembership", + "group": "memberships", + "weight": 231, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/create-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the new team member.", + "x-example": "email@example.com" + }, + "userId": { + "type": "string", + "description": "ID of the user to be added to a team.", + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "roles": { + "type": "array", + "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](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", + "x-example": "https:\/\/example.com" + }, + "name": { + "type": "string", + "description": "Name of the new team member. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "roles" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}": { + "get": { + "summary": "Get team membership", + "operationId": "teamsGetMembership", + "tags": [ + "teams" + ], + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "x-appwrite": { + "method": "getMembership", + "group": "memberships", + "weight": 233, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/get-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update membership", + "operationId": "teamsUpdateMembership", + "tags": [ + "teams" + ], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMembership", + "group": "memberships", + "weight": 234, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "roles": { + "type": "array", + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "roles" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team membership", + "operationId": "teamsDeleteMembership", + "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 it is not accepted.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMembership", + "group": "memberships", + "weight": 236, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}\/status": { + "patch": { + "summary": "Update team membership status", + "operationId": "teamsUpdateMembershipStatus", + "tags": [ + "teams" + ], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMembershipStatus", + "group": "memberships", + "weight": 235, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/prefs": { + "get": { + "summary": "Get team preferences", + "operationId": "teamsGetPrefs", + "tags": [ + "teams" + ], + "description": "Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getPrefs).", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "teams", + "weight": 227, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update preferences", + "operationId": "teamsUpdatePrefs", + "tags": [ + "teams" + ], + "description": "Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "teams", + "weight": 229, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceTokenList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "group": "files", + "weight": 441, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "group": "files", + "weight": 439, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "x-example": null, + "x-nullable": true + } + } + } + } + } + } + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "tokens", + "weight": 440, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "update", + "group": "tokens", + "weight": 442, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "x-example": null, + "x-nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "tokens", + "weight": 443, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users": { + "get": { + "summary": "List users", + "operationId": "usersList", + "tags": [ + "users" + ], + "description": "Get a list of all the project's users. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Users List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/userList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "group": "users", + "weight": 247, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create user", + "operationId": "usersCreate", + "tags": [ + "users" + ], + "description": "Create a new user.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "create", + "group": "users", + "weight": 238, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "Plain text user password. Must be at least 8 chars.", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId" + ] + } + } + } + } + } + }, + "\/users\/argon2": { + "post": { + "summary": "Create user with Argon2 password", + "operationId": "usersCreateArgon2User", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Argon2](https:\/\/en.wikipedia.org\/wiki\/Argon2) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "createArgon2User", + "group": "users", + "weight": 241, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-argon2user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-argon2-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Argon2.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/bcrypt": { + "post": { + "summary": "Create user with bcrypt password", + "operationId": "usersCreateBcryptUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Bcrypt](https:\/\/en.wikipedia.org\/wiki\/Bcrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "createBcryptUser", + "group": "users", + "weight": 239, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-bcrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-bcrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Bcrypt.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/identities": { + "get": { + "summary": "List identities", + "operationId": "usersListIdentities", + "tags": [ + "users" + ], + "description": "Get identities for all users.", + "responses": { + "200": { + "description": "Identities List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/identityList" + } + } + } + } + }, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 255, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/users\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "usersDeleteIdentity", + "tags": [ + "users" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 278, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<IDENTITY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/md5": { + "post": { + "summary": "Create user with MD5 password", + "operationId": "usersCreateMD5User", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [MD5](https:\/\/en.wikipedia.org\/wiki\/MD5) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "createMD5User", + "group": "users", + "weight": 240, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-m-d5user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-md5-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using MD5.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/phpass": { + "post": { + "summary": "Create user with PHPass password", + "operationId": "usersCreatePHPassUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [PHPass](https:\/\/www.openwall.com\/phpass\/) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "createPHPassUser", + "group": "users", + "weight": 243, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-p-h-pass-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-phpass-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using PHPass.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/scrypt": { + "post": { + "summary": "Create user with Scrypt password", + "operationId": "usersCreateScryptUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt](https:\/\/github.com\/Tarsnap\/scrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "createScryptUser", + "group": "users", + "weight": 244, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-scrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt.", + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Optional salt used to hash password.", + "x-example": "<PASSWORD_SALT>" + }, + "passwordCpu": { + "type": "integer", + "description": "Optional CPU cost used to hash password.", + "x-example": null + }, + "passwordMemory": { + "type": "integer", + "description": "Optional memory cost used to hash password.", + "x-example": null + }, + "passwordParallel": { + "type": "integer", + "description": "Optional parallelization cost used to hash password.", + "x-example": null + }, + "passwordLength": { + "type": "integer", + "description": "Optional hash length used to hash password.", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordCpu", + "passwordMemory", + "passwordParallel", + "passwordLength" + ] + } + } + } + } + } + }, + "\/users\/scrypt-modified": { + "post": { + "summary": "Create user with Scrypt modified password", + "operationId": "usersCreateScryptModifiedUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt Modified](https:\/\/gist.github.com\/Meldiron\/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "createScryptModifiedUser", + "group": "users", + "weight": 245, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-scrypt-modified-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-modified-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt Modified.", + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Salt used to hash password.", + "x-example": "<PASSWORD_SALT>" + }, + "passwordSaltSeparator": { + "type": "string", + "description": "Salt separator used to hash password.", + "x-example": "<PASSWORD_SALT_SEPARATOR>" + }, + "passwordSignerKey": { + "type": "string", + "description": "Signer key used to hash password.", + "x-example": "<PASSWORD_SIGNER_KEY>" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordSaltSeparator", + "passwordSignerKey" + ] + } + } + } + } + } + }, + "\/users\/sha": { + "post": { + "summary": "Create user with SHA password", + "operationId": "usersCreateSHAUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [SHA](https:\/\/en.wikipedia.org\/wiki\/Secure_Hash_Algorithm) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "createSHAUser", + "group": "users", + "weight": 242, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-s-h-a-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-sha-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using SHA.", + "x-example": "password" + }, + "passwordVersion": { + "type": "string", + "description": "Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512\/224', 'sha512\/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'", + "x-example": "sha1", + "enum": [ + "sha1", + "sha224", + "sha256", + "sha384", + "sha512\/224", + "sha512\/256", + "sha512", + "sha3-224", + "sha3-256", + "sha3-384", + "sha3-512" + ], + "x-enum-name": "PasswordHash", + "x-enum-keys": [] + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/usage": { + "get": { + "summary": "Get users usage stats", + "operationId": "usersGetUsage", + "tags": [ + "users" + ], + "description": "Get usage metrics and statistics for all users in the project. You can view the total number of users and sessions. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", + "responses": { + "200": { + "description": "UsageUsers", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/usageUsers" + } + } + } + } + }, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 280, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "schema": { + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UserUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d" + }, + "in": "query" + } + ] + } + }, + "\/users\/{userId}": { + "get": { + "summary": "Get user", + "operationId": "usersGet", + "tags": [ + "users" + ], + "description": "Get a user by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "users", + "weight": 248, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user", + "operationId": "usersDelete", + "tags": [ + "users" + ], + "description": "Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https:\/\/appwrite.io\/docs\/server\/users#usersUpdateStatus) endpoint instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "users", + "weight": 276, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/email": { + "patch": { + "summary": "Update email", + "operationId": "usersUpdateEmail", + "tags": [ + "users" + ], + "description": "Update the user email by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateEmail", + "group": "users", + "weight": 261, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + } + }, + "required": [ + "email" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/jwts": { + "post": { + "summary": "Create user JWT", + "operationId": "usersCreateJWT", + "tags": [ + "users" + ], + "description": "Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "x-appwrite": { + "method": "createJWT", + "group": "sessions", + "weight": 279, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user-jwt.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "sessionId": { + "type": "string", + "description": "Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.", + "x-example": "<SESSION_ID>" + }, + "duration": { + "type": "integer", + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "x-example": 0 + } + } + } + } + } + } + } + }, + "\/users\/{userId}\/labels": { + "put": { + "summary": "Update user labels", + "operationId": "usersUpdateLabels", + "tags": [ + "users" + ], + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateLabels", + "group": "users", + "weight": 257, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-labels.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-labels.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "labels": { + "type": "array", + "description": "Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "labels" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/logs": { + "get": { + "summary": "List user logs", + "operationId": "usersListLogs", + "tags": [ + "users" + ], + "description": "Get the user activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 253, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/memberships": { + "get": { + "summary": "List user memberships", + "operationId": "usersListMemberships", + "tags": [ + "users" + ], + "description": "Get the user membership list by its unique ID.", + "responses": { + "200": { + "description": "Memberships List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membershipList" + } + } + } + } + }, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 252, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-memberships.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "usersUpdateMfa", + "tags": [ + "users" + ], + "description": "Enable or disable MFA on a user account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfa", + "group": "users", + "weight": 266, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-mfa.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/mfa\/authenticators\/{type}": { + "delete": { + "summary": "Delete authenticator", + "operationId": "usersDeleteMfaAuthenticator", + "tags": [ + "users" + ], + "description": "Delete an authenticator app.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 271, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "usersListMfaFactors", + "tags": [ + "users" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 267, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/recovery-codes": { + "get": { + "summary": "Get MFA recovery codes", + "operationId": "usersGetMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 268, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "usersUpdateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 270, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Create MFA recovery codes", + "operationId": "usersCreateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 269, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/name": { + "patch": { + "summary": "Update name", + "operationId": "usersUpdateName", + "tags": [ + "users" + ], + "description": "Update the user name by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "users", + "weight": 259, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/password": { + "patch": { + "summary": "Update password", + "operationId": "usersUpdatePassword", + "tags": [ + "users" + ], + "description": "Update the user password by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePassword", + "group": "users", + "weight": 260, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "x-example": null + } + }, + "required": [ + "password" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "usersUpdatePhone", + "tags": [ + "users" + ], + "description": "Update the user phone by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePhone", + "group": "users", + "weight": 262, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "User phone number.", + "x-example": "+12065550100" + } + }, + "required": [ + "number" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/prefs": { + "get": { + "summary": "Get user preferences", + "operationId": "usersGetPrefs", + "tags": [ + "users" + ], + "description": "Get the user preferences by its unique ID.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "users", + "weight": 249, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user preferences", + "operationId": "usersUpdatePrefs", + "tags": [ + "users" + ], + "description": "Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "users", + "weight": 264, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/sessions": { + "get": { + "summary": "List user sessions", + "operationId": "usersListSessions", + "tags": [ + "users" + ], + "description": "Get the user sessions list by its unique ID.", + "responses": { + "200": { + "description": "Sessions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/sessionList" + } + } + } + } + }, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 251, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create session", + "operationId": "usersCreateSession", + "tags": [ + "users" + ], + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 272, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user sessions", + "operationId": "usersDeleteSessions", + "tags": [ + "users" + ], + "description": "Delete all user's sessions by using the user's unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 275, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/sessions\/{sessionId}": { + "delete": { + "summary": "Delete user session", + "operationId": "usersDeleteSession", + "tags": [ + "users" + ], + "description": "Delete a user sessions by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 274, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "sessionId", + "description": "Session ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SESSION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/status": { + "patch": { + "summary": "Update user status", + "operationId": "usersUpdateStatus", + "tags": [ + "users" + ], + "description": "Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateStatus", + "group": "users", + "weight": 256, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "User Status. To activate the user pass `true` and to block the user pass `false`.", + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/targets": { + "get": { + "summary": "List user targets", + "operationId": "usersListTargets", + "tags": [ + "users" + ], + "description": "List the messaging targets that are associated with a user.", + "responses": { + "200": { + "description": "Target list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/targetList" + } + } + } + } + }, + "x-appwrite": { + "method": "listTargets", + "group": "targets", + "weight": 254, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create user target", + "operationId": "usersCreateTarget", + "tags": [ + "users" + ], + "description": "Create a messaging target.", + "responses": { + "201": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "x-appwrite": { + "method": "createTarget", + "group": "targets", + "weight": 246, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<TARGET_ID>" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email", + "enum": [ + "email", + "sms", + "push" + ], + "x-enum-name": "MessagingProviderType", + "x-enum-keys": [] + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "x-example": "<NAME>" + } + }, + "required": [ + "targetId", + "providerType", + "identifier" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/targets\/{targetId}": { + "get": { + "summary": "Get user target", + "operationId": "usersGetTarget", + "tags": [ + "users" + ], + "description": "Get a user's push notification target by ID.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "x-appwrite": { + "method": "getTarget", + "group": "targets", + "weight": 250, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/get-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TARGET_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user target", + "operationId": "usersUpdateTarget", + "tags": [ + "users" + ], + "description": "Update a messaging target.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "x-appwrite": { + "method": "updateTarget", + "group": "targets", + "weight": 265, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TARGET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "x-example": "<NAME>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete user target", + "operationId": "usersDeleteTarget", + "tags": [ + "users" + ], + "description": "Delete a messaging target.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteTarget", + "group": "targets", + "weight": 277, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TARGET_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/tokens": { + "post": { + "summary": "Create token", + "operationId": "usersCreateToken", + "tags": [ + "users" + ], + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createToken", + "group": "sessions", + "weight": 273, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-token.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "length": { + "type": "integer", + "description": "Token length in characters. The default length is 6 characters", + "x-example": 4 + }, + "expire": { + "type": "integer", + "description": "Token expiration period in seconds. The default expiration is 15 minutes.", + "x-example": 60 + } + } + } + } + } + } + } + }, + "\/users\/{userId}\/verification": { + "patch": { + "summary": "Update email verification", + "operationId": "usersUpdateEmailVerification", + "tags": [ + "users" + ], + "description": "Update the user email verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateEmailVerification", + "group": "users", + "weight": 263, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-email-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "emailVerification": { + "type": "boolean", + "description": "User email verification status.", + "x-example": false + } + }, + "required": [ + "emailVerification" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/verification\/phone": { + "patch": { + "summary": "Update phone verification", + "operationId": "usersUpdatePhoneVerification", + "tags": [ + "users" + ], + "description": "Update the user phone verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "users", + "weight": 258, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phoneVerification": { + "type": "boolean", + "description": "User phone verification status.", + "x-example": false + } + }, + "required": [ + "phoneVerification" + ] + } + } + } + } + } + }, + "\/vcs\/github\/installations\/{installationId}\/detections": { + "post": { + "summary": "Create repository detection", + "operationId": "vcsCreateRepositoryDetection", + "tags": [ + "vcs" + ], + "description": "Analyze a GitHub repository to automatically detect the programming language and runtime environment. This endpoint scans the repository's files and language statistics to determine the appropriate runtime settings for your function. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", + "responses": { + "200": { + "description": "DetectionFramework", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/detectionFramework" + } + } + } + } + }, + "x-appwrite": { + "method": "createRepositoryDetection", + "group": "repositories", + "weight": 284, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/create-repository-detection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository-detection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerRepositoryId": { + "type": "string", + "description": "Repository Id", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "type": { + "type": "string", + "description": "Detector type. Must be one of the following: runtime, framework", + "x-example": "runtime", + "enum": [ + "runtime", + "framework" + ], + "x-enum-name": "VCSDetectionType", + "x-enum-keys": [] + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to Root Directory", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + } + }, + "required": [ + "providerRepositoryId", + "type" + ] + } + } + } + } + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories": { + "get": { + "summary": "List repositories", + "operationId": "vcsListRepositories", + "tags": [ + "vcs" + ], + "description": "Get a list of GitHub repositories available through your installation. This endpoint returns repositories with their basic information, detected runtime environments, and latest push dates. You can optionally filter repositories using a search term. Each repository's runtime is automatically detected based on its contents and language statistics. The GitHub installation must be properly configured for this endpoint to work.", + "responses": { + "200": { + "description": "Framework Provider Repositories List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/providerRepositoryFrameworkList" + } + } + } + } + }, + "x-appwrite": { + "method": "listRepositories", + "group": "repositories", + "weight": 285, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/list-repositories.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repositories.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Detector type. Must be one of the following: runtime, framework", + "required": true, + "schema": { + "type": "string", + "x-example": "runtime", + "enum": [ + "runtime", + "framework" + ], + "x-enum-name": "VCSDetectionType", + "x-enum-keys": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create repository", + "operationId": "vcsCreateRepository", + "tags": [ + "vcs" + ], + "description": "Create a new GitHub repository through your installation. This endpoint allows you to create either a public or private repository by specifying a name and visibility setting. The repository will be created under your GitHub user account or organization, depending on your installation type. The GitHub installation must be properly configured and have the necessary permissions for repository creation.", + "responses": { + "200": { + "description": "ProviderRepository", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/providerRepository" + } + } + } + } + }, + "x-appwrite": { + "method": "createRepository", + "group": "repositories", + "weight": 286, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/create-repository.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Repository name (slug)", + "x-example": "<NAME>" + }, + "private": { + "type": "boolean", + "description": "Mark repository public or private", + "x-example": false + } + }, + "required": [ + "name", + "private" + ] + } + } + } + } + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories\/{providerRepositoryId}": { + "get": { + "summary": "Get repository", + "operationId": "vcsGetRepository", + "tags": [ + "vcs" + ], + "description": "Get detailed information about a specific GitHub repository from your installation. This endpoint returns repository details including its ID, name, visibility status, organization, and latest push date. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.", + "responses": { + "200": { + "description": "ProviderRepository", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/providerRepository" + } + } + } + } + }, + "x-appwrite": { + "method": "getRepository", + "group": "repositories", + "weight": 287, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/get-repository.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "providerRepositoryId", + "description": "Repository Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories\/{providerRepositoryId}\/branches": { + "get": { + "summary": "List repository branches", + "operationId": "vcsListRepositoryBranches", + "tags": [ + "vcs" + ], + "description": "Get a list of all branches from a GitHub repository in your installation. This endpoint returns the names of all branches in the repository and their total count. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.\n", + "responses": { + "200": { + "description": "Branches List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/branchList" + } + } + } + } + }, + "x-appwrite": { + "method": "listRepositoryBranches", + "group": "repositories", + "weight": 288, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/list-repository-branches.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repository-branches.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "providerRepositoryId", + "description": "Repository Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories\/{providerRepositoryId}\/contents": { + "get": { + "summary": "Get files and directories of a VCS repository", + "operationId": "vcsGetRepositoryContents", + "tags": [ + "vcs" + ], + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.\n", + "responses": { + "200": { + "description": "VCS Content List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/vcsContentList" + } + } + } + } + }, + "x-appwrite": { + "method": "getRepositoryContents", + "group": "repositories", + "weight": 283, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/get-repository-contents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository-contents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "providerRepositoryId", + "description": "Repository Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "in": "path" + }, + { + "name": "providerRootDirectory", + "description": "Path to get contents of nested directory", + "required": false, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ROOT_DIRECTORY>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/repositories\/{repositoryId}": { + "patch": { + "summary": "Update external deployment (authorize)", + "operationId": "vcsUpdateExternalDeployments", + "tags": [ + "vcs" + ], + "description": "Authorize and create deployments for a GitHub pull request in your project. This endpoint allows external contributions by creating deployments from pull requests, enabling preview environments for code review. The pull request must be open and not previously authorized. The GitHub installation must be properly configured and have access to both the repository and pull request for this endpoint to work.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "updateExternalDeployments", + "group": "repositories", + "weight": 293, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/update-external-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/update-external-deployments.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + }, + { + "name": "repositoryId", + "description": "VCS Repository Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<REPOSITORY_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerPullRequestId": { + "type": "string", + "description": "GitHub Pull Request Id", + "x-example": "<PROVIDER_PULL_REQUEST_ID>" + } + }, + "required": [ + "providerPullRequestId" + ] + } + } + } + } + } + }, + "\/vcs\/installations": { + "get": { + "summary": "List installations", + "operationId": "vcsListInstallations", + "tags": [ + "vcs" + ], + "description": "List all VCS installations configured for the current project. This endpoint returns a list of installations including their provider, organization, and other configuration details.\n", + "responses": { + "200": { + "description": "Installations List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/installationList" + } + } + } + } + }, + "x-appwrite": { + "method": "listInstallations", + "group": "installations", + "weight": 290, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/list-installations.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-installations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: provider, organization", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/vcs\/installations\/{installationId}": { + "get": { + "summary": "Get installation", + "operationId": "vcsGetInstallation", + "tags": [ + "vcs" + ], + "description": "Get a VCS installation by its unique ID. This endpoint returns the installation's details including its provider, organization, and configuration. ", + "responses": { + "200": { + "description": "Installation", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/installation" + } + } + } + } + }, + "x-appwrite": { + "method": "getInstallation", + "group": "installations", + "weight": 291, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/get-installation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-installation.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete installation", + "operationId": "vcsDeleteInstallation", + "tags": [ + "vcs" + ], + "description": "Delete a VCS installation by its unique ID. This endpoint removes the installation and all its associated repositories from the project.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteInstallation", + "group": "installations", + "weight": 292, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/delete-installation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/delete-installation.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "schema": { + "type": "string", + "x-example": "<INSTALLATION_ID>" + }, + "in": "path" + } + ] + } + } + }, + "tags": [ + { + "name": "account", + "description": "The Account service allows you to authenticate and manage a user account." + }, + { + "name": "avatars", + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + }, + { + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" + }, + { + "name": "locale", + "description": "The Locale service allows you to customize your app based on your users' location." + }, + { + "name": "health", + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." + }, + { + "name": "projects", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "project", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "storage", + "description": "The Storage service allows you to manage your project files." + }, + { + "name": "teams", + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" + }, + { + "name": "users", + "description": "The Users service allows you to manage your project users." + }, + { + "name": "sites", + "description": "The Sites Service allows you view, create and manage your web applications." + }, + { + "name": "functions", + "description": "The Functions Service allows you view, create and manage your Cloud Functions." + }, + { + "name": "proxy", + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." + }, + { + "name": "graphql", + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." + }, + { + "name": "console", + "description": "The Console service allows you to interact with console relevant informations." + }, + { + "name": "migrations", + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." + }, + { + "name": "messaging", + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." + } + ], + "components": { + "schemas": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true + }, + "error": { + "description": "Error", + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Error message.", + "x-example": "Not found" + }, + "code": { + "type": "string", + "description": "Error code.", + "x-example": "404" + }, + "type": { + "type": "string", + "description": "Error type. You can learn more about all the error types at https:\/\/appwrite.io\/docs\/error-codes#errorTypes", + "x-example": "not_found" + }, + "version": { + "type": "string", + "description": "Server version number.", + "x-example": "1.0" + } + }, + "required": [ + "message", + "code", + "type", + "version" + ] + }, + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { + "$ref": "#\/components\/schemas\/document" + }, + "x-example": "" + } + }, + "required": [ + "total", + "documents" + ] + }, + "collectionList": { + "description": "Collections List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of collections documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "collections": { + "type": "array", + "description": "List of collections.", + "items": { + "$ref": "#\/components\/schemas\/collection" + }, + "x-example": "" + } + }, + "required": [ + "total", + "collections" + ] + }, + "databaseList": { + "description": "Databases List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of databases documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "databases": { + "type": "array", + "description": "List of databases.", + "items": { + "$ref": "#\/components\/schemas\/database" + }, + "x-example": "" + } + }, + "required": [ + "total", + "databases" + ] + }, + "indexList": { + "description": "Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "$ref": "#\/components\/schemas\/index" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ] + }, + "userList": { + "description": "Users List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of users documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "users": { + "type": "array", + "description": "List of users.", + "items": { + "$ref": "#\/components\/schemas\/user" + }, + "x-example": "" + } + }, + "required": [ + "total", + "users" + ] + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { + "$ref": "#\/components\/schemas\/session" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sessions" + ] + }, + "identityList": { + "description": "Identities List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of identities documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "identities": { + "type": "array", + "description": "List of identities.", + "items": { + "$ref": "#\/components\/schemas\/identity" + }, + "x-example": "" + } + }, + "required": [ + "total", + "identities" + ] + }, + "logList": { + "description": "Logs List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of logs documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "logs": { + "type": "array", + "description": "List of logs.", + "items": { + "$ref": "#\/components\/schemas\/log" + }, + "x-example": "" + } + }, + "required": [ + "total", + "logs" + ] + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { + "$ref": "#\/components\/schemas\/file" + }, + "x-example": "" + } + }, + "required": [ + "total", + "files" + ] + }, + "bucketList": { + "description": "Buckets List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of buckets documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "buckets": { + "type": "array", + "description": "List of buckets.", + "items": { + "$ref": "#\/components\/schemas\/bucket" + }, + "x-example": "" + } + }, + "required": [ + "total", + "buckets" + ] + }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "$ref": "#\/components\/schemas\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { + "$ref": "#\/components\/schemas\/team" + }, + "x-example": "" + } + }, + "required": [ + "total", + "teams" + ] + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { + "$ref": "#\/components\/schemas\/membership" + }, + "x-example": "" + } + }, + "required": [ + "total", + "memberships" + ] + }, + "siteList": { + "description": "Sites List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sites documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sites": { + "type": "array", + "description": "List of sites.", + "items": { + "$ref": "#\/components\/schemas\/site" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sites" + ] + }, + "templateSiteList": { + "description": "Site Templates List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of templates documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "templates": { + "type": "array", + "description": "List of templates.", + "items": { + "$ref": "#\/components\/schemas\/templateSite" + }, + "x-example": "" + } + }, + "required": [ + "total", + "templates" + ] + }, + "functionList": { + "description": "Functions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of functions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "functions": { + "type": "array", + "description": "List of functions.", + "items": { + "$ref": "#\/components\/schemas\/function" + }, + "x-example": "" + } + }, + "required": [ + "total", + "functions" + ] + }, + "templateFunctionList": { + "description": "Function Templates List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of templates documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "templates": { + "type": "array", + "description": "List of templates.", + "items": { + "$ref": "#\/components\/schemas\/templateFunction" + }, + "x-example": "" + } + }, + "required": [ + "total", + "templates" + ] + }, + "installationList": { + "description": "Installations List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of installations documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "installations": { + "type": "array", + "description": "List of installations.", + "items": { + "$ref": "#\/components\/schemas\/installation" + }, + "x-example": "" + } + }, + "required": [ + "total", + "installations" + ] + }, + "providerRepositoryFrameworkList": { + "description": "Framework Provider Repositories List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of frameworkProviderRepositories documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "frameworkProviderRepositories": { + "type": "array", + "description": "List of frameworkProviderRepositories.", + "items": { + "$ref": "#\/components\/schemas\/providerRepositoryFramework" + }, + "x-example": "" + } + }, + "required": [ + "total", + "frameworkProviderRepositories" + ] + }, + "providerRepositoryRuntimeList": { + "description": "Runtime Provider Repositories List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimeProviderRepositories documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "runtimeProviderRepositories": { + "type": "array", + "description": "List of runtimeProviderRepositories.", + "items": { + "$ref": "#\/components\/schemas\/providerRepositoryRuntime" + }, + "x-example": "" + } + }, + "required": [ + "total", + "runtimeProviderRepositories" + ] + }, + "branchList": { + "description": "Branches List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of branches documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "branches": { + "type": "array", + "description": "List of branches.", + "items": { + "$ref": "#\/components\/schemas\/branch" + }, + "x-example": "" + } + }, + "required": [ + "total", + "branches" + ] + }, + "frameworkList": { + "description": "Frameworks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of frameworks documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "frameworks": { + "type": "array", + "description": "List of frameworks.", + "items": { + "$ref": "#\/components\/schemas\/framework" + }, + "x-example": "" + } + }, + "required": [ + "total", + "frameworks" + ] + }, + "runtimeList": { + "description": "Runtimes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "runtimes": { + "type": "array", + "description": "List of runtimes.", + "items": { + "$ref": "#\/components\/schemas\/runtime" + }, + "x-example": "" + } + }, + "required": [ + "total", + "runtimes" + ] + }, + "deploymentList": { + "description": "Deployments List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of deployments documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "List of deployments.", + "items": { + "$ref": "#\/components\/schemas\/deployment" + }, + "x-example": "" + } + }, + "required": [ + "total", + "deployments" + ] + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { + "$ref": "#\/components\/schemas\/execution" + }, + "x-example": "" + } + }, + "required": [ + "total", + "executions" + ] + }, + "projectList": { + "description": "Projects List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of projects documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "projects": { + "type": "array", + "description": "List of projects.", + "items": { + "$ref": "#\/components\/schemas\/project" + }, + "x-example": "" + } + }, + "required": [ + "total", + "projects" + ] + }, + "webhookList": { + "description": "Webhooks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of webhooks documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "webhooks": { + "type": "array", + "description": "List of webhooks.", + "items": { + "$ref": "#\/components\/schemas\/webhook" + }, + "x-example": "" + } + }, + "required": [ + "total", + "webhooks" + ] + }, + "keyList": { + "description": "API Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of keys documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "keys": { + "type": "array", + "description": "List of keys.", + "items": { + "$ref": "#\/components\/schemas\/key" + }, + "x-example": "" + } + }, + "required": [ + "total", + "keys" + ] + }, + "devKeyList": { + "description": "Dev Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of devKeys documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "devKeys": { + "type": "array", + "description": "List of devKeys.", + "items": { + "$ref": "#\/components\/schemas\/devKey" + }, + "x-example": "" + } + }, + "required": [ + "total", + "devKeys" + ] + }, + "platformList": { + "description": "Platforms List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of platforms documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "platforms": { + "type": "array", + "description": "List of platforms.", + "items": { + "$ref": "#\/components\/schemas\/platform" + }, + "x-example": "" + } + }, + "required": [ + "total", + "platforms" + ] + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { + "$ref": "#\/components\/schemas\/country" + }, + "x-example": "" + } + }, + "required": [ + "total", + "countries" + ] + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { + "$ref": "#\/components\/schemas\/continent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "continents" + ] + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { + "$ref": "#\/components\/schemas\/language" + }, + "x-example": "" + } + }, + "required": [ + "total", + "languages" + ] + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { + "$ref": "#\/components\/schemas\/currency" + }, + "x-example": "" + } + }, + "required": [ + "total", + "currencies" + ] + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { + "$ref": "#\/components\/schemas\/phone" + }, + "x-example": "" + } + }, + "required": [ + "total", + "phones" + ] + }, + "variableList": { + "description": "Variables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of variables documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "variables": { + "type": "array", + "description": "List of variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "x-example": "" + } + }, + "required": [ + "total", + "variables" + ] + }, + "proxyRuleList": { + "description": "Rule List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rules documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rules": { + "type": "array", + "description": "List of rules.", + "items": { + "$ref": "#\/components\/schemas\/proxyRule" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rules" + ] + }, + "localeCodeList": { + "description": "Locale codes list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of localeCodes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "localeCodes": { + "type": "array", + "description": "List of localeCodes.", + "items": { + "$ref": "#\/components\/schemas\/localeCode" + }, + "x-example": "" + } + }, + "required": [ + "total", + "localeCodes" + ] + }, + "providerList": { + "description": "Provider list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of providers documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "providers": { + "type": "array", + "description": "List of providers.", + "items": { + "$ref": "#\/components\/schemas\/provider" + }, + "x-example": "" + } + }, + "required": [ + "total", + "providers" + ] + }, + "messageList": { + "description": "Message list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of messages documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "messages": { + "type": "array", + "description": "List of messages.", + "items": { + "$ref": "#\/components\/schemas\/message" + }, + "x-example": "" + } + }, + "required": [ + "total", + "messages" + ] + }, + "topicList": { + "description": "Topic list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of topics documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "topics": { + "type": "array", + "description": "List of topics.", + "items": { + "$ref": "#\/components\/schemas\/topic" + }, + "x-example": "" + } + }, + "required": [ + "total", + "topics" + ] + }, + "subscriberList": { + "description": "Subscriber list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of subscribers documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "subscribers": { + "type": "array", + "description": "List of subscribers.", + "items": { + "$ref": "#\/components\/schemas\/subscriber" + }, + "x-example": "" + } + }, + "required": [ + "total", + "subscribers" + ] + }, + "targetList": { + "description": "Target list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of targets documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "targets": { + "type": "array", + "description": "List of targets.", + "items": { + "$ref": "#\/components\/schemas\/target" + }, + "x-example": "" + } + }, + "required": [ + "total", + "targets" + ] + }, + "migrationList": { + "description": "Migrations List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of migrations documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "migrations": { + "type": "array", + "description": "List of migrations.", + "items": { + "$ref": "#\/components\/schemas\/migration" + }, + "x-example": "" + } + }, + "required": [ + "total", + "migrations" + ] + }, + "specificationList": { + "description": "Specifications List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of specifications documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "specifications": { + "type": "array", + "description": "List of specifications.", + "items": { + "$ref": "#\/components\/schemas\/specification" + }, + "x-example": "" + } + }, + "required": [ + "total", + "specifications" + ] + }, + "vcsContentList": { + "description": "VCS Content List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of contents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "contents": { + "type": "array", + "description": "List of contents.", + "items": { + "$ref": "#\/components\/schemas\/vcsContent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "contents" + ] + }, + "database": { + "description": "Database", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Database name.", + "x-example": "My Database" + }, + "$createdAt": { + "type": "string", + "description": "Database creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Database update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "enabled": { + "type": "boolean", + "description": "If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + } + }, + "required": [ + "$id", + "name", + "$createdAt", + "$updatedAt", + "enabled" + ] + }, + "collection": { + "description": "Collection", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Collection creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Collection update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Collection permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Collection name.", + "x-example": "My Collection" + }, + "enabled": { + "type": "boolean", + "description": "Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "documentSecurity": { + "type": "boolean", + "description": "Whether document-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "attributes": { + "type": "array", + "description": "Collection attributes.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Collection indexes.", + "items": { + "$ref": "#\/components\/schemas\/index" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "documentSecurity", + "attributes", + "indexes" + ] + }, + "attributeList": { + "description": "Attributes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of attributes in the given collection.", + "x-example": 5, + "format": "int32" + }, + "attributes": { + "type": "array", + "description": "List of attributes.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "attributes" + ] + }, + "attributeString": { + "description": "AttributeString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Attribute size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ] + }, + "attributeInteger": { + "description": "AttributeInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 10, + "format": "int32", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ] + }, + "attributeFloat": { + "description": "AttributeFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "nullable": true + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 2.5, + "format": "double", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ] + }, + "attributeBoolean": { + "description": "AttributeBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ] + }, + "attributeEmail": { + "description": "AttributeEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default@example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeEnum": { + "description": "AttributeEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "element", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ] + }, + "attributeIp": { + "description": "AttributeIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "192.0.2.0", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeUrl": { + "description": "AttributeURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "http:\/\/example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeDatetime": { + "description": "AttributeDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeRelationship": { + "description": "AttributeRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedCollection": { + "type": "string", + "description": "The ID of the related collection.", + "x-example": "collection" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedCollection", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ] + }, + "index": { + "description": "Index", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "attributes": { + "type": "array", + "description": "Index attributes.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index attributes length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "attributes", + "lengths", + "$createdAt", + "$updatedAt" + ] + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, + "$collectionId": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c15117e" + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e" + }, + "$createdAt": { + "type": "string", + "description": "Document creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Document update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Document permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$collectionId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ] + }, + "log": { + "description": "Log", + "type": "object", + "properties": { + "event": { + "type": "string", + "description": "Event name.", + "x-example": "account.sessions.create" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "610fc2f985ee0" + }, + "userEmail": { + "type": "string", + "description": "User Email.", + "x-example": "john@appwrite.io" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "John Doe" + }, + "mode": { + "type": "string", + "description": "API mode when event triggered.", + "x-example": "admin" + }, + "ip": { + "type": "string", + "description": "IP session in use when the session was created.", + "x-example": "127.0.0.1" + }, + "time": { + "type": "string", + "description": "Log creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "event", + "userId", + "userEmail", + "userName", + "mode", + "ip", + "time", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName" + ] + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "User creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "User update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "User name.", + "x-example": "John Doe" + }, + "password": { + "type": "string", + "description": "Hashed user password.", + "x-example": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "nullable": true + }, + "hash": { + "type": "string", + "description": "Password hashing algorithm.", + "x-example": "argon2", + "nullable": true + }, + "hashOptions": { + "type": "object", + "description": "Password hashing algorithm configuration.", + "x-example": {}, + "items": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/algoArgon2" + }, + { + "$ref": "#\/components\/schemas\/algoScrypt" + }, + { + "$ref": "#\/components\/schemas\/algoScryptModified" + }, + { + "$ref": "#\/components\/schemas\/algoBcrypt" + }, + { + "$ref": "#\/components\/schemas\/algoPhpass" + }, + { + "$ref": "#\/components\/schemas\/algoSha" + }, + { + "$ref": "#\/components\/schemas\/algoMd5" + } + ] + }, + "nullable": true + }, + "registration": { + "type": "string", + "description": "User registration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "x-example": true + }, + "labels": { + "type": "array", + "description": "Labels for the user.", + "items": { + "type": "string" + }, + "x-example": [ + "vip" + ] + }, + "passwordUpdate": { + "type": "string", + "description": "Password update time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "email": { + "type": "string", + "description": "User email address.", + "x-example": "john@appwrite.io" + }, + "phone": { + "type": "string", + "description": "User phone number in E.164 format.", + "x-example": "+4930901820" + }, + "emailVerification": { + "type": "boolean", + "description": "Email verification status.", + "x-example": true + }, + "phoneVerification": { + "type": "boolean", + "description": "Phone verification status.", + "x-example": true + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status.", + "x-example": true + }, + "prefs": { + "type": "object", + "description": "User preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "$ref": "#\/components\/schemas\/preferences" + } + }, + "targets": { + "type": "array", + "description": "A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.", + "items": { + "$ref": "#\/components\/schemas\/target" + }, + "x-example": [] + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "registration", + "status", + "labels", + "passwordUpdate", + "email", + "phone", + "emailVerification", + "phoneVerification", + "mfa", + "prefs", + "targets", + "accessedAt" + ] + }, + "algoMd5": { + "description": "AlgoMD5", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "md5" + } + }, + "required": [ + "type" + ] + }, + "algoSha": { + "description": "AlgoSHA", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "sha" + } + }, + "required": [ + "type" + ] + }, + "algoPhpass": { + "description": "AlgoPHPass", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "phpass" + } + }, + "required": [ + "type" + ] + }, + "algoBcrypt": { + "description": "AlgoBcrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "bcrypt" + } + }, + "required": [ + "type" + ] + }, + "algoScrypt": { + "description": "AlgoScrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scrypt" + }, + "costCpu": { + "type": "integer", + "description": "CPU complexity of computed hash.", + "x-example": 8, + "format": "int32" + }, + "costMemory": { + "type": "integer", + "description": "Memory complexity of computed hash.", + "x-example": 14, + "format": "int32" + }, + "costParallel": { + "type": "integer", + "description": "Parallelization of computed hash.", + "x-example": 1, + "format": "int32" + }, + "length": { + "type": "integer", + "description": "Length used to compute hash.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "type", + "costCpu", + "costMemory", + "costParallel", + "length" + ] + }, + "algoScryptModified": { + "description": "AlgoScryptModified", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scryptMod" + }, + "salt": { + "type": "string", + "description": "Salt used to compute hash.", + "x-example": "UxLMreBr6tYyjQ==" + }, + "saltSeparator": { + "type": "string", + "description": "Separator used to compute hash.", + "x-example": "Bw==" + }, + "signerKey": { + "type": "string", + "description": "Key used to compute hash.", + "x-example": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "required": [ + "type", + "salt", + "saltSeparator", + "signerKey" + ] + }, + "algoArgon2": { + "description": "AlgoArgon2", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "argon2" + }, + "memoryCost": { + "type": "integer", + "description": "Memory used to compute hash.", + "x-example": 65536, + "format": "int32" + }, + "timeCost": { + "type": "integer", + "description": "Amount of time consumed to compute hash", + "x-example": 4, + "format": "int32" + }, + "threads": { + "type": "integer", + "description": "Number of threads used to compute hash.", + "x-example": 3, + "format": "int32" + } + }, + "required": [ + "type", + "memoryCost", + "timeCost", + "threads" + ] + }, + "preferences": { + "description": "Preferences", + "type": "object", + "additionalProperties": true + }, + "session": { + "description": "Session", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Session ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Session creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Session update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "expire": { + "type": "string", + "description": "Session expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "Session Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "Session Provider User ID.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "x-example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "x-example": true + }, + "factors": { + "type": "array", + "description": "Returns a list of active session factors.", + "items": { + "type": "string" + }, + "x-example": [ + "email" + ] + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate the user. Only included if the request was made with an API key", + "x-example": "5e5bb8c16897e" + }, + "mfaUpdatedAt": { + "type": "string", + "description": "Most recent date in ISO 8601 format when the session successfully passed MFA challenge.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "ip", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName", + "current", + "factors", + "secret", + "mfaUpdatedAt" + ] + }, + "identity": { + "description": "Identity", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Identity ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Identity creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Identity update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "provider": { + "type": "string", + "description": "Identity Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "ID of the User in the Identity Provider.", + "x-example": "5e5bb8c16897e" + }, + "providerEmail": { + "type": "string", + "description": "Email of the User in the Identity Provider.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Identity Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Identity Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "provider", + "providerUid", + "providerEmail", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken" + ] + }, + "token": { + "description": "Token", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "secret": { + "type": "string", + "description": "Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "phrase": { + "type": "string", + "description": "Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.", + "x-example": "Golden Fox" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "secret", + "expire", + "phrase" + ] + }, + "jwt": { + "description": "JWT", + "type": "object", + "properties": { + "jwt": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "required": [ + "jwt" + ] + }, + "locale": { + "description": "Locale", + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "User IP address.", + "x-example": "127.0.0.1" + }, + "countryCode": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format", + "x-example": "US" + }, + "country": { + "type": "string", + "description": "Country name. This field support localization.", + "x-example": "United States" + }, + "continentCode": { + "type": "string", + "description": "Continent code. A two character continent code \"AF\" for Africa, \"AN\" for Antarctica, \"AS\" for Asia, \"EU\" for Europe, \"NA\" for North America, \"OC\" for Oceania, and \"SA\" for South America.", + "x-example": "NA" + }, + "continent": { + "type": "string", + "description": "Continent name. This field support localization.", + "x-example": "North America" + }, + "eu": { + "type": "boolean", + "description": "True if country is part of the European Union.", + "x-example": false + }, + "currency": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format", + "x-example": "USD" + } + }, + "required": [ + "ip", + "countryCode", + "country", + "continentCode", + "continent", + "eu", + "currency" + ] + }, + "localeCode": { + "description": "LocaleCode", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes)", + "x-example": "en-us" + }, + "name": { + "type": "string", + "description": "Locale name", + "x-example": "US" + } + }, + "required": [ + "code", + "name" + ] + }, + "file": { + "description": "File", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "File ID.", + "x-example": "5e5ea5c16897e" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "File creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "File update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "File permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "name": { + "type": "string", + "description": "File name.", + "x-example": "Pink.png" + }, + "signature": { + "type": "string", + "description": "File MD5 signature.", + "x-example": "5d529fd02b544198ae075bd57c1762bb" + }, + "mimeType": { + "type": "string", + "description": "File mime type.", + "x-example": "image\/png" + }, + "sizeOriginal": { + "type": "integer", + "description": "File original size in bytes.", + "x-example": 17890, + "format": "int32" + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "x-example": 17890, + "format": "int32" + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "x-example": 17890, + "format": "int32" + } + }, + "required": [ + "$id", + "bucketId", + "$createdAt", + "$updatedAt", + "$permissions", + "name", + "signature", + "mimeType", + "sizeOriginal", + "chunksTotal", + "chunksUploaded" + ] + }, + "bucket": { + "description": "Bucket", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Bucket creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Bucket update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Bucket permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "fileSecurity": { + "type": "boolean", + "description": "Whether file-level security is enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "name": { + "type": "string", + "description": "Bucket name.", + "x-example": "Documents" + }, + "enabled": { + "type": "boolean", + "description": "Bucket enabled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size supported.", + "x-example": 100, + "format": "int32" + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions.", + "items": { + "type": "string" + }, + "x-example": [ + "jpg", + "png" + ] + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "x-example": "gzip" + }, + "encryption": { + "type": "boolean", + "description": "Bucket is encrypted.", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Virus scanning is enabled.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "fileSecurity", + "name", + "enabled", + "maximumFileSize", + "allowedFileExtensions", + "compression", + "encryption", + "antivirus" + ] + }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "files" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceType", + "expire", + "secret", + "accessedAt" + ] + }, + "team": { + "description": "Team", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Team creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Team update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "x-example": 7, + "format": "int32" + }, + "prefs": { + "type": "object", + "description": "Team preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "$ref": "#\/components\/schemas\/preferences" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "total", + "prefs" + ] + }, + "membership": { + "description": "Membership", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Membership ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Membership creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Membership update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "John Doe" + }, + "userEmail": { + "type": "string", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "john@appwrite.io" + }, + "teamId": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "teamName": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "invited": { + "type": "string", + "description": "Date, the user has been invited to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "joined": { + "type": "string", + "description": "Date, the user has accepted the invitation to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "confirm": { + "type": "boolean", + "description": "User confirmation status, true if the user has joined the team or false otherwise.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", + "x-example": false + }, + "roles": { + "type": "array", + "description": "User list of roles", + "items": { + "type": "string" + }, + "x-example": [ + "owner" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "userName", + "userEmail", + "teamId", + "teamName", + "invited", + "joined", + "confirm", + "mfa", + "roles" + ] + }, + "site": { + "description": "Site", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Site ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Site creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Site update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Site name.", + "x-example": "My Site" + }, + "enabled": { + "type": "boolean", + "description": "Site enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "framework": { + "type": "string", + "description": "Site framework.", + "x-example": "react" + }, + "deploymentId": { + "type": "string", + "description": "Site's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "deploymentScreenshotLight": { + "type": "string", + "description": "Screenshot of active deployment with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentScreenshotDark": { + "type": "string", + "description": "Screenshot of active deployment with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentId": { + "type": "string", + "description": "Site's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "vars": { + "type": "array", + "description": "Site variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "x-example": [] + }, + "timeout": { + "type": "integer", + "description": "Site request timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "installCommand": { + "type": "string", + "description": "The install command used to install the site dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "The build command used to build the site.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "The directory where the site build output is located.", + "x-example": "build" + }, + "installationId": { + "type": "string", + "description": "Site VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site in VCS (Version Control System) repository", + "x-example": "sites\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + }, + "buildRuntime": { + "type": "string", + "description": "Site build runtime.", + "x-example": "node-22" + }, + "adapter": { + "type": "string", + "description": "Site framework adapter.", + "x-example": "static" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "enabled", + "live", + "logging", + "framework", + "deploymentId", + "deploymentCreatedAt", + "deploymentScreenshotLight", + "deploymentScreenshotDark", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "vars", + "timeout", + "installCommand", + "buildCommand", + "outputDirectory", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification", + "buildRuntime", + "adapter", + "fallbackFile" + ] + }, + "templateSite": { + "description": "Template Site", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Site Template ID.", + "x-example": "starter" + }, + "name": { + "type": "string", + "description": "Site Template Name.", + "x-example": "Starter site" + }, + "tagline": { + "type": "string", + "description": "Short description of template", + "x-example": "Minimal web app integrating with Appwrite." + }, + "demoUrl": { + "type": "string", + "description": "URL hosting a template demo.", + "x-example": "https:\/\/nextjs-starter.appwrite.network\/" + }, + "screenshotDark": { + "type": "string", + "description": "File URL with preview screenshot in dark theme preference.", + "x-example": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png" + }, + "screenshotLight": { + "type": "string", + "description": "File URL with preview screenshot in light theme preference.", + "x-example": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png" + }, + "useCases": { + "type": "array", + "description": "Site use cases.", + "items": { + "type": "string" + }, + "x-example": "Starter" + }, + "frameworks": { + "type": "array", + "description": "List of frameworks that can be used with this template.", + "items": { + "$ref": "#\/components\/schemas\/templateFramework" + }, + "x-example": [] + }, + "vcsProvider": { + "type": "string", + "description": "VCS (Version Control System) Provider.", + "x-example": "github" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "templates" + }, + "providerOwner": { + "type": "string", + "description": "VCS (Version Control System) Owner.", + "x-example": "appwrite" + }, + "providerVersion": { + "type": "string", + "description": "VCS (Version Control System) branch version (tag).", + "x-example": "main" + }, + "variables": { + "type": "array", + "description": "Site variables.", + "items": { + "$ref": "#\/components\/schemas\/templateVariable" + }, + "x-example": [] + } + }, + "required": [ + "key", + "name", + "tagline", + "demoUrl", + "screenshotDark", + "screenshotLight", + "useCases", + "frameworks", + "vcsProvider", + "providerRepositoryId", + "providerOwner", + "providerVersion", + "variables" + ] + }, + "templateFramework": { + "description": "Template Framework", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Parent framework key.", + "x-example": "sveltekit" + }, + "name": { + "type": "string", + "description": "Framework Name.", + "x-example": "SvelteKit" + }, + "installCommand": { + "type": "string", + "description": "The install command used to install the dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "The output directory to store the build output.", + "x-example": ".\/build" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site in VCS (Version Control System) repository", + "x-example": ".\/svelte-kit\/starter" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime used during build step of template.", + "x-example": "node-22" + }, + "adapter": { + "type": "string", + "description": "Site framework runtime", + "x-example": "ssr" + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for SPA. Only relevant for static serve runtime.", + "x-example": "index.html" + } + }, + "required": [ + "key", + "name", + "installCommand", + "buildCommand", + "outputDirectory", + "providerRootDirectory", + "buildRuntime", + "adapter", + "fallbackFile" + ] + }, + "function": { + "description": "Function", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Function creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Function update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "execute": { + "type": "array", + "description": "Execution permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + }, + "name": { + "type": "string", + "description": "Function name.", + "x-example": "My Function" + }, + "enabled": { + "type": "boolean", + "description": "Function enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "runtime": { + "type": "string", + "description": "Function execution and build runtime.", + "x-example": "python-3.8" + }, + "deploymentId": { + "type": "string", + "description": "Function's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentId": { + "type": "string", + "description": "Function's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + }, + "vars": { + "type": "array", + "description": "Function variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "x-example": [] + }, + "events": { + "type": "array", + "description": "Function trigger events.", + "items": { + "type": "string" + }, + "x-example": "account.create" + }, + "schedule": { + "type": "string", + "description": "Function execution schedule in CRON format.", + "x-example": "5 4 * * *" + }, + "timeout": { + "type": "integer", + "description": "Function execution timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file used to execute the deployment.", + "x-example": "index.js" + }, + "commands": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm install" + }, + "version": { + "type": "string", + "description": "Version of Open Runtimes used for the function.", + "x-example": "v2" + }, + "installationId": { + "type": "string", + "description": "Function VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function in VCS (Version Control System) repository", + "x-example": "functions\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "execute", + "name", + "enabled", + "live", + "logging", + "runtime", + "deploymentId", + "deploymentCreatedAt", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "scopes", + "vars", + "events", + "schedule", + "timeout", + "entrypoint", + "commands", + "version", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification" + ] + }, + "templateFunction": { + "description": "Template Function", + "type": "object", + "properties": { + "icon": { + "type": "string", + "description": "Function Template Icon.", + "x-example": "icon-lightning-bolt" + }, + "id": { + "type": "string", + "description": "Function Template ID.", + "x-example": "starter" + }, + "name": { + "type": "string", + "description": "Function Template Name.", + "x-example": "Starter function" + }, + "tagline": { + "type": "string", + "description": "Function Template Tagline.", + "x-example": "A simple function to get started." + }, + "permissions": { + "type": "array", + "description": "Execution permissions.", + "items": { + "type": "string" + }, + "x-example": "any" + }, + "events": { + "type": "array", + "description": "Function trigger events.", + "items": { + "type": "string" + }, + "x-example": "account.create" + }, + "cron": { + "type": "string", + "description": "Function execution schedult in CRON format.", + "x-example": "0 0 * * *" + }, + "timeout": { + "type": "integer", + "description": "Function execution timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "useCases": { + "type": "array", + "description": "Function use cases.", + "items": { + "type": "string" + }, + "x-example": "Starter" + }, + "runtimes": { + "type": "array", + "description": "List of runtimes that can be used with this template.", + "items": { + "$ref": "#\/components\/schemas\/templateRuntime" + }, + "x-example": [] + }, + "instructions": { + "type": "string", + "description": "Function Template Instructions.", + "x-example": "For documentation and instructions check out <link>." + }, + "vcsProvider": { + "type": "string", + "description": "VCS (Version Control System) Provider.", + "x-example": "github" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "templates" + }, + "providerOwner": { + "type": "string", + "description": "VCS (Version Control System) Owner.", + "x-example": "appwrite" + }, + "providerVersion": { + "type": "string", + "description": "VCS (Version Control System) branch version (tag).", + "x-example": "main" + }, + "variables": { + "type": "array", + "description": "Function variables.", + "items": { + "$ref": "#\/components\/schemas\/templateVariable" + }, + "x-example": [] + }, + "scopes": { + "type": "array", + "description": "Function scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + } + }, + "required": [ + "icon", + "id", + "name", + "tagline", + "permissions", + "events", + "cron", + "timeout", + "useCases", + "runtimes", + "instructions", + "vcsProvider", + "providerRepositoryId", + "providerOwner", + "providerVersion", + "variables", + "scopes" + ] + }, + "templateRuntime": { + "description": "Template Runtime", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Runtime Name.", + "x-example": "node-19.0" + }, + "commands": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm install" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file used to execute the deployment.", + "x-example": "index.js" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function in VCS (Version Control System) repository", + "x-example": "node\/starter" + } + }, + "required": [ + "name", + "commands", + "entrypoint", + "providerRootDirectory" + ] + }, + "templateVariable": { + "description": "Template Variable", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Variable Name.", + "x-example": "APPWRITE_DATABASE_ID" + }, + "description": { + "type": "string", + "description": "Variable Description.", + "x-example": "The ID of the Appwrite database that contains the collection to sync." + }, + "value": { + "type": "string", + "description": "Variable Value.", + "x-example": "512" + }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, + "placeholder": { + "type": "string", + "description": "Variable Placeholder.", + "x-example": "64a55...7b912" + }, + "required": { + "type": "boolean", + "description": "Is the variable required?", + "x-example": false + }, + "type": { + "type": "string", + "description": "Variable Type.", + "x-example": "password" + } + }, + "required": [ + "name", + "description", + "value", + "secret", + "placeholder", + "required", + "type" + ] + }, + "installation": { + "description": "Installation", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Function creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Function update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name.", + "x-example": "appwrite" + }, + "providerInstallationId": { + "type": "string", + "description": "VCS (Version Control System) installation ID.", + "x-example": "5322" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "provider", + "organization", + "providerInstallationId" + ] + }, + "providerRepository": { + "description": "ProviderRepository", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VCS (Version Control System) repository ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) repository name.", + "x-example": "appwrite" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name", + "x-example": "appwrite" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "private": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository private?", + "x-example": true + }, + "pushedAt": { + "type": "string", + "description": "Last commit date in ISO 8601 format.", + "x-example": "datetime" + } + }, + "required": [ + "id", + "name", + "organization", + "provider", + "private", + "pushedAt" + ] + }, + "providerRepositoryFramework": { + "description": "ProviderRepositoryFramework", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VCS (Version Control System) repository ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) repository name.", + "x-example": "appwrite" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name", + "x-example": "appwrite" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "private": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository private?", + "x-example": true + }, + "pushedAt": { + "type": "string", + "description": "Last commit date in ISO 8601 format.", + "x-example": "datetime" + }, + "framework": { + "type": "string", + "description": "Auto-detected framework. Empty if type is not \"framework\".", + "x-example": "nextjs" + } + }, + "required": [ + "id", + "name", + "organization", + "provider", + "private", + "pushedAt", + "framework" + ] + }, + "providerRepositoryRuntime": { + "description": "ProviderRepositoryRuntime", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VCS (Version Control System) repository ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) repository name.", + "x-example": "appwrite" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name", + "x-example": "appwrite" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "private": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository private?", + "x-example": true + }, + "pushedAt": { + "type": "string", + "description": "Last commit date in ISO 8601 format.", + "x-example": "datetime" + }, + "runtime": { + "type": "string", + "description": "Auto-detected runtime. Empty if type is not \"runtime\".", + "x-example": "node-22" + } + }, + "required": [ + "id", + "name", + "organization", + "provider", + "private", + "pushedAt", + "runtime" + ] + }, + "detectionFramework": { + "description": "DetectionFramework", + "type": "object", + "properties": { + "framework": { + "type": "string", + "description": "Framework", + "x-example": "nuxt" + }, + "installCommand": { + "type": "string", + "description": "Site Install Command", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "Site Build Command", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "Site Output Directory", + "x-example": "dist" + } + }, + "required": [ + "framework", + "installCommand", + "buildCommand", + "outputDirectory" + ] + }, + "detectionRuntime": { + "description": "DetectionRuntime", + "type": "object", + "properties": { + "runtime": { + "type": "string", + "description": "Runtime", + "x-example": "node" + }, + "entrypoint": { + "type": "string", + "description": "Function Entrypoint", + "x-example": "index.js" + }, + "commands": { + "type": "string", + "description": "Function install and build commands", + "x-example": "npm install && npm run build" + } + }, + "required": [ + "runtime", + "entrypoint", + "commands" + ] + }, + "vcsContent": { + "description": "VcsContents", + "type": "object", + "properties": { + "size": { + "type": "integer", + "description": "Content size in bytes. Only files have size, and for directories, 0 is returned.", + "x-example": 1523, + "format": "int32", + "nullable": true + }, + "isDirectory": { + "type": "boolean", + "description": "If a content is a directory. Directories can be used to check nested contents.", + "x-example": true, + "nullable": true + }, + "name": { + "type": "string", + "description": "Name of directory or file.", + "x-example": "Main.java" + } + }, + "required": [ + "name" + ] + }, + "branch": { + "description": "Branch", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Branch Name.", + "x-example": "main" + } + }, + "required": [ + "name" + ] + }, + "runtime": { + "description": "Runtime", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Runtime ID.", + "x-example": "python-3.8" + }, + "key": { + "type": "string", + "description": "Parent runtime key.", + "x-example": "python" + }, + "name": { + "type": "string", + "description": "Runtime Name.", + "x-example": "Python" + }, + "version": { + "type": "string", + "description": "Runtime version.", + "x-example": "3.8" + }, + "base": { + "type": "string", + "description": "Base Docker image used to build the runtime.", + "x-example": "python:3.8-alpine" + }, + "image": { + "type": "string", + "description": "Image name of Docker Hub.", + "x-example": "appwrite\\\/runtime-for-python:3.8" + }, + "logo": { + "type": "string", + "description": "Name of the logo image.", + "x-example": "python.png" + }, + "supports": { + "type": "array", + "description": "List of supported architectures.", + "items": { + "type": "string" + }, + "x-example": "amd64" + } + }, + "required": [ + "$id", + "key", + "name", + "version", + "base", + "image", + "logo", + "supports" + ] + }, + "framework": { + "description": "Framework", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Framework key.", + "x-example": "sveltekit" + }, + "name": { + "type": "string", + "description": "Framework Name.", + "x-example": "SvelteKit" + }, + "buildRuntime": { + "type": "string", + "description": "Default runtime version.", + "x-example": "node-22" + }, + "runtimes": { + "type": "array", + "description": "List of supported runtime versions.", + "items": { + "type": "string" + }, + "x-example": [ + "static-1", + "node-22" + ] + }, + "adapters": { + "type": "array", + "description": "List of supported adapters.", + "items": { + "$ref": "#\/components\/schemas\/frameworkAdapter" + }, + "x-example": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "required": [ + "key", + "name", + "buildRuntime", + "runtimes", + "adapters" + ] + }, + "frameworkAdapter": { + "description": "Framework Adapter", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Adapter key.", + "x-example": "static" + }, + "installCommand": { + "type": "string", + "description": "Default command to download dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "Default command to build site into output directory.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "Default output directory of build.", + "x-example": ".\/dist" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "key", + "installCommand", + "buildCommand", + "outputDirectory", + "fallbackFile" + ] + }, + "deployment": { + "description": "Deployment", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Deployment update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "type": { + "type": "string", + "description": "Type of deployment.", + "x-example": "vcs" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea6g16897e" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "functions" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file to use to execute the deployment code.", + "x-example": "index.js" + }, + "sourceSize": { + "type": "integer", + "description": "The code size in bytes.", + "x-example": 128, + "format": "int32" + }, + "buildSize": { + "type": "integer", + "description": "The build output size in bytes.", + "x-example": 128, + "format": "int32" + }, + "totalSize": { + "type": "integer", + "description": "The total size in bytes (source and build output).", + "x-example": 128, + "format": "int32" + }, + "buildId": { + "type": "string", + "description": "The current build ID.", + "x-example": "5e5ea5c16897e" + }, + "activate": { + "type": "boolean", + "description": "Whether the deployment should be automatically activated.", + "x-example": true + }, + "screenshotLight": { + "type": "string", + "description": "Screenshot with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "screenshotDark": { + "type": "string", + "description": "Screenshot with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "status": { + "type": "string", + "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "buildLogs": { + "type": "string", + "description": "The build logs.", + "x-example": "Compiling source files..." + }, + "buildDuration": { + "type": "integer", + "description": "The current build time in seconds.", + "x-example": 128, + "format": "int32" + }, + "providerRepositoryName": { + "type": "string", + "description": "The name of the vcs provider repository", + "x-example": "database" + }, + "providerRepositoryOwner": { + "type": "string", + "description": "The name of the vcs provider repository owner", + "x-example": "utopia" + }, + "providerRepositoryUrl": { + "type": "string", + "description": "The url of the vcs provider repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" + }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, + "providerCommitHash": { + "type": "string", + "description": "The commit hash of the vcs commit", + "x-example": "7c3f25d" + }, + "providerCommitAuthorUrl": { + "type": "string", + "description": "The url of vcs commit author", + "x-example": "https:\/\/github.com\/vermakhushboo" + }, + "providerCommitAuthor": { + "type": "string", + "description": "The name of vcs commit author", + "x-example": "Khushboo Verma" + }, + "providerCommitMessage": { + "type": "string", + "description": "The commit message", + "x-example": "Update index.js" + }, + "providerCommitUrl": { + "type": "string", + "description": "The url of the vcs commit", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" + }, + "providerBranchUrl": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "type", + "resourceId", + "resourceType", + "entrypoint", + "sourceSize", + "buildSize", + "totalSize", + "buildId", + "activate", + "screenshotLight", + "screenshotDark", + "status", + "buildLogs", + "buildDuration", + "providerRepositoryName", + "providerRepositoryOwner", + "providerRepositoryUrl", + "providerBranch", + "providerCommitHash", + "providerCommitAuthorUrl", + "providerCommitAuthor", + "providerCommitMessage", + "providerCommitUrl", + "providerBranchUrl" + ] + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Execution creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Execution upate date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Execution roles.", + "items": { + "type": "string" + }, + "x-example": [ + "any" + ] + }, + "functionId": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea6g16897e" + }, + "trigger": { + "type": "string", + "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", + "x-example": "http" + }, + "status": { + "type": "string", + "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", + "x-example": "processing" + }, + "requestMethod": { + "type": "string", + "description": "HTTP request method type.", + "x-example": "GET" + }, + "requestPath": { + "type": "string", + "description": "HTTP request path and query.", + "x-example": "\/articles?id=5" + }, + "requestHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "responseStatusCode": { + "type": "integer", + "description": "HTTP response status code.", + "x-example": 200, + "format": "int32" + }, + "responseBody": { + "type": "string", + "description": "HTTP response body. This will return empty unless execution is created as synchronous.", + "x-example": "" + }, + "responseHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "logs": { + "type": "string", + "description": "Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "errors": { + "type": "string", + "description": "Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "duration": { + "type": "number", + "description": "Resource(function\/site) execution duration in seconds.", + "x-example": 0.4, + "format": "double" + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for execution. If left empty, execution will be queued immediately.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "functionId", + "trigger", + "status", + "requestMethod", + "requestPath", + "requestHeaders", + "responseStatusCode", + "responseBody", + "responseHeaders", + "logs", + "errors", + "duration" + ] + }, + "project": { + "description": "Project", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Project ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Project creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Project update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Project name.", + "x-example": "New Project" + }, + "description": { + "type": "string", + "description": "Project description.", + "x-example": "This is a new project." + }, + "teamId": { + "type": "string", + "description": "Project team ID.", + "x-example": "1592981250" + }, + "logo": { + "type": "string", + "description": "Project logo file ID.", + "x-example": "5f5c451b403cb" + }, + "url": { + "type": "string", + "description": "Project website URL.", + "x-example": "5f5c451b403cb" + }, + "legalName": { + "type": "string", + "description": "Company legal name.", + "x-example": "Company LTD." + }, + "legalCountry": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format.", + "x-example": "US" + }, + "legalState": { + "type": "string", + "description": "State name.", + "x-example": "New York" + }, + "legalCity": { + "type": "string", + "description": "City name.", + "x-example": "New York City." + }, + "legalAddress": { + "type": "string", + "description": "Company Address.", + "x-example": "620 Eighth Avenue, New York, NY 10018" + }, + "legalTaxId": { + "type": "string", + "description": "Company Tax ID.", + "x-example": "131102020" + }, + "authDuration": { + "type": "integer", + "description": "Session duration in seconds.", + "x-example": 60, + "format": "int32" + }, + "authLimit": { + "type": "integer", + "description": "Max users allowed. 0 is unlimited.", + "x-example": 100, + "format": "int32" + }, + "authSessionsLimit": { + "type": "integer", + "description": "Max sessions allowed per user. 100 maximum.", + "x-example": 10, + "format": "int32" + }, + "authPasswordHistory": { + "type": "integer", + "description": "Max allowed passwords in the history list per user. Max passwords limit allowed in history is 20. Use 0 for disabling password history.", + "x-example": 5, + "format": "int32" + }, + "authPasswordDictionary": { + "type": "boolean", + "description": "Whether or not to check user's password against most commonly used passwords.", + "x-example": true + }, + "authPersonalDataCheck": { + "type": "boolean", + "description": "Whether or not to check the user password for similarity with their personal data.", + "x-example": true + }, + "authMockNumbers": { + "type": "array", + "description": "An array of mock numbers and their corresponding verification codes (OTPs).", + "items": { + "$ref": "#\/components\/schemas\/mockNumber" + }, + "x-example": [ + {} + ] + }, + "authSessionAlerts": { + "type": "boolean", + "description": "Whether or not to send session alert emails to users.", + "x-example": true + }, + "authMembershipsUserName": { + "type": "boolean", + "description": "Whether or not to show user names in the teams membership response.", + "x-example": true + }, + "authMembershipsUserEmail": { + "type": "boolean", + "description": "Whether or not to show user emails in the teams membership response.", + "x-example": true + }, + "authMembershipsMfa": { + "type": "boolean", + "description": "Whether or not to show user MFA status in the teams membership response.", + "x-example": true + }, + "oAuthProviders": { + "type": "array", + "description": "List of Auth Providers.", + "items": { + "$ref": "#\/components\/schemas\/authProvider" + }, + "x-example": [ + {} + ] + }, + "platforms": { + "type": "array", + "description": "List of Platforms.", + "items": { + "$ref": "#\/components\/schemas\/platform" + }, + "x-example": {} + }, + "webhooks": { + "type": "array", + "description": "List of Webhooks.", + "items": { + "$ref": "#\/components\/schemas\/webhook" + }, + "x-example": {} + }, + "keys": { + "type": "array", + "description": "List of API Keys.", + "items": { + "$ref": "#\/components\/schemas\/key" + }, + "x-example": {} + }, + "devKeys": { + "type": "array", + "description": "List of dev keys.", + "items": { + "$ref": "#\/components\/schemas\/devKey" + }, + "x-example": {} + }, + "smtpEnabled": { + "type": "boolean", + "description": "Status for custom SMTP", + "x-example": false + }, + "smtpSenderName": { + "type": "string", + "description": "SMTP sender name", + "x-example": "John Appwrite" + }, + "smtpSenderEmail": { + "type": "string", + "description": "SMTP sender email", + "x-example": "john@appwrite.io" + }, + "smtpReplyTo": { + "type": "string", + "description": "SMTP reply to email", + "x-example": "support@appwrite.io" + }, + "smtpHost": { + "type": "string", + "description": "SMTP server host name", + "x-example": "mail.appwrite.io" + }, + "smtpPort": { + "type": "integer", + "description": "SMTP server port", + "x-example": 25, + "format": "int32" + }, + "smtpUsername": { + "type": "string", + "description": "SMTP server username", + "x-example": "emailuser" + }, + "smtpPassword": { + "type": "string", + "description": "SMTP server password", + "x-example": "securepassword" + }, + "smtpSecure": { + "type": "string", + "description": "SMTP server secure protocol", + "x-example": "tls" + }, + "pingCount": { + "type": "integer", + "description": "Number of times the ping was received for this project.", + "x-example": 1, + "format": "int32" + }, + "pingedAt": { + "type": "string", + "description": "Last ping datetime in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "authEmailPassword": { + "type": "boolean", + "description": "Email\/Password auth method status", + "x-example": true + }, + "authUsersAuthMagicURL": { + "type": "boolean", + "description": "Magic URL auth method status", + "x-example": true + }, + "authEmailOtp": { + "type": "boolean", + "description": "Email (OTP) auth method status", + "x-example": true + }, + "authAnonymous": { + "type": "boolean", + "description": "Anonymous auth method status", + "x-example": true + }, + "authInvites": { + "type": "boolean", + "description": "Invites auth method status", + "x-example": true + }, + "authJWT": { + "type": "boolean", + "description": "JWT auth method status", + "x-example": true + }, + "authPhone": { + "type": "boolean", + "description": "Phone auth method status", + "x-example": true + }, + "serviceStatusForAccount": { + "type": "boolean", + "description": "Account service status", + "x-example": true + }, + "serviceStatusForAvatars": { + "type": "boolean", + "description": "Avatars service status", + "x-example": true + }, + "serviceStatusForDatabases": { + "type": "boolean", + "description": "Databases service status", + "x-example": true + }, + "serviceStatusForLocale": { + "type": "boolean", + "description": "Locale service status", + "x-example": true + }, + "serviceStatusForHealth": { + "type": "boolean", + "description": "Health service status", + "x-example": true + }, + "serviceStatusForStorage": { + "type": "boolean", + "description": "Storage service status", + "x-example": true + }, + "serviceStatusForTeams": { + "type": "boolean", + "description": "Teams service status", + "x-example": true + }, + "serviceStatusForUsers": { + "type": "boolean", + "description": "Users service status", + "x-example": true + }, + "serviceStatusForSites": { + "type": "boolean", + "description": "Sites service status", + "x-example": true + }, + "serviceStatusForFunctions": { + "type": "boolean", + "description": "Functions service status", + "x-example": true + }, + "serviceStatusForGraphql": { + "type": "boolean", + "description": "GraphQL service status", + "x-example": true + }, + "serviceStatusForMessaging": { + "type": "boolean", + "description": "Messaging service status", + "x-example": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "description", + "teamId", + "logo", + "url", + "legalName", + "legalCountry", + "legalState", + "legalCity", + "legalAddress", + "legalTaxId", + "authDuration", + "authLimit", + "authSessionsLimit", + "authPasswordHistory", + "authPasswordDictionary", + "authPersonalDataCheck", + "authMockNumbers", + "authSessionAlerts", + "authMembershipsUserName", + "authMembershipsUserEmail", + "authMembershipsMfa", + "oAuthProviders", + "platforms", + "webhooks", + "keys", + "devKeys", + "smtpEnabled", + "smtpSenderName", + "smtpSenderEmail", + "smtpReplyTo", + "smtpHost", + "smtpPort", + "smtpUsername", + "smtpPassword", + "smtpSecure", + "pingCount", + "pingedAt", + "authEmailPassword", + "authUsersAuthMagicURL", + "authEmailOtp", + "authAnonymous", + "authInvites", + "authJWT", + "authPhone", + "serviceStatusForAccount", + "serviceStatusForAvatars", + "serviceStatusForDatabases", + "serviceStatusForLocale", + "serviceStatusForHealth", + "serviceStatusForStorage", + "serviceStatusForTeams", + "serviceStatusForUsers", + "serviceStatusForSites", + "serviceStatusForFunctions", + "serviceStatusForGraphql", + "serviceStatusForMessaging" + ] + }, + "webhook": { + "description": "Webhook", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Webhook ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Webhook creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Webhook update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Webhook name.", + "x-example": "My Webhook" + }, + "url": { + "type": "string", + "description": "Webhook URL endpoint.", + "x-example": "https:\/\/example.com\/webhook" + }, + "events": { + "type": "array", + "description": "Webhook trigger events.", + "items": { + "type": "string" + }, + "x-example": "database.collections.update" + }, + "security": { + "type": "boolean", + "description": "Indicated if SSL \/ TLS Certificate verification is enabled.", + "x-example": true + }, + "httpUser": { + "type": "string", + "description": "HTTP basic authentication username.", + "x-example": "username" + }, + "httpPass": { + "type": "string", + "description": "HTTP basic authentication password.", + "x-example": "password" + }, + "signatureKey": { + "type": "string", + "description": "Signature key which can be used to validated incoming", + "x-example": "ad3d581ca230e2b7059c545e5a" + }, + "enabled": { + "type": "boolean", + "description": "Indicates if this webhook is enabled.", + "x-example": true + }, + "logs": { + "type": "string", + "description": "Webhook error logs from the most recent failure.", + "x-example": "Failed to connect to remote server." + }, + "attempts": { + "type": "integer", + "description": "Number of consecutive failed webhook attempts.", + "x-example": 10, + "format": "int32" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "url", + "events", + "security", + "httpUser", + "httpPass", + "signatureKey", + "enabled", + "logs", + "attempts" + ] + }, + "key": { + "description": "Key", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "x-example": "My API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "x-example": "appwrite:flutter" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "scopes", + "secret", + "accessedAt", + "sdks" + ] + }, + "devKey": { + "description": "DevKey", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "x-example": "Dev API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "x-example": "appwrite:flutter" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "secret", + "accessedAt", + "sdks" + ] + }, + "mockNumber": { + "description": "Mock Number", + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS.", + "x-example": "+1612842323" + }, + "otp": { + "type": "string", + "description": "Mock OTP for the number. ", + "x-example": "123456" + } + }, + "required": [ + "phone", + "otp" + ] + }, + "authProvider": { + "description": "AuthProvider", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Auth Provider.", + "x-example": "github" + }, + "name": { + "type": "string", + "description": "Auth Provider name.", + "x-example": "GitHub" + }, + "appId": { + "type": "string", + "description": "OAuth 2.0 application ID.", + "x-example": "259125845563242502" + }, + "secret": { + "type": "string", + "description": "OAuth 2.0 application secret. Might be JSON string if provider requires extra configuration.", + "x-example": "Bpw_g9c2TGXxfgLshDbSaL8tsCcqgczQ" + }, + "enabled": { + "type": "boolean", + "description": "Auth Provider is active and can be used to create session.", + "x-example": "" + } + }, + "required": [ + "key", + "name", + "appId", + "secret", + "enabled" + ] + }, + "platform": { + "description": "Platform", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Platform ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Platform creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Platform update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Platform name.", + "x-example": "My Web App" + }, + "type": { + "type": "string", + "description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.", + "x-example": "web" + }, + "key": { + "type": "string", + "description": "Platform Key. iOS bundle ID or Android package name. Empty string for other platforms.", + "x-example": "com.company.appname" + }, + "store": { + "type": "string", + "description": "App store or Google Play store ID.", + "x-example": "" + }, + "hostname": { + "type": "string", + "description": "Web app hostname. Empty string for other platforms.", + "x-example": true + }, + "httpUser": { + "type": "string", + "description": "HTTP basic authentication username.", + "x-example": "username" + }, + "httpPass": { + "type": "string", + "description": "HTTP basic authentication password.", + "x-example": "password" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "type", + "key", + "store", + "hostname", + "httpUser", + "httpPass" + ] + }, + "variable": { + "description": "Variable", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Variable ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Variable key.", + "x-example": "API_KEY" + }, + "value": { + "type": "string", + "description": "Variable value.", + "x-example": "myPa$$word1" + }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, + "resourceType": { + "type": "string", + "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", + "x-example": "function" + }, + "resourceId": { + "type": "string", + "description": "ID of resource to which the variable belongs. If resourceType is \"project\", it is empty. If resourceType is \"function\", it is ID of the function.", + "x-example": "myAwesomeFunction" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "value", + "secret", + "resourceType", + "resourceId" + ] + }, + "country": { + "description": "Country", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "code": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + } + }, + "required": [ + "name", + "code" + ] + }, + "continent": { + "description": "Continent", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Continent name.", + "x-example": "Europe" + }, + "code": { + "type": "string", + "description": "Continent two letter code.", + "x-example": "EU" + } + }, + "required": [ + "name", + "code" + ] + }, + "language": { + "description": "Language", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Language name.", + "x-example": "Italian" + }, + "code": { + "type": "string", + "description": "Language two-character ISO 639-1 codes.", + "x-example": "it" + }, + "nativeName": { + "type": "string", + "description": "Language native name.", + "x-example": "Italiano" + } + }, + "required": [ + "name", + "code", + "nativeName" + ] + }, + "currency": { + "description": "Currency", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Currency symbol.", + "x-example": "$" + }, + "name": { + "type": "string", + "description": "Currency name.", + "x-example": "US dollar" + }, + "symbolNative": { + "type": "string", + "description": "Currency native symbol.", + "x-example": "$" + }, + "decimalDigits": { + "type": "integer", + "description": "Number of decimal digits.", + "x-example": 2, + "format": "int32" + }, + "rounding": { + "type": "number", + "description": "Currency digit rounding.", + "x-example": 0, + "format": "double" + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.", + "x-example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "x-example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ] + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "x-example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "code", + "countryCode", + "countryName" + ] + }, + "healthAntivirus": { + "description": "Health Antivirus", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Antivirus version.", + "x-example": "1.0.0" + }, + "status": { + "type": "string", + "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", + "x-example": "online" + } + }, + "required": [ + "version", + "status" + ] + }, + "healthQueue": { + "description": "Health Queue", + "type": "object", + "properties": { + "size": { + "type": "integer", + "description": "Amount of actions in the queue.", + "x-example": 8, + "format": "int32" + } + }, + "required": [ + "size" + ] + }, + "healthStatus": { + "description": "Health Status", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the service.", + "x-example": "database" + }, + "ping": { + "type": "integer", + "description": "Duration in milliseconds how long the health check took.", + "x-example": 128, + "format": "int32" + }, + "status": { + "type": "string", + "description": "Service status. Possible values can are: `pass`, `fail`", + "x-example": "pass" + } + }, + "required": [ + "name", + "ping", + "status" + ] + }, + "healthCertificate": { + "description": "Health Certificate", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Certificate name", + "x-example": "\/CN=www.google.com" + }, + "subjectSN": { + "type": "string", + "description": "Subject SN", + "x-example": "" + }, + "issuerOrganisation": { + "type": "string", + "description": "Issuer organisation", + "x-example": "" + }, + "validFrom": { + "type": "string", + "description": "Valid from", + "x-example": "1704200998" + }, + "validTo": { + "type": "string", + "description": "Valid to", + "x-example": "1711458597" + }, + "signatureTypeSN": { + "type": "string", + "description": "Signature type SN", + "x-example": "RSA-SHA256" + } + }, + "required": [ + "name", + "subjectSN", + "issuerOrganisation", + "validFrom", + "validTo", + "signatureTypeSN" + ] + }, + "healthTime": { + "description": "Health Time", + "type": "object", + "properties": { + "remoteTime": { + "type": "integer", + "description": "Current unix timestamp on trustful remote server.", + "x-example": 1639490751, + "format": "int32" + }, + "localTime": { + "type": "integer", + "description": "Current unix timestamp of local server where Appwrite runs.", + "x-example": 1639490844, + "format": "int32" + }, + "diff": { + "type": "integer", + "description": "Difference of unix remote and local timestamps in milliseconds.", + "x-example": 93, + "format": "int32" + } + }, + "required": [ + "remoteTime", + "localTime", + "diff" + ] + }, + "metric": { + "description": "Metric", + "type": "object", + "properties": { + "value": { + "type": "integer", + "description": "The value of this metric at the timestamp.", + "x-example": 1, + "format": "int32" + }, + "date": { + "type": "string", + "description": "The date at which this metric was aggregated in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "value", + "date" + ] + }, + "metricBreakdown": { + "description": "Metric Breakdown", + "type": "object", + "properties": { + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c16897e", + "nullable": true + }, + "name": { + "type": "string", + "description": "Resource name.", + "x-example": "Documents" + }, + "value": { + "type": "integer", + "description": "The value of this metric at the timestamp.", + "x-example": 1, + "format": "int32" + }, + "estimate": { + "type": "number", + "description": "The estimated value of this metric at the end of the period.", + "x-example": 1, + "format": "double", + "nullable": true + } + }, + "required": [ + "name", + "value" + ] + }, + "usageDatabases": { + "description": "UsageDatabases", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "databasesTotal": { + "type": "integer", + "description": "Total aggregated number of databases.", + "x-example": 0, + "format": "int32" + }, + "collectionsTotal": { + "type": "integer", + "description": "Total aggregated number of collections.", + "x-example": 0, + "format": "int32" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of documents.", + "x-example": 0, + "format": "int32" + }, + "storageTotal": { + "type": "integer", + "description": "Total aggregated number of total databases storage in bytes.", + "x-example": 0, + "format": "int32" + }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, + "databases": { + "type": "array", + "description": "Aggregated number of databases per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "collections": { + "type": "array", + "description": "Aggregated number of collections per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "documents": { + "type": "array", + "description": "Aggregated number of documents per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "An array of the aggregated number of databases storage in bytes per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "databasesTotal", + "collectionsTotal", + "documentsTotal", + "storageTotal", + "databasesReadsTotal", + "databasesWritesTotal", + "databases", + "collections", + "documents", + "storage", + "databasesReads", + "databasesWrites" + ] + }, + "usageDatabase": { + "description": "UsageDatabase", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "collectionsTotal": { + "type": "integer", + "description": "Total aggregated number of collections.", + "x-example": 0, + "format": "int32" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of documents.", + "x-example": 0, + "format": "int32" + }, + "storageTotal": { + "type": "integer", + "description": "Total aggregated number of total storage used in bytes.", + "x-example": 0, + "format": "int32" + }, + "databaseReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databaseWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, + "collections": { + "type": "array", + "description": "Aggregated number of collections per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "documents": { + "type": "array", + "description": "Aggregated number of documents per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "Aggregated storage used in bytes per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databaseReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databaseWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "collectionsTotal", + "documentsTotal", + "storageTotal", + "databaseReadsTotal", + "databaseWritesTotal", + "collections", + "documents", + "storage", + "databaseReads", + "databaseWrites" + ] + }, + "usageCollection": { + "description": "UsageCollection", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of of documents.", + "x-example": 0, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "Aggregated number of documents per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "documentsTotal", + "documents" + ] + }, + "usageUsers": { + "description": "UsageUsers", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "usersTotal": { + "type": "integer", + "description": "Total aggregated number of statistics of users.", + "x-example": 0, + "format": "int32" + }, + "sessionsTotal": { + "type": "integer", + "description": "Total aggregated number of active sessions.", + "x-example": 0, + "format": "int32" + }, + "users": { + "type": "array", + "description": "Aggregated number of users per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "sessions": { + "type": "array", + "description": "Aggregated number of active sessions per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "usersTotal", + "sessionsTotal", + "users", + "sessions" + ] + }, + "usageStorage": { + "description": "StorageUsage", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "bucketsTotal": { + "type": "integer", + "description": "Total aggregated number of buckets", + "x-example": 0, + "format": "int32" + }, + "filesTotal": { + "type": "integer", + "description": "Total aggregated number of files.", + "x-example": 0, + "format": "int32" + }, + "filesStorageTotal": { + "type": "integer", + "description": "Total aggregated number of files storage (in bytes).", + "x-example": 0, + "format": "int32" + }, + "buckets": { + "type": "array", + "description": "Aggregated number of buckets per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "files": { + "type": "array", + "description": "Aggregated number of files per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "Aggregated number of files storage (in bytes) per period .", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "bucketsTotal", + "filesTotal", + "filesStorageTotal", + "buckets", + "files", + "storage" + ] + }, + "usageBuckets": { + "description": "UsageBuckets", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "filesTotal": { + "type": "integer", + "description": "Total aggregated number of bucket files.", + "x-example": 0, + "format": "int32" + }, + "filesStorageTotal": { + "type": "integer", + "description": "Total aggregated number of bucket files storage (in bytes).", + "x-example": 0, + "format": "int32" + }, + "files": { + "type": "array", + "description": "Aggregated number of bucket files per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "Aggregated number of bucket storage files (in bytes) per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "imageTransformations": { + "type": "array", + "description": "Aggregated number of files transformations per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "imageTransformationsTotal": { + "type": "integer", + "description": "Total aggregated number of files transformations.", + "x-example": 0, + "format": "int32" + } + }, + "required": [ + "range", + "filesTotal", + "filesStorageTotal", + "files", + "storage", + "imageTransformations", + "imageTransformationsTotal" + ] + }, + "usageFunctions": { + "description": "UsageFunctions", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "functionsTotal": { + "type": "integer", + "description": "Total aggregated number of functions.", + "x-example": 0, + "format": "int32" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of functions deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of functions deployment storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of functions build.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of functions build storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of functions execution.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "functions": { + "type": "array", + "description": "Aggregated number of functions per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": 0 + }, + "deployments": { + "type": "array", + "description": "Aggregated number of functions deployment per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of functions deployment storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "builds": { + "type": "array", + "description": "Aggregated number of functions build per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of functions build storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of functions build compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated sum of functions build mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of functions execution per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of functions execution compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of functions mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful function builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed function builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "functionsTotal", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "functions", + "deployments", + "deploymentsStorage", + "buildsSuccessTotal", + "buildsFailedTotal", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed" + ] + }, + "usageFunction": { + "description": "UsageFunction", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of function deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of function deployments storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of function builds storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeAverage": { + "type": "integer", + "description": "Average builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "Aggregated number of function deployments per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of function deployments storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "builds": { + "type": "array", + "description": "Aggregated number of function builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of function builds storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of function builds compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated number of function builds mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of function executions per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of function executions compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of function mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsSuccessTotal", + "buildsFailedTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsTimeAverage", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed" + ] + }, + "usageSites": { + "description": "UsageSites", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of functions deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of functions deployment storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of functions build.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of functions build storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of functions execution.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "Aggregated number of functions deployment per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of functions deployment storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "builds": { + "type": "array", + "description": "Aggregated number of functions build per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of functions build storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of functions build compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated sum of functions build mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of functions execution per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of functions execution compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of functions mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful function builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed function builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "sitesTotal": { + "type": "integer", + "description": "Total aggregated number of sites.", + "x-example": 0, + "format": "int32" + }, + "sites": { + "type": "array", + "description": "Aggregated number of sites per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "requestsTotal": { + "type": "integer", + "description": "Total aggregated number of requests.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "inboundTotal": { + "type": "integer", + "description": "Total aggregated inbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "inbound": { + "type": "array", + "description": "Aggregated number of inbound bandwidth per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "outboundTotal": { + "type": "integer", + "description": "Total aggregated outbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "outbound": { + "type": "array", + "description": "Aggregated number of outbound bandwidth per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "buildsSuccessTotal", + "buildsFailedTotal", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed", + "sitesTotal", + "sites", + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound" + ] + }, + "usageSite": { + "description": "UsageSite", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of function deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of function deployments storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of function builds storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeAverage": { + "type": "integer", + "description": "Average builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "Aggregated number of function deployments per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of function deployments storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "builds": { + "type": "array", + "description": "Aggregated number of function builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of function builds storage per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of function builds compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated number of function builds mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of function executions per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of function executions compute time per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of function mbSeconds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed builds per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "requestsTotal": { + "type": "integer", + "description": "Total aggregated number of requests.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "inboundTotal": { + "type": "integer", + "description": "Total aggregated inbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "inbound": { + "type": "array", + "description": "Aggregated number of inbound bandwidth per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "outboundTotal": { + "type": "integer", + "description": "Total aggregated outbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "outbound": { + "type": "array", + "description": "Aggregated number of outbound bandwidth per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsSuccessTotal", + "buildsFailedTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsTimeAverage", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed", + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound" + ] + }, + "usageProject": { + "description": "UsageProject", + "type": "object", + "properties": { + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of documents.", + "x-example": 0, + "format": "int32" + }, + "databasesTotal": { + "type": "integer", + "description": "Total aggregated number of databases.", + "x-example": 0, + "format": "int32" + }, + "databasesStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of databases storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "usersTotal": { + "type": "integer", + "description": "Total aggregated number of users.", + "x-example": 0, + "format": "int32" + }, + "filesStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of files storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "functionsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of functions storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of builds storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of deployments storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "bucketsTotal": { + "type": "integer", + "description": "Total aggregated number of buckets.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated number of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "network": { + "type": "array", + "description": "Aggregated number of consumed bandwidth per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "users": { + "type": "array", + "description": "Aggregated number of users per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of executions per period.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "executionsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of executions by functions.", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "bucketsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of usage by buckets.", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "databasesStorageBreakdown": { + "type": "array", + "description": "An array of the aggregated breakdown of storage usage by databases.", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "executionsMbSecondsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of execution mbSeconds by functions.", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "buildsMbSecondsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of build mbSeconds by functions.", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "functionsStorageBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of functions storage size (in bytes).", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "authPhoneTotal": { + "type": "integer", + "description": "Total aggregated number of phone auth.", + "x-example": 0, + "format": "int32" + }, + "authPhoneEstimate": { + "type": "number", + "description": "Estimated total aggregated cost of phone auth.", + "x-example": 0, + "format": "double" + }, + "authPhoneCountryBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of phone auth by country.", + "items": { + "$ref": "#\/components\/schemas\/metricBreakdown" + }, + "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "imageTransformations": { + "type": "array", + "description": "An array of aggregated number of image transformations.", + "items": { + "$ref": "#\/components\/schemas\/metric" + }, + "x-example": [] + }, + "imageTransformationsTotal": { + "type": "integer", + "description": "Total aggregated number of image transformations.", + "x-example": 0, + "format": "int32" + } + }, + "required": [ + "executionsTotal", + "documentsTotal", + "databasesTotal", + "databasesStorageTotal", + "usersTotal", + "filesStorageTotal", + "functionsStorageTotal", + "buildsStorageTotal", + "deploymentsStorageTotal", + "bucketsTotal", + "executionsMbSecondsTotal", + "buildsMbSecondsTotal", + "databasesReadsTotal", + "databasesWritesTotal", + "requests", + "network", + "users", + "executions", + "executionsBreakdown", + "bucketsBreakdown", + "databasesStorageBreakdown", + "executionsMbSecondsBreakdown", + "buildsMbSecondsBreakdown", + "functionsStorageBreakdown", + "authPhoneTotal", + "authPhoneEstimate", + "authPhoneCountryBreakdown", + "databasesReads", + "databasesWrites", + "imageTransformations", + "imageTransformationsTotal" + ] + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "x-example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "x-example": "application\/json" + } + }, + "required": [ + "name", + "value" + ] + }, + "specification": { + "description": "Specification", + "type": "object", + "properties": { + "memory": { + "type": "integer", + "description": "Memory size in MB.", + "x-example": 512, + "format": "int32" + }, + "cpus": { + "type": "number", + "description": "Number of CPUs.", + "x-example": 1, + "format": "double" + }, + "enabled": { + "type": "boolean", + "description": "Is size enabled.", + "x-example": true + }, + "slug": { + "type": "string", + "description": "Size slug.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "memory", + "cpus", + "enabled", + "slug" + ] + }, + "proxyRule": { + "description": "Rule", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Rule ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Rule creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Rule update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "domain": { + "type": "string", + "description": "Domain name.", + "x-example": "appwrite.company.com" + }, + "type": { + "type": "string", + "description": "Action definition for the rule. Possible values are \"api\", \"deployment\", or \"redirect\"", + "x-example": "deployment" + }, + "trigger": { + "type": "string", + "description": "Defines how the rule was created. Possible values are \"manual\" or \"deployment\"", + "x-example": "manual" + }, + "redirectUrl": { + "type": "string", + "description": "URL to redirect to. Used if type is \"redirect\"", + "x-example": "https:\/\/appwrite.io\/docs" + }, + "redirectStatusCode": { + "type": "integer", + "description": "Status code to apply during redirect. Used if type is \"redirect\"", + "x-example": 301, + "format": "int32" + }, + "deploymentId": { + "type": "string", + "description": "ID of deployment. Used if type is \"deployment\"", + "x-example": "n3u9feiwmf" + }, + "deploymentResourceType": { + "type": "string", + "description": "Type of deployment. Possible values are \"function\", \"site\". Used if rule's type is \"deployment\".", + "x-example": "function" + }, + "deploymentResourceId": { + "type": "string", + "description": "ID deployment's resource. Used if type is \"deployment\"", + "x-example": "n3u9feiwmf" + }, + "deploymentVcsProviderBranch": { + "type": "string", + "description": "Name of Git branch that updates rule. Used if type is \"deployment\"", + "x-example": "function" + }, + "status": { + "type": "string", + "description": "Domain verification status. Possible values are \"created\", \"verifying\", \"verified\" and \"unverified\"", + "x-example": "verified" + }, + "logs": { + "type": "string", + "description": "Certificate generation logs. This will return an empty string if generation did not run, or succeeded.", + "x-example": "HTTP challegne failed." + }, + "renewAt": { + "type": "string", + "description": "Certificate auto-renewal date in ISO 8601 format.", + "x-example": "datetime" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "domain", + "type", + "trigger", + "redirectUrl", + "redirectStatusCode", + "deploymentId", + "deploymentResourceType", + "deploymentResourceId", + "deploymentVcsProviderBranch", + "status", + "logs", + "renewAt" + ] + }, + "smsTemplate": { + "description": "SmsTemplate", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Template type", + "x-example": "verification" + }, + "locale": { + "type": "string", + "description": "Template locale", + "x-example": "en_us" + }, + "message": { + "type": "string", + "description": "Template message", + "x-example": "Click on the link to verify your account." + } + }, + "required": [ + "type", + "locale", + "message" + ] + }, + "emailTemplate": { + "description": "EmailTemplate", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Template type", + "x-example": "verification" + }, + "locale": { + "type": "string", + "description": "Template locale", + "x-example": "en_us" + }, + "message": { + "type": "string", + "description": "Template message", + "x-example": "Click on the link to verify your account." + }, + "senderName": { + "type": "string", + "description": "Name of the sender", + "x-example": "My User" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "x-example": "mail@appwrite.io" + }, + "replyTo": { + "type": "string", + "description": "Reply to email address", + "x-example": "emails@appwrite.io" + }, + "subject": { + "type": "string", + "description": "Email subject", + "x-example": "Please verify your email address" + } + }, + "required": [ + "type", + "locale", + "message", + "senderName", + "senderEmail", + "replyTo", + "subject" + ] + }, + "consoleVariables": { + "description": "Console Variables", + "type": "object", + "properties": { + "_APP_DOMAIN_TARGET_CNAME": { + "type": "string", + "description": "CNAME target for your Appwrite custom domains.", + "x-example": "appwrite.io" + }, + "_APP_DOMAIN_TARGET_A": { + "type": "string", + "description": "A target for your Appwrite custom domains.", + "x-example": "127.0.0.1" + }, + "_APP_DOMAIN_TARGET_AAAA": { + "type": "string", + "description": "AAAA target for your Appwrite custom domains.", + "x-example": "::1" + }, + "_APP_STORAGE_LIMIT": { + "type": "integer", + "description": "Maximum file size allowed for file upload in bytes.", + "x-example": "30000000", + "format": "int32" + }, + "_APP_COMPUTE_SIZE_LIMIT": { + "type": "integer", + "description": "Maximum file size allowed for deployment in bytes.", + "x-example": "30000000", + "format": "int32" + }, + "_APP_USAGE_STATS": { + "type": "string", + "description": "Defines if usage stats are enabled. This value is set to 'enabled' by default, to disable the usage stats set the value to 'disabled'.", + "x-example": "enabled" + }, + "_APP_VCS_ENABLED": { + "type": "boolean", + "description": "Defines if VCS (Version Control System) is enabled.", + "x-example": true + }, + "_APP_DOMAIN_ENABLED": { + "type": "boolean", + "description": "Defines if main domain is configured. If so, custom domains can be created.", + "x-example": true + }, + "_APP_ASSISTANT_ENABLED": { + "type": "boolean", + "description": "Defines if AI assistant is enabled.", + "x-example": true + }, + "_APP_DOMAIN_SITES": { + "type": "string", + "description": "A domain to use for site URLs.", + "x-example": "sites.localhost" + }, + "_APP_DOMAIN_FUNCTIONS": { + "type": "string", + "description": "A domain to use for function URLs.", + "x-example": "functions.localhost" + }, + "_APP_OPTIONS_FORCE_HTTPS": { + "type": "string", + "description": "Defines if HTTPS is enforced for all requests.", + "x-example": "enabled" + }, + "_APP_DOMAINS_NAMESERVERS": { + "type": "string", + "description": "Comma-separated list of nameservers.", + "x-example": "ns1.example.com,ns2.example.com" + } + }, + "required": [ + "_APP_DOMAIN_TARGET_CNAME", + "_APP_DOMAIN_TARGET_A", + "_APP_DOMAIN_TARGET_AAAA", + "_APP_STORAGE_LIMIT", + "_APP_COMPUTE_SIZE_LIMIT", + "_APP_USAGE_STATS", + "_APP_VCS_ENABLED", + "_APP_DOMAIN_ENABLED", + "_APP_ASSISTANT_ENABLED", + "_APP_DOMAIN_SITES", + "_APP_DOMAIN_FUNCTIONS", + "_APP_OPTIONS_FORCE_HTTPS", + "_APP_DOMAINS_NAMESERVERS" + ] + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ] + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "x-example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ] + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "x-example": true + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "x-example": true + } + }, + "required": [ + "secret", + "uri" + ] + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "x-example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "x-example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "x-example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "x-example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode" + ] + }, + "provider": { + "description": "Provider", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Provider ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Provider creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Provider update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name for the provider instance.", + "x-example": "Mailgun" + }, + "provider": { + "type": "string", + "description": "The name of the provider service.", + "x-example": "mailgun" + }, + "enabled": { + "type": "boolean", + "description": "Is provider enabled?", + "x-example": true + }, + "type": { + "type": "string", + "description": "Type of provider.", + "x-example": "sms" + }, + "credentials": { + "type": "object", + "description": "Provider credentials.", + "x-example": { + "key": "123456789" + } + }, + "options": { + "type": "object", + "description": "Provider options.", + "x-example": { + "from": "sender-email@mydomain" + }, + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "provider", + "enabled", + "type", + "credentials" + ] + }, + "message": { + "description": "Message", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Message ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Message creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Message update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerType": { + "type": "string", + "description": "Message provider type.", + "x-example": "email" + }, + "topics": { + "type": "array", + "description": "Topic IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "users": { + "type": "array", + "description": "User IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "targets": { + "type": "array", + "description": "Target IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for message.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "deliveredAt": { + "type": "string", + "description": "The time when the message was delivered.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "deliveryErrors": { + "type": "array", + "description": "Delivery errors if any.", + "items": { + "type": "string" + }, + "x-example": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "nullable": true + }, + "deliveredTotal": { + "type": "integer", + "description": "Number of recipients the message was delivered to.", + "x-example": 1, + "format": "int32" + }, + "data": { + "type": "object", + "description": "Data of the message.", + "x-example": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + } + }, + "status": { + "type": "string", + "description": "Status of delivery.", + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "providerType", + "topics", + "users", + "targets", + "deliveredTotal", + "data", + "status" + ] + }, + "topic": { + "description": "Topic", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Topic creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Topic update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name of the topic.", + "x-example": "events" + }, + "emailTotal": { + "type": "integer", + "description": "Total count of email subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "smsTotal": { + "type": "integer", + "description": "Total count of SMS subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "pushTotal": { + "type": "integer", + "description": "Total count of push subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "subscribe": { + "type": "array", + "description": "Subscribe permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "emailTotal", + "smsTotal", + "pushTotal", + "subscribe" + ] + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "x-example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "items": { + "$ref": "#\/components\/schemas\/target" + } + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ] + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "x-example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "x-example": "259125845563242502", + "nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ] + }, + "migration": { + "description": "Migration", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Migration ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Migration creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "string", + "description": "Migration status ( pending, processing, failed, completed ) ", + "x-example": "pending" + }, + "stage": { + "type": "string", + "description": "Migration stage ( init, processing, source-check, destination-check, migrating, finished )", + "x-example": "init" + }, + "source": { + "type": "string", + "description": "A string containing the type of source of the migration.", + "x-example": "Appwrite" + }, + "destination": { + "type": "string", + "description": "A string containing the type of destination of the migration.", + "x-example": "Appwrite" + }, + "resources": { + "type": "array", + "description": "Resources to migrate.", + "items": { + "type": "string" + }, + "x-example": [ + "user" + ] + }, + "resourceId": { + "type": "string", + "description": "Id of the resource to migrate.", + "x-example": "databaseId:collectionId" + }, + "statusCounters": { + "type": "object", + "description": "A group of counters that represent the total progress of the migration.", + "x-example": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}" + }, + "resourceData": { + "type": "object", + "description": "An array of objects containing the report data of the resources that were migrated.", + "x-example": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]" + }, + "errors": { + "type": "array", + "description": "All errors that occurred during the migration process.", + "items": { + "type": "string" + }, + "x-example": [] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "status", + "stage", + "source", + "destination", + "resources", + "resourceId", + "statusCounters", + "resourceData", + "errors" + ] + }, + "migrationReport": { + "description": "Migration Report", + "type": "object", + "properties": { + "user": { + "type": "integer", + "description": "Number of users to be migrated.", + "x-example": 20, + "format": "int32" + }, + "team": { + "type": "integer", + "description": "Number of teams to be migrated.", + "x-example": 20, + "format": "int32" + }, + "database": { + "type": "integer", + "description": "Number of databases to be migrated.", + "x-example": 20, + "format": "int32" + }, + "document": { + "type": "integer", + "description": "Number of documents to be migrated.", + "x-example": 20, + "format": "int32" + }, + "file": { + "type": "integer", + "description": "Number of files to be migrated.", + "x-example": 20, + "format": "int32" + }, + "bucket": { + "type": "integer", + "description": "Number of buckets to be migrated.", + "x-example": 20, + "format": "int32" + }, + "function": { + "type": "integer", + "description": "Number of functions to be migrated.", + "x-example": 20, + "format": "int32" + }, + "size": { + "type": "integer", + "description": "Size of files to be migrated in mb.", + "x-example": 30000, + "format": "int32" + }, + "version": { + "type": "string", + "description": "Version of the Appwrite instance to be migrated.", + "x-example": "1.4.0" + } + }, + "required": [ + "user", + "team", + "database", + "document", + "file", + "bucket", + "function", + "size", + "version" + ] + } + }, + "securitySchemes": { + "Project": { + "type": "apiKey", + "name": "X-Appwrite-Project", + "description": "Your project ID", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_PROJECT_ID>" + } + }, + "Key": { + "type": "apiKey", + "name": "X-Appwrite-Key", + "description": "Your secret API key", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_API_KEY>" + } + }, + "JWT": { + "type": "apiKey", + "name": "X-Appwrite-JWT", + "description": "Your secret JSON Web Token", + "in": "header" + }, + "Locale": { + "type": "apiKey", + "name": "X-Appwrite-Locale", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "en" + } + }, + "Mode": { + "type": "apiKey", + "name": "X-Appwrite-Mode", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "" + } + } + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file diff --git a/app/config/specs/open-api3-1.8.x-server.json b/app/config/specs/open-api3-1.8.x-server.json new file mode 100644 index 0000000000..3e9b87fdf1 --- /dev/null +++ b/app/config/specs/open-api3-1.8.x-server.json @@ -0,0 +1,30581 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.7.4", + "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@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "servers": [ + { + "url": "https:\/\/cloud.appwrite.io\/v1" + }, + { + "url": "https:\/\/<REGION>.cloud.appwrite.io\/v1" + } + ], + "paths": { + "\/account": { + "get": { + "summary": "Get account", + "operationId": "accountGet", + "tags": [ + "account" + ], + "description": "Get the currently logged in user.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "account", + "weight": 10, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create account", + "operationId": "accountCreate", + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailSession).", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "create", + "group": "account", + "weight": 9, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/email": { + "patch": { + "summary": "Update email", + "operationId": "accountUpdateEmail", + "tags": [ + "account" + ], + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateEmail", + "group": "account", + "weight": 35, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/identities": { + "get": { + "summary": "List identities", + "operationId": "accountListIdentities", + "tags": [ + "account" + ], + "description": "Get the list of identities for the currently logged in user.", + "responses": { + "200": { + "description": "Identities List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/identityList" + } + } + } + } + }, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 58, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "accountDeleteIdentity", + "tags": [ + "account" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 59, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<IDENTITY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/account\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "accountCreateJWT", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "x-appwrite": { + "method": "createJWT", + "group": "tokens", + "weight": 30, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/logs": { + "get": { + "summary": "List logs", + "operationId": "accountListLogs", + "tags": [ + "account" + ], + "description": "Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 32, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "accountUpdateMFA", + "tags": [ + "account" + ], + "description": "Enable or disable MFA on an account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMFA", + "group": "mfa", + "weight": 45, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-m-f-a.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaType" + } + } + } + } + }, + "x-appwrite": { + "method": "createMfaAuthenticator", + "group": "mfa", + "weight": 47, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfaAuthenticator", + "group": "mfa", + "weight": 48, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "otp": { + "type": "string", + "description": "Valid verification token.", + "x-example": "<OTP>" + } + }, + "required": [ + "otp" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 52, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/account\/mfa\/challenge": { + "post": { + "summary": "Create MFA challenge", + "operationId": "accountCreateMfaChallenge", + "tags": [ + "account" + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Challenge", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaChallenge" + } + } + } + } + }, + "x-appwrite": { + "method": "createMfaChallenge", + "group": "mfa", + "weight": 53, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "factor": { + "type": "string", + "description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.", + "x-example": "email", + "enum": [ + "email", + "phone", + "totp", + "recoverycode" + ], + "x-enum-name": "AuthenticationFactor", + "x-enum-keys": [] + } + }, + "required": [ + "factor" + ] + } + } + } + } + }, + "put": { + "summary": "Update MFA challenge (confirmation)", + "operationId": "accountUpdateMfaChallenge", + "tags": [ + "account" + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfaChallenge", + "group": "mfa", + "weight": 54, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},challengeId:{param-challengeId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "challengeId": { + "type": "string", + "description": "ID of the challenge.", + "x-example": "<CHALLENGE_ID>" + }, + "otp": { + "type": "string", + "description": "Valid verification token.", + "x-example": "<OTP>" + } + }, + "required": [ + "challengeId", + "otp" + ] + } + } + } + } + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 46, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 51, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 49, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 50, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/name": { + "patch": { + "summary": "Update name", + "operationId": "accountUpdateName", + "tags": [ + "account" + ], + "description": "Update currently logged in user account name.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "account", + "weight": 33, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "\/account\/password": { + "patch": { + "summary": "Update password", + "operationId": "accountUpdatePassword", + "tags": [ + "account" + ], + "description": "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePassword", + "group": "account", + "weight": 34, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "x-example": null + }, + "oldPassword": { + "type": "string", + "description": "Current user password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "password" + ] + } + } + } + } + } + }, + "\/account\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "accountUpdatePhone", + "tags": [ + "account" + ], + "description": "Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createPhoneVerification) endpoint to send a confirmation SMS.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePhone", + "group": "account", + "weight": 36, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "phone", + "password" + ] + } + } + } + } + } + }, + "\/account\/prefs": { + "get": { + "summary": "Get account preferences", + "operationId": "accountGetPrefs", + "tags": [ + "account" + ], + "description": "Get the preferences as a key-value object for the currently logged in user.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "account", + "weight": 31, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update preferences", + "operationId": "accountUpdatePrefs", + "tags": [ + "account" + ], + "description": "Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "account", + "weight": 37, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/account\/recovery": { + "post": { + "summary": "Create password recovery", + "operationId": "accountCreateRecovery", + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createRecovery", + "group": "recovery", + "weight": 39, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "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.", + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "email", + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update password recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/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.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "updateRecovery", + "group": "recovery", + "weight": 40, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid reset token.", + "x-example": "<SECRET>" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "x-example": null + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions": { + "get": { + "summary": "List sessions", + "operationId": "accountListSessions", + "tags": [ + "account" + ], + "description": "Get the list of active sessions across different devices for the currently logged in user.", + "responses": { + "200": { + "description": "Sessions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/sessionList" + } + } + } + } + }, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 12, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "delete": { + "summary": "Delete sessions", + "operationId": "accountDeleteSessions", + "tags": [ + "account" + ], + "description": "Delete all sessions from the user account and remove any sessions cookies from the end client.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 13, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/anonymous": { + "post": { + "summary": "Create anonymous session", + "operationId": "accountCreateAnonymousSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmail) or create an [OAuth2 session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#CreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "createAnonymousSession", + "group": "sessions", + "weight": 18, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-anonymous-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/sessions\/email": { + "post": { + "summary": "Create email password session", + "operationId": "accountCreateEmailPasswordSession", + "tags": [ + "account" + ], + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "createEmailPasswordSession", + "group": "sessions", + "weight": 17, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-email-password-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},email:{param-email}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + } + } + } + }, + "\/account\/sessions\/magic-url": { + "put": { + "summary": "Update magic URL session", + "operationId": "accountUpdateMagicURLSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMagicURLSession", + "group": "sessions", + "weight": 27, + "cookies": false, + "type": "", + "deprecated": true, + "demo": "account\/update-magic-u-r-l-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/phone": { + "put": { + "summary": "Update phone session", + "operationId": "accountUpdatePhoneSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePhoneSession", + "group": "sessions", + "weight": 28, + "cookies": false, + "type": "", + "deprecated": true, + "demo": "account\/update-phone-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/token": { + "post": { + "summary": "Create session", + "operationId": "accountCreateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 19, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.", + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/sessions\/{sessionId}": { + "get": { + "summary": "Get session", + "operationId": "accountGetSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "getSession", + "group": "sessions", + "weight": 14, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/get-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SESSION_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update session", + "operationId": "accountUpdateSession", + "tags": [ + "account" + ], + "description": "Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.", + "responses": { + "200": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSession", + "group": "sessions", + "weight": 16, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SESSION_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete session", + "operationId": "accountDeleteSession", + "tags": [ + "account" + ], + "description": "Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#deleteSessions) instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 15, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to delete the current device session.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SESSION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/account\/status": { + "patch": { + "summary": "Update status", + "operationId": "accountUpdateStatus", + "tags": [ + "account" + ], + "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateStatus", + "group": "account", + "weight": 38, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/tokens\/email": { + "post": { + "summary": "Create email token (OTP)", + "operationId": "accountCreateEmailToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createEmailToken", + "group": "tokens", + "weight": 26, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-email-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/magic-url": { + "post": { + "summary": "Create magic URL token", + "operationId": "accountCreateMagicURLToken", + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createMagicURLToken", + "group": "tokens", + "weight": 25, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-magic-u-r-l-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the magic URL login. 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.", + "x-example": "https:\/\/example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + } + } + } + }, + "\/account\/tokens\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 token", + "operationId": "accountCreateOAuth2Token", + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their 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. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "301": { + "description": "File" + } + }, + "x-appwrite": { + "method": "createOAuth2Token", + "group": "tokens", + "weight": 24, + "cookies": false, + "type": "webAuth", + "deprecated": false, + "demo": "account\/create-o-auth2token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "schema": { + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's 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, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's 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, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "default": "" + }, + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/account\/tokens\/phone": { + "post": { + "summary": "Create phone token", + "operationId": "accountCreatePhoneToken", + "tags": [ + "account" + ], + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createPhoneToken", + "group": "tokens", + "weight": 29, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-phone-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},phone:{param-phone}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + } + }, + "required": [ + "userId", + "phone" + ] + } + } + } + } + } + }, + "\/account\/verification": { + "post": { + "summary": "Create email verification", + "operationId": "accountCreateVerification", + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\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", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createVerification", + "group": "verification", + "weight": 41, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "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.", + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "url" + ] + } + } + } + } + }, + "put": { + "summary": "Update email verification (confirmation)", + "operationId": "accountUpdateVerification", + "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.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "updateVerification", + "group": "verification", + "weight": 42, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/account\/verification\/phone": { + "post": { + "summary": "Create phone verification", + "operationId": "accountCreatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createPhoneVerification", + "group": "verification", + "weight": 43, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},userId:{userId}", + "url:{url},ip:{ip}" + ], + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "put": { + "summary": "Update phone verification (confirmation)", + "operationId": "accountUpdatePhoneVerification", + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "verification", + "weight": 44, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/avatars\/browsers\/{code}": { + "get": { + "summary": "Get browser icon", + "operationId": "avatarsGetBrowser", + "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 [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getBrowser", + "group": null, + "weight": 61, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Browser Code.", + "required": true, + "schema": { + "type": "string", + "x-example": "aa", + "enum": [ + "aa", + "an", + "ch", + "ci", + "cm", + "cr", + "ff", + "sf", + "mf", + "ps", + "oi", + "om", + "op", + "on" + ], + "x-enum-name": "Browser", + "x-enum-keys": [ + "Avant Browser", + "Android WebView Beta", + "Google Chrome", + "Google Chrome (iOS)", + "Google Chrome (Mobile)", + "Chromium", + "Mozilla Firefox", + "Safari", + "Mobile Safari", + "Microsoft Edge", + "Microsoft Edge (iOS)", + "Opera Mini", + "Opera", + "Opera (Next)" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "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, + "schema": { + "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 keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/credit-cards\/{code}": { + "get": { + "summary": "Get credit card icon", + "operationId": "avatarsGetCreditCard", + "tags": [ + "avatars" + ], + "description": "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getCreditCard", + "group": null, + "weight": 60, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "required": true, + "schema": { + "type": "string", + "x-example": "amex", + "enum": [ + "amex", + "argencard", + "cabal", + "cencosud", + "diners", + "discover", + "elo", + "hipercard", + "jcb", + "mastercard", + "naranja", + "targeta-shopping", + "union-china-pay", + "visa", + "mir", + "maestro", + "rupay" + ], + "x-enum-name": "CreditCard", + "x-enum-keys": [ + "American Express", + "Argencard", + "Cabal", + "Cencosud", + "Diners Club", + "Discover", + "Elo", + "Hipercard", + "JCB", + "Mastercard", + "Naranja", + "Tarjeta Shopping", + "Union China Pay", + "Visa", + "MIR", + "Maestro", + "Rupay" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "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, + "schema": { + "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 keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/favicon": { + "get": { + "summary": "Get favicon", + "operationId": "avatarsGetFavicon", + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getFavicon", + "group": null, + "weight": 64, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Website URL which you want to fetch the favicon from.", + "required": true, + "schema": { + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/flags\/{code}": { + "get": { + "summary": "Get country flag", + "operationId": "avatarsGetFlag", + "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. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getFlag", + "group": null, + "weight": 62, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Country Code. ISO Alpha-2 country code format.", + "required": true, + "schema": { + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ao", + "al", + "ad", + "ae", + "ar", + "am", + "ag", + "au", + "at", + "az", + "bi", + "be", + "bj", + "bf", + "bd", + "bg", + "bh", + "bs", + "ba", + "by", + "bz", + "bo", + "br", + "bb", + "bn", + "bt", + "bw", + "cf", + "ca", + "ch", + "cl", + "cn", + "ci", + "cm", + "cd", + "cg", + "co", + "km", + "cv", + "cr", + "cu", + "cy", + "cz", + "de", + "dj", + "dm", + "dk", + "do", + "dz", + "ec", + "eg", + "er", + "es", + "ee", + "et", + "fi", + "fj", + "fr", + "fm", + "ga", + "gb", + "ge", + "gh", + "gn", + "gm", + "gw", + "gq", + "gr", + "gd", + "gt", + "gy", + "hn", + "hr", + "ht", + "hu", + "id", + "in", + "ie", + "ir", + "iq", + "is", + "il", + "it", + "jm", + "jo", + "jp", + "kz", + "ke", + "kg", + "kh", + "ki", + "kn", + "kr", + "kw", + "la", + "lb", + "lr", + "ly", + "lc", + "li", + "lk", + "ls", + "lt", + "lu", + "lv", + "ma", + "mc", + "md", + "mg", + "mv", + "mx", + "mh", + "mk", + "ml", + "mt", + "mm", + "me", + "mn", + "mz", + "mr", + "mu", + "mw", + "my", + "na", + "ne", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nz", + "om", + "pk", + "pa", + "pe", + "ph", + "pw", + "pg", + "pl", + "pf", + "kp", + "pt", + "py", + "qa", + "ro", + "ru", + "rw", + "sa", + "sd", + "sn", + "sg", + "sb", + "sl", + "sv", + "sm", + "so", + "rs", + "ss", + "st", + "sr", + "sk", + "si", + "se", + "sz", + "sc", + "sy", + "td", + "tg", + "th", + "tj", + "tm", + "tl", + "to", + "tt", + "tn", + "tr", + "tv", + "tz", + "ug", + "ua", + "uy", + "us", + "uz", + "va", + "vc", + "ve", + "vn", + "vu", + "ws", + "ye", + "za", + "zm", + "zw" + ], + "x-enum-name": "Flag", + "x-enum-keys": [ + "Afghanistan", + "Angola", + "Albania", + "Andorra", + "United Arab Emirates", + "Argentina", + "Armenia", + "Antigua and Barbuda", + "Australia", + "Austria", + "Azerbaijan", + "Burundi", + "Belgium", + "Benin", + "Burkina Faso", + "Bangladesh", + "Bulgaria", + "Bahrain", + "Bahamas", + "Bosnia and Herzegovina", + "Belarus", + "Belize", + "Bolivia", + "Brazil", + "Barbados", + "Brunei Darussalam", + "Bhutan", + "Botswana", + "Central African Republic", + "Canada", + "Switzerland", + "Chile", + "China", + "C\u00f4te d'Ivoire", + "Cameroon", + "Democratic Republic of the Congo", + "Republic of the Congo", + "Colombia", + "Comoros", + "Cape Verde", + "Costa Rica", + "Cuba", + "Cyprus", + "Czech Republic", + "Germany", + "Djibouti", + "Dominica", + "Denmark", + "Dominican Republic", + "Algeria", + "Ecuador", + "Egypt", + "Eritrea", + "Spain", + "Estonia", + "Ethiopia", + "Finland", + "Fiji", + "France", + "Micronesia (Federated States of)", + "Gabon", + "United Kingdom", + "Georgia", + "Ghana", + "Guinea", + "Gambia", + "Guinea-Bissau", + "Equatorial Guinea", + "Greece", + "Grenada", + "Guatemala", + "Guyana", + "Honduras", + "Croatia", + "Haiti", + "Hungary", + "Indonesia", + "India", + "Ireland", + "Iran (Islamic Republic of)", + "Iraq", + "Iceland", + "Israel", + "Italy", + "Jamaica", + "Jordan", + "Japan", + "Kazakhstan", + "Kenya", + "Kyrgyzstan", + "Cambodia", + "Kiribati", + "Saint Kitts and Nevis", + "South Korea", + "Kuwait", + "Lao People's Democratic Republic", + "Lebanon", + "Liberia", + "Libya", + "Saint Lucia", + "Liechtenstein", + "Sri Lanka", + "Lesotho", + "Lithuania", + "Luxembourg", + "Latvia", + "Morocco", + "Monaco", + "Moldova", + "Madagascar", + "Maldives", + "Mexico", + "Marshall Islands", + "North Macedonia", + "Mali", + "Malta", + "Myanmar", + "Montenegro", + "Mongolia", + "Mozambique", + "Mauritania", + "Mauritius", + "Malawi", + "Malaysia", + "Namibia", + "Niger", + "Nigeria", + "Nicaragua", + "Netherlands", + "Norway", + "Nepal", + "Nauru", + "New Zealand", + "Oman", + "Pakistan", + "Panama", + "Peru", + "Philippines", + "Palau", + "Papua New Guinea", + "Poland", + "French Polynesia", + "North Korea", + "Portugal", + "Paraguay", + "Qatar", + "Romania", + "Russia", + "Rwanda", + "Saudi Arabia", + "Sudan", + "Senegal", + "Singapore", + "Solomon Islands", + "Sierra Leone", + "El Salvador", + "San Marino", + "Somalia", + "Serbia", + "South Sudan", + "Sao Tome and Principe", + "Suriname", + "Slovakia", + "Slovenia", + "Sweden", + "Eswatini", + "Seychelles", + "Syria", + "Chad", + "Togo", + "Thailand", + "Tajikistan", + "Turkmenistan", + "Timor-Leste", + "Tonga", + "Trinidad and Tobago", + "Tunisia", + "Turkey", + "Tuvalu", + "Tanzania", + "Uganda", + "Ukraine", + "Uruguay", + "United States", + "Uzbekistan", + "Vatican City", + "Saint Vincent and the Grenadines", + "Venezuela", + "Vietnam", + "Vanuatu", + "Samoa", + "Yemen", + "South Africa", + "Zambia", + "Zimbabwe" + ] + }, + "in": "path" + }, + { + "name": "width", + "description": "Image width. Pass an integer between 0 to 2000. Defaults to 100.", + "required": false, + "schema": { + "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, + "schema": { + "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 keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/image": { + "get": { + "summary": "Get image from URL", + "operationId": "avatarsGetImage", + "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getImage", + "group": null, + "weight": 63, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "url", + "description": "Image URL which you want to crop.", + "required": true, + "schema": { + "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. Defaults to 400.", + "required": false, + "schema": { + "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. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400 + }, + "in": "query" + } + ] + } + }, + "\/avatars\/initials": { + "get": { + "summary": "Get user initials", + "operationId": "avatarsGetInitials", + "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getInitials", + "group": null, + "weight": 66, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Full Name. When empty, current user name or email will be used. Max length: 128 chars.", + "required": false, + "schema": { + "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, + "schema": { + "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, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 500 + }, + "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, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/avatars\/qr": { + "get": { + "summary": "Get QR code", + "operationId": "avatarsGetQR", + "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.\n", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getQR", + "group": null, + "weight": 65, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "text", + "description": "Plain text to be converted to QR code image.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEXT>" + }, + "in": "query" + }, + { + "name": "size", + "description": "QR code size. Pass an integer between 1 to 1000. Defaults to 400.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 400 + }, + "in": "query" + }, + { + "name": "margin", + "description": "Margin from edge. Pass an integer between 0 to 10. Defaults to 1.", + "required": false, + "schema": { + "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, + "schema": { + "type": "boolean", + "x-example": false, + "default": false + }, + "in": "query" + } + ] + } + }, + "\/databases": { + "get": { + "summary": "List databases", + "operationId": "databasesList", + "tags": [ + "databases" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/databaseList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "group": "databases", + "weight": 71, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "databasesCreate", + "tags": [ + "databases" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "x-appwrite": { + "method": "create", + "group": "databases", + "weight": 70, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<DATABASE_ID>" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "databasesGet", + "tags": [ + "databases" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "databases", + "weight": 72, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "databasesUpdate", + "tags": [ + "databases" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/database" + } + } + } + } + }, + "x-appwrite": { + "method": "update", + "group": "databases", + "weight": 74, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete database", + "operationId": "databasesDelete", + "tags": [ + "databases" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "databases", + "weight": 75, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections": { + "get": { + "summary": "List collections", + "operationId": "databasesListCollections", + "tags": [ + "databases" + ], + "description": "Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Collections List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collectionList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCollections", + "group": "collections", + "weight": 77, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-collections.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create collection", + "operationId": "databasesCreateCollection", + "tags": [ + "databases" + ], + "description": "Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "x-appwrite": { + "method": "createCollection", + "group": "collections", + "weight": 76, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "collectionId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<COLLECTION_ID>" + }, + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "collectionId", + "name" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}": { + "get": { + "summary": "Get collection", + "operationId": "databasesGetCollection", + "tags": [ + "databases" + ], + "description": "Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "x-appwrite": { + "method": "getCollection", + "group": "collections", + "weight": 78, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update collection", + "operationId": "databasesUpdateCollection", + "tags": [ + "databases" + ], + "description": "Update a collection by its unique ID.", + "responses": { + "200": { + "description": "Collection", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/collection" + } + } + } + } + }, + "x-appwrite": { + "method": "updateCollection", + "group": "collections", + "weight": 80, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete collection", + "operationId": "databasesDeleteCollection", + "tags": [ + "databases" + ], + "description": "Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteCollection", + "group": "collections", + "weight": 81, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes": { + "get": { + "summary": "List attributes", + "operationId": "databasesListAttributes", + "tags": [ + "databases" + ], + "description": "List attributes in the collection.", + "responses": { + "200": { + "description": "Attributes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeList" + } + } + } + } + }, + "x-appwrite": { + "method": "listAttributes", + "group": "attributes", + "weight": 92, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-attributes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean": { + "post": { + "summary": "Create boolean attribute", + "operationId": "databasesCreateBooleanAttribute", + "tags": [ + "databases" + ], + "description": "Create a boolean attribute.\n", + "responses": { + "202": { + "description": "AttributeBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBoolean" + } + } + } + } + }, + "x-appwrite": { + "method": "createBooleanAttribute", + "group": "attributes", + "weight": 89, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean\/{key}": { + "patch": { + "summary": "Update boolean attribute", + "operationId": "databasesUpdateBooleanAttribute", + "tags": [ + "databases" + ], + "description": "Update a boolean attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeBoolean", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeBoolean" + } + } + } + } + }, + "x-appwrite": { + "method": "updateBooleanAttribute", + "group": "attributes", + "weight": 101, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime": { + "post": { + "summary": "Create datetime attribute", + "operationId": "databasesCreateDatetimeAttribute", + "tags": [ + "databases" + ], + "description": "Create a date time attribute according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "AttributeDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeDatetime" + } + } + } + } + }, + "x-appwrite": { + "method": "createDatetimeAttribute", + "group": "attributes", + "weight": 90, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime\/{key}": { + "patch": { + "summary": "Update dateTime attribute", + "operationId": "databasesUpdateDatetimeAttribute", + "tags": [ + "databases" + ], + "description": "Update a date time attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeDatetime", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeDatetime" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDatetimeAttribute", + "group": "attributes", + "weight": 102, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email": { + "post": { + "summary": "Create email attribute", + "operationId": "databasesCreateEmailAttribute", + "tags": [ + "databases" + ], + "description": "Create an email attribute.\n", + "responses": { + "202": { + "description": "AttributeEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEmail" + } + } + } + } + }, + "x-appwrite": { + "method": "createEmailAttribute", + "group": "attributes", + "weight": 83, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email\/{key}": { + "patch": { + "summary": "Update email attribute", + "operationId": "databasesUpdateEmailAttribute", + "tags": [ + "databases" + ], + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEmail", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEmail" + } + } + } + } + }, + "x-appwrite": { + "method": "updateEmailAttribute", + "group": "attributes", + "weight": 95, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum": { + "post": { + "summary": "Create enum attribute", + "operationId": "databasesCreateEnumAttribute", + "tags": [ + "databases" + ], + "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", + "responses": { + "202": { + "description": "AttributeEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEnum" + } + } + } + } + }, + "x-appwrite": { + "method": "createEnumAttribute", + "group": "attributes", + "weight": 84, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum\/{key}": { + "patch": { + "summary": "Update enum attribute", + "operationId": "databasesUpdateEnumAttribute", + "tags": [ + "databases" + ], + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEnum", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeEnum" + } + } + } + } + }, + "x-appwrite": { + "method": "updateEnumAttribute", + "group": "attributes", + "weight": 96, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float": { + "post": { + "summary": "Create float attribute", + "operationId": "databasesCreateFloatAttribute", + "tags": [ + "databases" + ], + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeFloat" + } + } + } + } + }, + "x-appwrite": { + "method": "createFloatAttribute", + "group": "attributes", + "weight": 88, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value to enforce on new documents", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value to enforce on new documents", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float\/{key}": { + "patch": { + "summary": "Update float attribute", + "operationId": "databasesUpdateFloatAttribute", + "tags": [ + "databases" + ], + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeFloat", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeFloat" + } + } + } + } + }, + "x-appwrite": { + "method": "updateFloatAttribute", + "group": "attributes", + "weight": 100, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value to enforce on new documents", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value to enforce on new documents", + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer": { + "post": { + "summary": "Create integer attribute", + "operationId": "databasesCreateIntegerAttribute", + "tags": [ + "databases" + ], + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeInteger" + } + } + } + } + }, + "x-appwrite": { + "method": "createIntegerAttribute", + "group": "attributes", + "weight": 87, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce on new documents", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce on new documents", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer\/{key}": { + "patch": { + "summary": "Update integer attribute", + "operationId": "databasesUpdateIntegerAttribute", + "tags": [ + "databases" + ], + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeInteger", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeInteger" + } + } + } + } + }, + "x-appwrite": { + "method": "updateIntegerAttribute", + "group": "attributes", + "weight": 99, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce on new documents", + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce on new documents", + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip": { + "post": { + "summary": "Create IP address attribute", + "operationId": "databasesCreateIpAttribute", + "tags": [ + "databases" + ], + "description": "Create IP address attribute.\n", + "responses": { + "202": { + "description": "AttributeIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeIp" + } + } + } + } + }, + "x-appwrite": { + "method": "createIpAttribute", + "group": "attributes", + "weight": 85, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "patch": { + "summary": "Update IP address attribute", + "operationId": "databasesUpdateIpAttribute", + "tags": [ + "databases" + ], + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeIP", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeIp" + } + } + } + } + }, + "x-appwrite": { + "method": "updateIpAttribute", + "group": "attributes", + "weight": 97, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { + "post": { + "summary": "Create relationship attribute", + "operationId": "databasesCreateRelationshipAttribute", + "tags": [ + "databases" + ], + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "202": { + "description": "AttributeRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeRelationship" + } + } + } + } + }, + "x-appwrite": { + "method": "createRelationshipAttribute", + "group": "attributes", + "weight": 91, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "relatedCollectionId": { + "type": "string", + "description": "Related Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "x-example": "<RELATED_COLLECTION_ID>" + }, + "type": { + "type": "string", + "description": "Relation type", + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "x-example": false + }, + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Attribute Key.", + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedCollectionId", + "type" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string": { + "post": { + "summary": "Create string attribute", + "operationId": "databasesCreateStringAttribute", + "tags": [ + "databases" + ], + "description": "Create a string attribute.\n", + "responses": { + "202": { + "description": "AttributeString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeString" + } + } + } + } + }, + "x-appwrite": { + "method": "createStringAttribute", + "group": "attributes", + "weight": 82, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "size": { + "type": "integer", + "description": "Attribute size for text attributes, in number of characters.", + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string\/{key}": { + "patch": { + "summary": "Update string attribute", + "operationId": "databasesUpdateStringAttribute", + "tags": [ + "databases" + ], + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeString", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeString" + } + } + } + } + }, + "x-appwrite": { + "method": "updateStringAttribute", + "group": "attributes", + "weight": 94, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string attribute.", + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url": { + "post": { + "summary": "Create URL attribute", + "operationId": "databasesCreateUrlAttribute", + "tags": [ + "databases" + ], + "description": "Create a URL attribute.\n", + "responses": { + "202": { + "description": "AttributeURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeUrl" + } + } + } + } + }, + "x-appwrite": { + "method": "createUrlAttribute", + "group": "attributes", + "weight": 86, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url\/{key}": { + "patch": { + "summary": "Update URL attribute", + "operationId": "databasesUpdateUrlAttribute", + "tags": [ + "databases" + ], + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeURL", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeUrl" + } + } + } + } + }, + "x-appwrite": { + "method": "updateUrlAttribute", + "group": "attributes", + "weight": 98, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}": { + "get": { + "summary": "Get attribute", + "operationId": "databasesGetAttribute", + "tags": [ + "databases" + ], + "description": "Get attribute by ID.", + "responses": { + "200": { + "description": "AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeDatetime, or AttributeRelationship, or AttributeString", + "content": { + "application\/json": { + "schema": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ] + } + } + } + } + }, + "x-appwrite": { + "method": "getAttribute", + "group": "attributes", + "weight": 93, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete attribute", + "operationId": "databasesDeleteAttribute", + "tags": [ + "databases" + ], + "description": "Deletes an attribute.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteAttribute", + "group": "attributes", + "weight": 104, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}\/relationship": { + "patch": { + "summary": "Update relationship attribute", + "operationId": "databasesUpdateRelationshipAttribute", + "tags": [ + "databases" + ], + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "200": { + "description": "AttributeRelationship", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/attributeRelationship" + } + } + } + } + }, + "x-appwrite": { + "method": "updateRelationshipAttribute", + "group": "attributes", + "weight": 103, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "databasesListDocuments", + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "listDocuments", + "group": "documents", + "weight": 110, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "tags": [ + "databases" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "createDocument", + "group": "documents", + "weight": 109, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createDocument", + "auth": { + "Admin": [], + "Session": [], + "Key": [], + "JWT": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + }, + { + "name": "createDocuments", + "auth": { + "Admin": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/components\/schemas\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<DOCUMENT_ID>" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + } + } + }, + "put": { + "summary": "Create or update documents", + "operationId": "databasesUpsertDocuments", + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 118, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "documents": { + "type": "array", + "description": "Array of document data as JSON objects. May contain partial documents.", + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "documents" + ] + } + } + } + } + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDocuments", + "group": "documents", + "weight": 117, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "Documents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/documentList" + } + } + } + } + }, + "x-appwrite": { + "method": "deleteDocuments", + "group": "documents", + "weight": 120, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "databasesGetDocument", + "tags": [ + "databases" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "getDocument", + "group": "documents", + "weight": 111, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert document", + "operationId": "databasesUpsertDocument", + "tags": [ + "databases" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "upsertDocument", + "group": "documents", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include all required attributes of the document to be created or updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ] + } + } + } + } + }, + "patch": { + "summary": "Update document", + "operationId": "databasesUpdateDocument", + "tags": [ + "databases" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDocument", + "group": "documents", + "weight": 113, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete document", + "operationId": "databasesDeleteDocument", + "tags": [ + "databases" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDocument", + "group": "documents", + "weight": 119, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "databasesListIndexes", + "tags": [ + "databases" + ], + "description": "List indexes in the collection.", + "responses": { + "200": { + "description": "Indexes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/indexList" + } + } + } + } + }, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 106, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "databasesCreateIndex", + "tags": [ + "databases" + ], + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", + "responses": { + "202": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "x-appwrite": { + "method": "createIndex", + "group": "collections", + "weight": 105, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "attributes": { + "type": "array", + "description": "Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "attributes" + ] + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "databasesGetIndex", + "tags": [ + "databases" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/index" + } + } + } + } + }, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 107, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "databasesDeleteIndex", + "tags": [ + "databases" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ] + } + }, + "\/functions": { + "get": { + "summary": "List functions", + "operationId": "functionsList", + "tags": [ + "functions" + ], + "description": "Get a list of all the project's functions. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Functions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/functionList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "group": "functions", + "weight": 378, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's functions. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create function", + "operationId": "functionsCreate", + "tags": [ + "functions" + ], + "description": "Create a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "responses": { + "201": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "x-appwrite": { + "method": "create", + "group": "functions", + "weight": 375, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "functionId": { + "type": "string", + "description": "Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<FUNCTION_ID>" + }, + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Function maximum execution time in seconds.", + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "x-example": "<ENTRYPOINT>" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "x-example": "<COMMANDS>" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function.", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function.", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "x-example": null + } + }, + "required": [ + "functionId", + "name", + "runtime" + ] + } + } + } + } + } + }, + "\/functions\/runtimes": { + "get": { + "summary": "List runtimes", + "operationId": "functionsListRuntimes", + "tags": [ + "functions" + ], + "description": "Get a list of all runtimes that are currently active on your instance.", + "responses": { + "200": { + "description": "Runtimes List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/runtimeList" + } + } + } + } + }, + "x-appwrite": { + "method": "listRuntimes", + "group": "runtimes", + "weight": 380, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-runtimes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all runtimes that are currently active on your instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "functionsListSpecifications", + "tags": [ + "functions" + ], + "description": "List allowed function specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/specificationList" + } + } + } + } + }, + "x-appwrite": { + "method": "listSpecifications", + "group": "runtimes", + "weight": 381, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed function specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/{functionId}": { + "get": { + "summary": "Get function", + "operationId": "functionsGet", + "tags": [ + "functions" + ], + "description": "Get a function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "functions", + "weight": 376, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update function", + "operationId": "functionsUpdate", + "tags": [ + "functions" + ], + "description": "Update function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "x-appwrite": { + "method": "update", + "group": "functions", + "weight": 377, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Maximum execution time in seconds.", + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "x-example": "<ENTRYPOINT>" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "x-example": "<COMMANDS>" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Controle System) deployment.", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function", + "x-example": "<PROVIDER_REPOSITORY_ID>", + "x-nullable": true + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "x-example": null + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete function", + "operationId": "functionsDelete", + "tags": [ + "functions" + ], + "description": "Delete a function by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "functions", + "weight": 379, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployment": { + "patch": { + "summary": "Update function's deployment", + "operationId": "functionsUpdateFunctionDeployment", + "tags": [ + "functions" + ], + "description": "Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "responses": { + "200": { + "description": "Function", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/function" + } + } + } + } + }, + "x-appwrite": { + "method": "updateFunctionDeployment", + "group": "functions", + "weight": 384, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update-function-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "functionsListDeployments", + "tags": [ + "functions" + ], + "description": "Get a list of all the function's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deploymentList" + } + } + } + } + }, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 385, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the function's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "functionsCreateDeployment", + "tags": [ + "functions" + ], + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 382, + "cookies": false, + "type": "upload", + "deprecated": false, + "demo": "functions\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "entrypoint": { + "type": "string", + "description": "Entrypoint File.", + "x-example": "<ENTRYPOINT>" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "x-example": "<COMMANDS>" + }, + "code": { + "type": "string", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "x-example": null + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "code", + "activate" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "functionsCreateDuplicateDeployment", + "tags": [ + "functions" + ], + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 390, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "<DEPLOYMENT_ID>" + }, + "buildId": { + "type": "string", + "description": "Build unique ID.", + "x-example": "<BUILD_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "functionsCreateTemplateDeployment", + "tags": [ + "functions" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 387, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "x-example": "<REPOSITORY>" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "x-example": "<OWNER>" + }, + "rootDirectory": { + "type": "string", + "description": "Path to function code in the template repo.", + "x-example": "<ROOT_DIRECTORY>" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the function template.", + "x-example": "<VERSION>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "functionsCreateVcsDeployment", + "tags": [ + "functions" + ], + "description": "Create a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 388, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "x-example": "branch", + "enum": [ + "branch", + "commit" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "x-example": "<REFERENCE>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "functionsGetDeployment", + "tags": [ + "functions" + ], + "description": "Get a function deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 383, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "functionsDeleteDeployment", + "tags": [ + "functions" + ], + "description": "Delete a code deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 386, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a code deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "functionsGetDeploymentDownload", + "tags": [ + "functions" + ], + "description": "Get a function deployment 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.", + "responses": { + "200": { + "description": "File" + } + }, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 389, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "functions\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment 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.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "schema": { + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source" + }, + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "functionsUpdateDeploymentStatus", + "tags": [ + "functions" + ], + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 391, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/executions": { + "get": { + "summary": "List executions", + "operationId": "functionsListExecutions", + "tags": [ + "functions" + ], + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "x-appwrite": { + "method": "listExecutions", + "group": "executions", + "weight": 394, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-executions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create execution", + "operationId": "functionsCreateExecution", + "tags": [ + "functions" + ], + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "responses": { + "201": { + "description": "Execution", + "content": { + "multipart\/form-data": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "x-appwrite": { + "method": "createExecution", + "group": "executions", + "weight": 392, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "x-example": "<BODY>" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "x-example": "<PATH>" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is GET.", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "string", + "description": "HTTP headers of execution. Defaults to empty.", + "x-example": null + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/functions\/{functionId}\/executions\/{executionId}": { + "get": { + "summary": "Get execution", + "operationId": "functionsGetExecution", + "tags": [ + "functions" + ], + "description": "Get a function execution log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "x-appwrite": { + "method": "getExecution", + "group": "executions", + "weight": 393, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<EXECUTION_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete execution", + "operationId": "functionsDeleteExecution", + "tags": [ + "functions" + ], + "description": "Delete a function execution by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteExecution", + "group": "executions", + "weight": 395, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function execution by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<EXECUTION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "functionsListVariables", + "tags": [ + "functions" + ], + "description": "Get a list of all variables of a specific function.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 400, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "functionsCreateVariable", + "tags": [ + "functions" + ], + "description": "Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 398, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + } + } + } + }, + "\/functions\/{functionId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "functionsGetVariable", + "tags": [ + "functions" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 399, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "functionsUpdateVariable", + "tags": [ + "functions" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 401, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete variable", + "operationId": "functionsDeleteVariable", + "tags": [ + "functions" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 402, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FUNCTION_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/graphql": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlQuery", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "x-appwrite": { + "method": "query", + "group": "graphql", + "weight": 308, + "cookies": false, + "type": "graphql", + "deprecated": false, + "demo": "graphql\/query.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/graphql\/mutation": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlMutation", + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/any" + } + } + } + } + }, + "x-appwrite": { + "method": "mutation", + "group": "graphql", + "weight": 307, + "cookies": false, + "type": "graphql", + "deprecated": false, + "demo": "graphql\/mutation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/health": { + "get": { + "summary": "Get HTTP", + "operationId": "healthGet", + "tags": [ + "health" + ], + "description": "Check the Appwrite HTTP server is up and responsive.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "health", + "weight": 132, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/anti-virus": { + "get": { + "summary": "Get antivirus", + "operationId": "healthGetAntivirus", + "tags": [ + "health" + ], + "description": "Check the Appwrite Antivirus server is up and connection is successful.", + "responses": { + "200": { + "description": "Health Antivirus", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthAntivirus" + } + } + } + } + }, + "x-appwrite": { + "method": "getAntivirus", + "group": "health", + "weight": 153, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-antivirus.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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/cache": { + "get": { + "summary": "Get cache", + "operationId": "healthGetCache", + "tags": [ + "health" + ], + "description": "Check the Appwrite in-memory cache servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "x-appwrite": { + "method": "getCache", + "group": "health", + "weight": 135, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/certificate": { + "get": { + "summary": "Get the SSL certificate for a domain", + "operationId": "healthGetCertificate", + "tags": [ + "health" + ], + "description": "Get the SSL certificate for a domain", + "responses": { + "200": { + "description": "Health Certificate", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthCertificate" + } + } + } + } + }, + "x-appwrite": { + "method": "getCertificate", + "group": "health", + "weight": 140, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-certificate.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-certificate.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "domain", + "description": "string", + "required": false, + "schema": { + "type": "string" + }, + "in": "query" + } + ] + } + }, + "\/health\/db": { + "get": { + "summary": "Get DB", + "operationId": "healthGetDB", + "tags": [ + "health" + ], + "description": "Check the Appwrite database servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "x-appwrite": { + "method": "getDB", + "group": "health", + "weight": 134, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/pubsub": { + "get": { + "summary": "Get pubsub", + "operationId": "healthGetPubSub", + "tags": [ + "health" + ], + "description": "Check the Appwrite pub-sub servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "x-appwrite": { + "method": "getPubSub", + "group": "health", + "weight": 136, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-pub-sub.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-pubsub.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/queue\/builds": { + "get": { + "summary": "Get builds queue", + "operationId": "healthGetQueueBuilds", + "tags": [ + "health" + ], + "description": "Get the number of builds that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueBuilds", + "group": "queue", + "weight": 142, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-builds.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-builds.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/certificates": { + "get": { + "summary": "Get certificates queue", + "operationId": "healthGetQueueCertificates", + "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.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueCertificates", + "group": "queue", + "weight": 141, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/databases": { + "get": { + "summary": "Get databases queue", + "operationId": "healthGetQueueDatabases", + "tags": [ + "health" + ], + "description": "Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueDatabases", + "group": "queue", + "weight": 143, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-databases.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-databases.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Queue name for which to check the queue size", + "required": false, + "schema": { + "type": "string", + "x-example": "<NAME>", + "default": "database_db_main" + }, + "in": "query" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/deletes": { + "get": { + "summary": "Get deletes queue", + "operationId": "healthGetQueueDeletes", + "tags": [ + "health" + ], + "description": "Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueDeletes", + "group": "queue", + "weight": 144, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-deletes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-deletes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/failed\/{name}": { + "get": { + "summary": "Get number of failed queue jobs", + "operationId": "healthGetFailedJobs", + "tags": [ + "health" + ], + "description": "Returns the amount of failed jobs in a given queue.\n", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getFailedJobs", + "group": "queue", + "weight": 154, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-failed-jobs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-failed-queue-jobs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "The name of the queue", + "required": true, + "schema": { + "type": "string", + "x-example": "v1-database", + "enum": [ + "v1-database", + "v1-deletes", + "v1-audits", + "v1-mails", + "v1-functions", + "v1-stats-resources", + "v1-stats-usage", + "v1-webhooks", + "v1-certificates", + "v1-builds", + "v1-messaging", + "v1-migrations" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "in": "path" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/functions": { + "get": { + "summary": "Get functions queue", + "operationId": "healthGetQueueFunctions", + "tags": [ + "health" + ], + "description": "Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueFunctions", + "group": "queue", + "weight": 148, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/logs": { + "get": { + "summary": "Get logs queue", + "operationId": "healthGetQueueLogs", + "tags": [ + "health" + ], + "description": "Get the number of logs that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueLogs", + "group": "queue", + "weight": 139, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/mails": { + "get": { + "summary": "Get mails queue", + "operationId": "healthGetQueueMails", + "tags": [ + "health" + ], + "description": "Get the number of mails that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueMails", + "group": "queue", + "weight": 145, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-mails.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-mails.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/messaging": { + "get": { + "summary": "Get messaging queue", + "operationId": "healthGetQueueMessaging", + "tags": [ + "health" + ], + "description": "Get the number of messages that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueMessaging", + "group": "queue", + "weight": 146, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-messaging.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-messaging.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/migrations": { + "get": { + "summary": "Get migrations queue", + "operationId": "healthGetQueueMigrations", + "tags": [ + "health" + ], + "description": "Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueMigrations", + "group": "queue", + "weight": 147, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-migrations.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-migrations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-resources": { + "get": { + "summary": "Get stats resources queue", + "operationId": "healthGetQueueStatsResources", + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueStatsResources", + "group": "queue", + "weight": 149, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-stats-resources.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-usage": { + "get": { + "summary": "Get stats usage queue", + "operationId": "healthGetQueueUsage", + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueUsage", + "group": "queue", + "weight": 150, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/queue\/webhooks": { + "get": { + "summary": "Get webhooks queue", + "operationId": "healthGetQueueWebhooks", + "tags": [ + "health" + ], + "description": "Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthQueue" + } + } + } + } + }, + "x-appwrite": { + "method": "getQueueWebhooks", + "group": "queue", + "weight": 138, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 5000 + }, + "in": "query" + } + ] + } + }, + "\/health\/storage": { + "get": { + "summary": "Get storage", + "operationId": "healthGetStorage", + "tags": [ + "health" + ], + "description": "Check the Appwrite storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "x-appwrite": { + "method": "getStorage", + "group": "storage", + "weight": 152, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-storage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/storage\/local": { + "get": { + "summary": "Get local storage", + "operationId": "healthGetStorageLocal", + "tags": [ + "health" + ], + "description": "Check the Appwrite local storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthStatus" + } + } + } + } + }, + "x-appwrite": { + "method": "getStorageLocal", + "group": "storage", + "weight": 151, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/time": { + "get": { + "summary": "Get time", + "operationId": "healthGetTime", + "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.", + "responses": { + "200": { + "description": "Health Time", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/healthTime" + } + } + } + } + }, + "x-appwrite": { + "method": "getTime", + "group": "health", + "weight": 137, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/locale": { + "get": { + "summary": "Get user locale", + "operationId": "localeGet", + "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))", + "responses": { + "200": { + "description": "Locale", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/locale" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 124, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/codes": { + "get": { + "summary": "List locale codes", + "operationId": "localeListCodes", + "tags": [ + "locale" + ], + "description": "List of all locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes).", + "responses": { + "200": { + "description": "Locale codes list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/localeCodeList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCodes", + "group": null, + "weight": 125, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/continents": { + "get": { + "summary": "List continents", + "operationId": "localeListContinents", + "tags": [ + "locale" + ], + "description": "List of all continents. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Continents List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/continentList" + } + } + } + } + }, + "x-appwrite": { + "method": "listContinents", + "group": null, + "weight": 129, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-continents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries": { + "get": { + "summary": "List countries", + "operationId": "localeListCountries", + "tags": [ + "locale" + ], + "description": "List of all countries. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCountries", + "group": null, + "weight": 126, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/eu": { + "get": { + "summary": "List EU countries", + "operationId": "localeListCountriesEU", + "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.", + "responses": { + "200": { + "description": "Countries List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/countryList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCountriesEU", + "group": null, + "weight": 127, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries-e-u.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/phones": { + "get": { + "summary": "List countries phone codes", + "operationId": "localeListCountriesPhones", + "tags": [ + "locale" + ], + "description": "List of all countries phone codes. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Phones List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/phoneList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCountriesPhones", + "group": null, + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries-phones.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/currencies": { + "get": { + "summary": "List currencies", + "operationId": "localeListCurrencies", + "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.", + "responses": { + "200": { + "description": "Currencies List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/currencyList" + } + } + } + } + }, + "x-appwrite": { + "method": "listCurrencies", + "group": null, + "weight": 130, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-currencies.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/languages": { + "get": { + "summary": "List languages", + "operationId": "localeListLanguages", + "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.", + "responses": { + "200": { + "description": "Languages List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/languageList" + } + } + } + } + }, + "x-appwrite": { + "method": "listLanguages", + "group": null, + "weight": 131, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-languages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/messages": { + "get": { + "summary": "List messages", + "operationId": "messagingListMessages", + "tags": [ + "messaging" + ], + "description": "Get a list of all messages from the current Appwrite project.", + "responses": { + "200": { + "description": "Message list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/messageList" + } + } + } + } + }, + "x-appwrite": { + "method": "listMessages", + "group": "messages", + "weight": 362, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-messages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-messages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/email": { + "post": { + "summary": "Create email", + "operationId": "messagingCreateEmail", + "tags": [ + "messaging" + ], + "description": "Create a new email message.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "createEmail", + "group": "messages", + "weight": 359, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<MESSAGE_ID>" + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "x-example": "<SUBJECT>" + }, + "content": { + "type": "string", + "description": "Email Content.", + "x-example": "<CONTENT>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + } + }, + "required": [ + "messageId", + "subject", + "content" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/email\/{messageId}": { + "patch": { + "summary": "Update email", + "operationId": "messagingUpdateEmail", + "tags": [ + "messaging" + ], + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "updateEmail", + "group": "messages", + "weight": 366, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "x-example": "<SUBJECT>" + }, + "content": { + "type": "string", + "description": "Email Content.", + "x-example": "<CONTENT>" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "x-example": false + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "x-example": null, + "items": { + "type": "string" + } + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/push": { + "post": { + "summary": "Create push notification", + "operationId": "messagingCreatePush", + "tags": [ + "messaging" + ], + "description": "Create a new push notification.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "createPush", + "group": "messages", + "weight": 361, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<MESSAGE_ID>" + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "x-example": "<TITLE>" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "x-example": "<BODY>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "data": { + "type": "object", + "description": "Additional key-value pair data for push notification.", + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web Platform.", + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS Platform.", + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android Platform.", + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android Platform.", + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + }, + "required": [ + "messageId" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/push\/{messageId}": { + "patch": { + "summary": "Update push notification", + "operationId": "messagingUpdatePush", + "tags": [ + "messaging" + ], + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePush", + "group": "messages", + "weight": 368, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "x-example": "<TITLE>" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "x-example": "<BODY>" + }, + "data": { + "type": "object", + "description": "Additional Data for push notification.", + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web platforms.", + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS platforms.", + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android platforms.", + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android platforms.", + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS platforms.", + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/sms": { + "post": { + "summary": "Create SMS", + "operationId": "messagingCreateSms", + "tags": [ + "messaging" + ], + "description": "Create a new SMS message.", + "responses": { + "201": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "createSms", + "group": "messages", + "weight": 360, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<MESSAGE_ID>" + }, + "content": { + "type": "string", + "description": "SMS Content.", + "x-example": "<CONTENT>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + } + }, + "required": [ + "messageId", + "content" + ] + } + } + } + } + } + }, + "\/messaging\/messages\/sms\/{messageId}": { + "patch": { + "summary": "Update SMS", + "operationId": "messagingUpdateSms", + "tags": [ + "messaging" + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSms", + "group": "messages", + "weight": 367, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "x-example": null, + "items": { + "type": "string" + } + }, + "content": { + "type": "string", + "description": "Email Content.", + "x-example": "<CONTENT>" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/messaging\/messages\/{messageId}": { + "get": { + "summary": "Get message", + "operationId": "messagingGetMessage", + "tags": [ + "messaging" + ], + "description": "Get a message by its unique ID.\n", + "responses": { + "200": { + "description": "Message", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/message" + } + } + } + } + }, + "x-appwrite": { + "method": "getMessage", + "group": "messages", + "weight": 365, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-message.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete message", + "operationId": "messagingDelete", + "tags": [ + "messaging" + ], + "description": "Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "messages", + "weight": 369, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/logs": { + "get": { + "summary": "List message logs", + "operationId": "messagingListMessageLogs", + "tags": [ + "messaging" + ], + "description": "Get the message activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listMessageLogs", + "group": "logs", + "weight": 363, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-message-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/targets": { + "get": { + "summary": "List message targets", + "operationId": "messagingListTargets", + "tags": [ + "messaging" + ], + "description": "Get a list of the targets associated with a message.", + "responses": { + "200": { + "description": "Target list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/targetList" + } + } + } + } + }, + "x-appwrite": { + "method": "listTargets", + "group": "messages", + "weight": 364, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MESSAGE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/providers": { + "get": { + "summary": "List providers", + "operationId": "messagingListProviders", + "tags": [ + "messaging" + ], + "description": "Get a list of all providers from the current Appwrite project.", + "responses": { + "200": { + "description": "Provider list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/providerList" + } + } + } + } + }, + "x-appwrite": { + "method": "listProviders", + "group": "providers", + "weight": 334, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-providers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-providers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/messaging\/providers\/apns": { + "post": { + "summary": "Create APNS provider", + "operationId": "messagingCreateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Apple Push Notification service provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createApnsProvider", + "group": "providers", + "weight": 333, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/apns\/{providerId}": { + "patch": { + "summary": "Update APNS provider", + "operationId": "messagingUpdateApnsProvider", + "tags": [ + "messaging" + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateApnsProvider", + "group": "providers", + "weight": 346, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "x-example": false + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/fcm": { + "post": { + "summary": "Create FCM provider", + "operationId": "messagingCreateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createFcmProvider", + "group": "providers", + "weight": 332, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "x-example": "{}" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/fcm\/{providerId}": { + "patch": { + "summary": "Update FCM provider", + "operationId": "messagingUpdateFcmProvider", + "tags": [ + "messaging" + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateFcmProvider", + "group": "providers", + "weight": 345, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "x-example": "{}" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/mailgun": { + "post": { + "summary": "Create Mailgun provider", + "operationId": "messagingCreateMailgunProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Mailgun provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createMailgunProvider", + "group": "providers", + "weight": 324, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/mailgun\/{providerId}": { + "patch": { + "summary": "Update Mailgun provider", + "operationId": "messagingUpdateMailgunProvider", + "tags": [ + "messaging" + ], + "description": "Update a Mailgun provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMailgunProvider", + "group": "providers", + "weight": 337, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/msg91": { + "post": { + "summary": "Create Msg91 provider", + "operationId": "messagingCreateMsg91Provider", + "tags": [ + "messaging" + ], + "description": "Create a new MSG91 provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createMsg91Provider", + "group": "providers", + "weight": 327, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-msg91provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "x-example": "<AUTH_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/msg91\/{providerId}": { + "patch": { + "summary": "Update Msg91 provider", + "operationId": "messagingUpdateMsg91Provider", + "tags": [ + "messaging" + ], + "description": "Update a MSG91 provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMsg91Provider", + "group": "providers", + "weight": 340, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-msg91provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID.", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "x-example": "<AUTH_KEY>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/sendgrid": { + "post": { + "summary": "Create Sendgrid provider", + "operationId": "messagingCreateSendgridProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Sendgrid provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createSendgridProvider", + "group": "providers", + "weight": 325, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/sendgrid\/{providerId}": { + "patch": { + "summary": "Update Sendgrid provider", + "operationId": "messagingUpdateSendgridProvider", + "tags": [ + "messaging" + ], + "description": "Update a Sendgrid provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSendgridProvider", + "group": "providers", + "weight": 338, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/smtp": { + "post": { + "summary": "Create SMTP provider", + "operationId": "messagingCreateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Create a new SMTP provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createSmtpProvider", + "group": "providers", + "weight": 326, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "The default SMTP server port.", + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be omitted, 'ssl', or 'tls'", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name", + "host" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/smtp\/{providerId}": { + "patch": { + "summary": "Update SMTP provider", + "operationId": "messagingUpdateSmtpProvider", + "tags": [ + "messaging" + ], + "description": "Update a SMTP provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSmtpProvider", + "group": "providers", + "weight": 339, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "SMTP port.", + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be 'ssl' or 'tls'", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "x-example": "<REPLY_TO_EMAIL>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/telesign": { + "post": { + "summary": "Create Telesign provider", + "operationId": "messagingCreateTelesignProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Telesign provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createTelesignProvider", + "group": "providers", + "weight": 328, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/telesign\/{providerId}": { + "patch": { + "summary": "Update Telesign provider", + "operationId": "messagingUpdateTelesignProvider", + "tags": [ + "messaging" + ], + "description": "Update a Telesign provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateTelesignProvider", + "group": "providers", + "weight": 341, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/textmagic": { + "post": { + "summary": "Create Textmagic provider", + "operationId": "messagingCreateTextmagicProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Textmagic provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createTextmagicProvider", + "group": "providers", + "weight": 329, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/textmagic\/{providerId}": { + "patch": { + "summary": "Update Textmagic provider", + "operationId": "messagingUpdateTextmagicProvider", + "tags": [ + "messaging" + ], + "description": "Update a Textmagic provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateTextmagicProvider", + "group": "providers", + "weight": 342, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/twilio": { + "post": { + "summary": "Create Twilio provider", + "operationId": "messagingCreateTwilioProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Twilio provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createTwilioProvider", + "group": "providers", + "weight": 330, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "x-example": "<AUTH_TOKEN>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/twilio\/{providerId}": { + "patch": { + "summary": "Update Twilio provider", + "operationId": "messagingUpdateTwilioProvider", + "tags": [ + "messaging" + ], + "description": "Update a Twilio provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateTwilioProvider", + "group": "providers", + "weight": 343, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "x-example": "<AUTH_TOKEN>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/vonage": { + "post": { + "summary": "Create Vonage provider", + "operationId": "messagingCreateVonageProvider", + "tags": [ + "messaging" + ], + "description": "Create a new Vonage provider.", + "responses": { + "201": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "createVonageProvider", + "group": "providers", + "weight": 331, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "x-example": "<API_SECRET>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/providers\/vonage\/{providerId}": { + "patch": { + "summary": "Update Vonage provider", + "operationId": "messagingUpdateVonageProvider", + "tags": [ + "messaging" + ], + "description": "Update a Vonage provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "updateVonageProvider", + "group": "providers", + "weight": 344, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "x-example": "<API_SECRET>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "x-example": "<FROM>" + } + } + } + } + } + } + } + }, + "\/messaging\/providers\/{providerId}": { + "get": { + "summary": "Get provider", + "operationId": "messagingGetProvider", + "tags": [ + "messaging" + ], + "description": "Get a provider by its unique ID.\n", + "responses": { + "200": { + "description": "Provider", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/provider" + } + } + } + } + }, + "x-appwrite": { + "method": "getProvider", + "group": "providers", + "weight": 336, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete provider", + "operationId": "messagingDeleteProvider", + "tags": [ + "messaging" + ], + "description": "Delete a provider by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteProvider", + "group": "providers", + "weight": 347, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/providers\/{providerId}\/logs": { + "get": { + "summary": "List provider logs", + "operationId": "messagingListProviderLogs", + "tags": [ + "messaging" + ], + "description": "Get the provider activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listProviderLogs", + "group": "providers", + "weight": 335, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-provider-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-provider-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<PROVIDER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/subscribers\/{subscriberId}\/logs": { + "get": { + "summary": "List subscriber logs", + "operationId": "messagingListSubscriberLogs", + "tags": [ + "messaging" + ], + "description": "Get the subscriber activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listSubscriberLogs", + "group": "subscribers", + "weight": 356, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-subscriber-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscriber-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SUBSCRIBER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/topics": { + "get": { + "summary": "List topics", + "operationId": "messagingListTopics", + "tags": [ + "messaging" + ], + "description": "Get a list of all topics from the current Appwrite project.", + "responses": { + "200": { + "description": "Topic list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topicList" + } + } + } + } + }, + "x-appwrite": { + "method": "listTopics", + "group": "topics", + "weight": 349, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-topics.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topics.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create topic", + "operationId": "messagingCreateTopic", + "tags": [ + "messaging" + ], + "description": "Create a new topic.", + "responses": { + "201": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "x-appwrite": { + "method": "createTopic", + "group": "topics", + "weight": 348, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "topicId": { + "type": "string", + "description": "Topic ID. Choose a custom Topic ID or a new Topic ID.", + "x-example": "<TOPIC_ID>" + }, + "name": { + "type": "string", + "description": "Topic Name.", + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "topicId", + "name" + ] + } + } + } + } + } + }, + "\/messaging\/topics\/{topicId}": { + "get": { + "summary": "Get topic", + "operationId": "messagingGetTopic", + "tags": [ + "messaging" + ], + "description": "Get a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "x-appwrite": { + "method": "getTopic", + "group": "topics", + "weight": 351, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update topic", + "operationId": "messagingUpdateTopic", + "tags": [ + "messaging" + ], + "description": "Update a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/topic" + } + } + } + } + }, + "x-appwrite": { + "method": "updateTopic", + "group": "topics", + "weight": 352, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Topic Name.", + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete topic", + "operationId": "messagingDeleteTopic", + "tags": [ + "messaging" + ], + "description": "Delete a topic by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteTopic", + "group": "topics", + "weight": 353, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/logs": { + "get": { + "summary": "List topic logs", + "operationId": "messagingListTopicLogs", + "tags": [ + "messaging" + ], + "description": "Get the topic activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listTopicLogs", + "group": "topics", + "weight": 350, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-topic-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topic-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers": { + "get": { + "summary": "List subscribers", + "operationId": "messagingListSubscribers", + "tags": [ + "messaging" + ], + "description": "Get a list of all subscribers from the current Appwrite project.", + "responses": { + "200": { + "description": "Subscriber list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriberList" + } + } + } + } + }, + "x-appwrite": { + "method": "listSubscribers", + "group": "subscribers", + "weight": 355, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-subscribers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscribers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create subscriber", + "operationId": "messagingCreateSubscriber", + "tags": [ + "messaging" + ], + "description": "Create a new subscriber.", + "responses": { + "201": { + "description": "Subscriber", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriber" + } + } + } + } + }, + "x-appwrite": { + "method": "createSubscriber", + "group": "subscribers", + "weight": 354, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "JWT": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID to subscribe to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "subscriberId": { + "type": "string", + "description": "Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.", + "x-example": "<SUBSCRIBER_ID>" + }, + "targetId": { + "type": "string", + "description": "Target ID. The target ID to link to the specified Topic ID.", + "x-example": "<TARGET_ID>" + } + }, + "required": [ + "subscriberId", + "targetId" + ] + } + } + } + } + } + }, + "\/messaging\/topics\/{topicId}\/subscribers\/{subscriberId}": { + "get": { + "summary": "Get subscriber", + "operationId": "messagingGetSubscriber", + "tags": [ + "messaging" + ], + "description": "Get a subscriber by its unique ID.\n", + "responses": { + "200": { + "description": "Subscriber", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/subscriber" + } + } + } + } + }, + "x-appwrite": { + "method": "getSubscriber", + "group": "subscribers", + "weight": 357, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SUBSCRIBER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete subscriber", + "operationId": "messagingDeleteSubscriber", + "tags": [ + "messaging" + ], + "description": "Delete a subscriber by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSubscriber", + "group": "subscribers", + "weight": 358, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "JWT": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOPIC_ID>" + }, + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SUBSCRIBER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites": { + "get": { + "summary": "List sites", + "operationId": "sitesList", + "tags": [ + "sites" + ], + "description": "Get a list of all the project's sites. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Sites List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/siteList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "group": "sites", + "weight": 407, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's sites. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create site", + "operationId": "sitesCreate", + "tags": [ + "sites" + ], + "description": "Create a new site.", + "responses": { + "201": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "x-appwrite": { + "method": "create", + "group": "sites", + "weight": 405, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "siteId": { + "type": "string", + "description": "Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<SITE_ID>" + }, + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "x-example": "<INSTALLATION_ID>" + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "x-example": "<FALLBACK_FILE>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "x-example": null + } + }, + "required": [ + "siteId", + "name", + "framework", + "buildRuntime" + ] + } + } + } + } + } + }, + "\/sites\/frameworks": { + "get": { + "summary": "List frameworks", + "operationId": "sitesListFrameworks", + "tags": [ + "sites" + ], + "description": "Get a list of all frameworks that are currently available on the server instance.", + "responses": { + "200": { + "description": "Frameworks List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/frameworkList" + } + } + } + } + }, + "x-appwrite": { + "method": "listFrameworks", + "group": "frameworks", + "weight": 410, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-frameworks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all frameworks that are currently available on the server instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "sitesListSpecifications", + "tags": [ + "sites" + ], + "description": "List allowed site specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/specificationList" + } + } + } + } + }, + "x-appwrite": { + "method": "listSpecifications", + "group": "frameworks", + "weight": 433, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed site specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/{siteId}": { + "get": { + "summary": "Get site", + "operationId": "sitesGet", + "tags": [ + "sites" + ], + "description": "Get a site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "sites", + "weight": 406, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update site", + "operationId": "sitesUpdate", + "tags": [ + "sites" + ], + "description": "Update site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "x-appwrite": { + "method": "update", + "group": "sites", + "weight": 408, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "x-example": "<FALLBACK_FILE>" + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "x-example": null + } + }, + "required": [ + "name", + "framework" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete site", + "operationId": "sitesDelete", + "tags": [ + "sites" + ], + "description": "Delete a site by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "sites", + "weight": 409, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployment": { + "patch": { + "summary": "Update site's deployment", + "operationId": "sitesUpdateSiteDeployment", + "tags": [ + "sites" + ], + "description": "Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "responses": { + "200": { + "description": "Site", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/site" + } + } + } + } + }, + "x-appwrite": { + "method": "updateSiteDeployment", + "group": "sites", + "weight": 416, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update-site-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "sitesListDeployments", + "tags": [ + "sites" + ], + "description": "Get a list of all the site's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deploymentList" + } + } + } + } + }, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 415, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the site's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "sitesCreateDeployment", + "tags": [ + "sites" + ], + "description": "Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 411, + "cookies": false, + "type": "upload", + "deprecated": false, + "demo": "sites\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "installCommand": { + "type": "string", + "description": "Install Commands.", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Commands.", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory.", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "code": { + "type": "string", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "x-example": null + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "code", + "activate" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "sitesCreateDuplicateDeployment", + "tags": [ + "sites" + ], + "description": "Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 419, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "sitesCreateTemplateDeployment", + "tags": [ + "sites" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 412, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "x-example": "<REPOSITORY>" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "x-example": "<OWNER>" + }, + "rootDirectory": { + "type": "string", + "description": "Path to site code in the template repo.", + "x-example": "<ROOT_DIRECTORY>" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the site template.", + "x-example": "<VERSION>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "sitesCreateVcsDeployment", + "tags": [ + "sites" + ], + "description": "Create a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 413, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "x-example": "branch", + "enum": [ + "branch", + "commit", + "tag" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "x-example": "<REFERENCE>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "sitesGetDeployment", + "tags": [ + "sites" + ], + "description": "Get a site deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 414, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "sitesDeleteDeployment", + "tags": [ + "sites" + ], + "description": "Delete a site deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 417, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "sitesGetDeploymentDownload", + "tags": [ + "sites" + ], + "description": "Get a site deployment 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.", + "responses": { + "200": { + "description": "File" + } + }, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 418, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "sites\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment 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.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "schema": { + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source" + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "sitesUpdateDeploymentStatus", + "tags": [ + "sites" + ], + "description": "Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/deployment" + } + } + } + } + }, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 420, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DEPLOYMENT_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/logs": { + "get": { + "summary": "List logs", + "operationId": "sitesListLogs", + "tags": [ + "sites" + ], + "description": "Get a list of all site logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/executionList" + } + } + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 422, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all site logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/logs\/{logId}": { + "get": { + "summary": "Get log", + "operationId": "sitesGetLog", + "tags": [ + "sites" + ], + "description": "Get a site request log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/execution" + } + } + } + } + }, + "x-appwrite": { + "method": "getLog", + "group": "logs", + "weight": 421, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site request log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<LOG_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete log", + "operationId": "sitesDeleteLog", + "tags": [ + "sites" + ], + "description": "Delete a site log by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteLog", + "group": "logs", + "weight": 423, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<LOG_ID>" + }, + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "sitesListVariables", + "tags": [ + "sites" + ], + "description": "Get a list of all variables of a specific site.", + "responses": { + "200": { + "description": "Variables List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variableList" + } + } + } + } + }, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 426, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "sitesCreateVariable", + "tags": [ + "sites" + ], + "description": "Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "responses": { + "201": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 424, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + } + } + } + }, + "\/sites\/{siteId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "sitesGetVariable", + "tags": [ + "sites" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 425, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "sitesUpdateVariable", + "tags": [ + "sites" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/variable" + } + } + } + } + }, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 427, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete variable", + "operationId": "sitesDeleteVariable", + "tags": [ + "sites" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 428, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SITE_ID>" + }, + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<VARIABLE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets": { + "get": { + "summary": "List buckets", + "operationId": "storageListBuckets", + "tags": [ + "storage" + ], + "description": "Get a list of all the storage buckets. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Buckets List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucketList" + } + } + } + } + }, + "x-appwrite": { + "method": "listBuckets", + "group": "buckets", + "weight": 209, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/list-buckets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create bucket", + "operationId": "storageCreateBucket", + "tags": [ + "storage" + ], + "description": "Create a new storage bucket.", + "responses": { + "201": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "x-appwrite": { + "method": "createBucket", + "group": "buckets", + "weight": 208, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/create-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<BUCKET_ID>" + }, + "name": { + "type": "string", + "description": "Bucket name", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "x-example": false + } + }, + "required": [ + "bucketId", + "name" + ] + } + } + } + } + } + }, + "\/storage\/buckets\/{bucketId}": { + "get": { + "summary": "Get bucket", + "operationId": "storageGetBucket", + "tags": [ + "storage" + ], + "description": "Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.", + "responses": { + "200": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "x-appwrite": { + "method": "getBucket", + "group": "buckets", + "weight": 210, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/get-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update bucket", + "operationId": "storageUpdateBucket", + "tags": [ + "storage" + ], + "description": "Update a storage bucket by its unique ID.", + "responses": { + "200": { + "description": "Bucket", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/bucket" + } + } + } + } + }, + "x-appwrite": { + "method": "updateBucket", + "group": "buckets", + "weight": 211, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/update-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Bucket name", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete bucket", + "operationId": "storageDeleteBucket", + "tags": [ + "storage" + ], + "description": "Delete a storage bucket by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteBucket", + "group": "buckets", + "weight": 212, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/delete-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files": { + "get": { + "summary": "List files", + "operationId": "storageListFiles", + "tags": [ + "storage" + ], + "description": "Get a list of all the user files. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Files List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/fileList" + } + } + } + } + }, + "x-appwrite": { + "method": "listFiles", + "group": "files", + "weight": 214, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file", + "operationId": "storageCreateFile", + "tags": [ + "storage" + ], + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "x-appwrite": { + "method": "createFile", + "group": "files", + "weight": 213, + "cookies": false, + "type": "upload", + "deprecated": false, + "demo": "storage\/create-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "multipart\/form-data": { + "schema": { + "type": "object", + "properties": { + "fileId": { + "type": "string", + "description": "File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<FILE_ID>", + "x-upload-id": true + }, + "file": { + "type": "string", + "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", + "x-example": null + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "fileId", + "file" + ] + } + } + } + } + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "Get file", + "operationId": "storageGetFile", + "tags": [ + "storage" + ], + "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "x-appwrite": { + "method": "getFile", + "group": "files", + "weight": 215, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update file", + "operationId": "storageUpdateFile", + "tags": [ + "storage" + ], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/file" + } + } + } + } + }, + "x-appwrite": { + "method": "updateFile", + "group": "files", + "weight": 220, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/update-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the file", + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete file", + "operationId": "storageDeleteFile", + "tags": [ + "storage" + ], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteFile", + "group": "files", + "weight": 221, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/delete-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download": { + "get": { + "summary": "Get file for download", + "operationId": "storageGetFileDownload", + "tags": [ + "storage" + ], + "description": "Get a 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.", + "responses": { + "200": { + "description": "File" + } + }, + "x-appwrite": { + "method": "getFileDownload", + "group": "files", + "weight": 217, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/preview": { + "get": { + "summary": "Get file preview", + "operationId": "storageGetFilePreview", + "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. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { + "description": "Image" + } + }, + "x-appwrite": { + "method": "getFilePreview", + "group": "files", + "weight": 216, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "width", + "description": "Resize preview image width, Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "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, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "schema": { + "type": "string", + "x-example": "center", + "enum": [ + "center", + "top-left", + "top", + "top-right", + "left", + "right", + "bottom-left", + "bottom", + "bottom-right" + ], + "x-enum-name": "ImageGravity", + "x-enum-keys": [], + "default": "center" + }, + "in": "query" + }, + { + "name": "quality", + "description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1 + }, + "in": "query" + }, + { + "name": "borderWidth", + "description": "Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "borderColor", + "description": "Preview image border color. Use a valid HEX color, no # is needed for prefix.", + "required": false, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + }, + { + "name": "borderRadius", + "description": "Preview image border radius in pixels. Pass an integer between 0 to 4000.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0 + }, + "in": "query" + }, + { + "name": "opacity", + "description": "Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.", + "required": false, + "schema": { + "type": "number", + "format": "float", + "x-example": 0, + "default": 1 + }, + "in": "query" + }, + { + "name": "rotation", + "description": "Preview image rotation in degrees. Pass an integer between -360 and 360.", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "x-example": -360, + "default": 0 + }, + "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, + "schema": { + "type": "string", + "default": "" + }, + "in": "query" + }, + { + "name": "output", + "description": "Output format type (jpeg, jpg, png, gif and webp).", + "required": false, + "schema": { + "type": "string", + "x-example": "jpg", + "enum": [ + "jpg", + "jpeg", + "png", + "webp", + "heic", + "avif", + "gif" + ], + "x-enum-name": "ImageFormat", + "x-enum-keys": [], + "default": "" + }, + "in": "query" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/view": { + "get": { + "summary": "Get file for view", + "operationId": "storageGetFileView", + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.", + "responses": { + "200": { + "description": "File" + } + }, + "x-appwrite": { + "method": "getFileView", + "group": "files", + "weight": 218, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "schema": { + "type": "string", + "x-example": "<TOKEN>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/teams": { + "get": { + "summary": "List teams", + "operationId": "teamsList", + "tags": [ + "teams" + ], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.", + "responses": { + "200": { + "description": "Teams List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/teamList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "group": "teams", + "weight": 225, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team", + "operationId": "teamsCreate", + "tags": [ + "teams" + ], + "description": "Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "x-appwrite": { + "method": "create", + "group": "teams", + "weight": 224, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<TEAM_ID>" + }, + "name": { + "type": "string", + "description": "Team name. Max length: 128 chars.", + "x-example": "<NAME>" + }, + "roles": { + "type": "array", + "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](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "teamId", + "name" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}": { + "get": { + "summary": "Get team", + "operationId": "teamsGet", + "tags": [ + "teams" + ], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "teams", + "weight": 226, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update name", + "operationId": "teamsUpdateName", + "tags": [ + "teams" + ], + "description": "Update the team's name by its unique ID.", + "responses": { + "200": { + "description": "Team", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/team" + } + } + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "teams", + "weight": 228, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "New team name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team", + "operationId": "teamsDelete", + "tags": [ + "teams" + ], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "teams", + "weight": 230, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships": { + "get": { + "summary": "List team memberships", + "operationId": "teamsListMemberships", + "tags": [ + "teams" + ], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Memberships List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membershipList" + } + } + } + } + }, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 232, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create team membership", + "operationId": "teamsCreateMembership", + "tags": [ + "teams" + ], + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", + "responses": { + "201": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "x-appwrite": { + "method": "createMembership", + "group": "memberships", + "weight": 231, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/create-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the new team member.", + "x-example": "email@example.com" + }, + "userId": { + "type": "string", + "description": "ID of the user to be added to a team.", + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "roles": { + "type": "array", + "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](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", + "x-example": "https:\/\/example.com" + }, + "name": { + "type": "string", + "description": "Name of the new team member. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "roles" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}": { + "get": { + "summary": "Get team membership", + "operationId": "teamsGetMembership", + "tags": [ + "teams" + ], + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "x-appwrite": { + "method": "getMembership", + "group": "memberships", + "weight": 233, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/get-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update membership", + "operationId": "teamsUpdateMembership", + "tags": [ + "teams" + ], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMembership", + "group": "memberships", + "weight": 234, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "roles": { + "type": "array", + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "roles" + ] + } + } + } + } + }, + "delete": { + "summary": "Delete team membership", + "operationId": "teamsDeleteMembership", + "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 it is not accepted.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMembership", + "group": "memberships", + "weight": 236, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}\/status": { + "patch": { + "summary": "Update team membership status", + "operationId": "teamsUpdateMembershipStatus", + "tags": [ + "teams" + ], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membership" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMembershipStatus", + "group": "memberships", + "weight": 235, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<MEMBERSHIP_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + } + } + } + }, + "\/teams\/{teamId}\/prefs": { + "get": { + "summary": "Get team preferences", + "operationId": "teamsGetPrefs", + "tags": [ + "teams" + ], + "description": "Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getPrefs).", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "teams", + "weight": 227, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update preferences", + "operationId": "teamsUpdatePrefs", + "tags": [ + "teams" + ], + "description": "Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "teams", + "weight": 229, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TEAM_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceTokenList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "group": "files", + "weight": 441, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire", + "required": false, + "schema": { + "type": "string", + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "group": "files", + "weight": 439, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "schema": { + "type": "string", + "x-example": "<BUCKET_ID>" + }, + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<FILE_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "x-example": null, + "x-nullable": true + } + } + } + } + } + } + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "tokens", + "weight": 440, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date.", + "responses": { + "200": { + "description": "ResourceToken", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/resourceToken" + } + } + } + } + }, + "x-appwrite": { + "method": "update", + "group": "tokens", + "weight": 442, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "x-example": null, + "x-nullable": true + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "tokens", + "weight": 443, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TOKEN_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users": { + "get": { + "summary": "List users", + "operationId": "usersList", + "tags": [ + "users" + ], + "description": "Get a list of all the project's users. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Users List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/userList" + } + } + } + } + }, + "x-appwrite": { + "method": "list", + "group": "users", + "weight": 247, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create user", + "operationId": "usersCreate", + "tags": [ + "users" + ], + "description": "Create a new user.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "create", + "group": "users", + "weight": 238, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "Plain text user password. Must be at least 8 chars.", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId" + ] + } + } + } + } + } + }, + "\/users\/argon2": { + "post": { + "summary": "Create user with Argon2 password", + "operationId": "usersCreateArgon2User", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Argon2](https:\/\/en.wikipedia.org\/wiki\/Argon2) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "createArgon2User", + "group": "users", + "weight": 241, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-argon2user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-argon2-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Argon2.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/bcrypt": { + "post": { + "summary": "Create user with bcrypt password", + "operationId": "usersCreateBcryptUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Bcrypt](https:\/\/en.wikipedia.org\/wiki\/Bcrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "createBcryptUser", + "group": "users", + "weight": 239, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-bcrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-bcrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Bcrypt.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/identities": { + "get": { + "summary": "List identities", + "operationId": "usersListIdentities", + "tags": [ + "users" + ], + "description": "Get identities for all users.", + "responses": { + "200": { + "description": "Identities List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/identityList" + } + } + } + } + }, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 255, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/users\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "usersDeleteIdentity", + "tags": [ + "users" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 278, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<IDENTITY_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/md5": { + "post": { + "summary": "Create user with MD5 password", + "operationId": "usersCreateMD5User", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [MD5](https:\/\/en.wikipedia.org\/wiki\/MD5) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "createMD5User", + "group": "users", + "weight": 240, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-m-d5user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-md5-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using MD5.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/phpass": { + "post": { + "summary": "Create user with PHPass password", + "operationId": "usersCreatePHPassUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [PHPass](https:\/\/www.openwall.com\/phpass\/) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "createPHPassUser", + "group": "users", + "weight": 243, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-p-h-pass-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-phpass-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using PHPass.", + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/scrypt": { + "post": { + "summary": "Create user with Scrypt password", + "operationId": "usersCreateScryptUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt](https:\/\/github.com\/Tarsnap\/scrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "createScryptUser", + "group": "users", + "weight": 244, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-scrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt.", + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Optional salt used to hash password.", + "x-example": "<PASSWORD_SALT>" + }, + "passwordCpu": { + "type": "integer", + "description": "Optional CPU cost used to hash password.", + "x-example": null + }, + "passwordMemory": { + "type": "integer", + "description": "Optional memory cost used to hash password.", + "x-example": null + }, + "passwordParallel": { + "type": "integer", + "description": "Optional parallelization cost used to hash password.", + "x-example": null + }, + "passwordLength": { + "type": "integer", + "description": "Optional hash length used to hash password.", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordCpu", + "passwordMemory", + "passwordParallel", + "passwordLength" + ] + } + } + } + } + } + }, + "\/users\/scrypt-modified": { + "post": { + "summary": "Create user with Scrypt modified password", + "operationId": "usersCreateScryptModifiedUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt Modified](https:\/\/gist.github.com\/Meldiron\/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "createScryptModifiedUser", + "group": "users", + "weight": 245, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-scrypt-modified-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-modified-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt Modified.", + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Salt used to hash password.", + "x-example": "<PASSWORD_SALT>" + }, + "passwordSaltSeparator": { + "type": "string", + "description": "Salt separator used to hash password.", + "x-example": "<PASSWORD_SALT_SEPARATOR>" + }, + "passwordSignerKey": { + "type": "string", + "description": "Signer key used to hash password.", + "x-example": "<PASSWORD_SIGNER_KEY>" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordSaltSeparator", + "passwordSignerKey" + ] + } + } + } + } + } + }, + "\/users\/sha": { + "post": { + "summary": "Create user with SHA password", + "operationId": "usersCreateSHAUser", + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [SHA](https:\/\/en.wikipedia.org\/wiki\/Secure_Hash_Algorithm) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "createSHAUser", + "group": "users", + "weight": 242, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-s-h-a-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-sha-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using SHA.", + "x-example": "password" + }, + "passwordVersion": { + "type": "string", + "description": "Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512\/224', 'sha512\/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'", + "x-example": "sha1", + "enum": [ + "sha1", + "sha224", + "sha256", + "sha384", + "sha512\/224", + "sha512\/256", + "sha512", + "sha3-224", + "sha3-256", + "sha3-384", + "sha3-512" + ], + "x-enum-name": "PasswordHash", + "x-enum-keys": [] + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + } + } + } + }, + "\/users\/{userId}": { + "get": { + "summary": "Get user", + "operationId": "usersGet", + "tags": [ + "users" + ], + "description": "Get a user by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "get", + "group": "users", + "weight": 248, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user", + "operationId": "usersDelete", + "tags": [ + "users" + ], + "description": "Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https:\/\/appwrite.io\/docs\/server\/users#usersUpdateStatus) endpoint instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "users", + "weight": 276, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/email": { + "patch": { + "summary": "Update email", + "operationId": "usersUpdateEmail", + "tags": [ + "users" + ], + "description": "Update the user email by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateEmail", + "group": "users", + "weight": 261, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "x-example": "email@example.com" + } + }, + "required": [ + "email" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/jwts": { + "post": { + "summary": "Create user JWT", + "operationId": "usersCreateJWT", + "tags": [ + "users" + ], + "description": "Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.", + "responses": { + "201": { + "description": "JWT", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/jwt" + } + } + } + } + }, + "x-appwrite": { + "method": "createJWT", + "group": "sessions", + "weight": 279, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user-jwt.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "sessionId": { + "type": "string", + "description": "Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.", + "x-example": "<SESSION_ID>" + }, + "duration": { + "type": "integer", + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "x-example": 0 + } + } + } + } + } + } + } + }, + "\/users\/{userId}\/labels": { + "put": { + "summary": "Update user labels", + "operationId": "usersUpdateLabels", + "tags": [ + "users" + ], + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateLabels", + "group": "users", + "weight": 257, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-labels.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-labels.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "labels": { + "type": "array", + "description": "Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.", + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "labels" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/logs": { + "get": { + "summary": "List user logs", + "operationId": "usersListLogs", + "tags": [ + "users" + ], + "description": "Get the user activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/logList" + } + } + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 253, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/memberships": { + "get": { + "summary": "List user memberships", + "operationId": "usersListMemberships", + "tags": [ + "users" + ], + "description": "Get the user membership list by its unique ID.", + "responses": { + "200": { + "description": "Memberships List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/membershipList" + } + } + } + } + }, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 252, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-memberships.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "schema": { + "type": "string", + "x-example": "<SEARCH>", + "default": "" + }, + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "usersUpdateMfa", + "tags": [ + "users" + ], + "description": "Enable or disable MFA on a user account.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfa", + "group": "users", + "weight": 266, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-mfa.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/mfa\/authenticators\/{type}": { + "delete": { + "summary": "Delete authenticator", + "operationId": "usersDeleteMfaAuthenticator", + "tags": [ + "users" + ], + "description": "Delete an authenticator app.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 271, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "schema": { + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [] + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "usersListMfaFactors", + "tags": [ + "users" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaFactors" + } + } + } + } + }, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 267, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/recovery-codes": { + "get": { + "summary": "Get MFA recovery codes", + "operationId": "usersGetMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 268, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "put": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "usersUpdateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 270, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Create MFA recovery codes", + "operationId": "usersCreateMfaRecoveryCodes", + "tags": [ + "users" + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/mfaRecoveryCodes" + } + } + } + } + }, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 269, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/name": { + "patch": { + "summary": "Update name", + "operationId": "usersUpdateName", + "tags": [ + "users" + ], + "description": "Update the user name by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "users", + "weight": 259, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/password": { + "patch": { + "summary": "Update password", + "operationId": "usersUpdatePassword", + "tags": [ + "users" + ], + "description": "Update the user password by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePassword", + "group": "users", + "weight": 260, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "x-example": null + } + }, + "required": [ + "password" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "usersUpdatePhone", + "tags": [ + "users" + ], + "description": "Update the user phone by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePhone", + "group": "users", + "weight": 262, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "User phone number.", + "x-example": "+12065550100" + } + }, + "required": [ + "number" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/prefs": { + "get": { + "summary": "Get user preferences", + "operationId": "usersGetPrefs", + "tags": [ + "users" + ], + "description": "Get the user preferences by its unique ID.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "users", + "weight": 249, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user preferences", + "operationId": "usersUpdatePrefs", + "tags": [ + "users" + ], + "description": "Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/preferences" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "users", + "weight": 264, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/sessions": { + "get": { + "summary": "List user sessions", + "operationId": "usersListSessions", + "tags": [ + "users" + ], + "description": "Get the user sessions list by its unique ID.", + "responses": { + "200": { + "description": "Sessions List", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/sessionList" + } + } + } + } + }, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 251, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "post": { + "summary": "Create session", + "operationId": "usersCreateSession", + "tags": [ + "users" + ], + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "responses": { + "201": { + "description": "Session", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/session" + } + } + } + } + }, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 272, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user sessions", + "operationId": "usersDeleteSessions", + "tags": [ + "users" + ], + "description": "Delete all user's sessions by using the user's unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 275, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/sessions\/{sessionId}": { + "delete": { + "summary": "Delete user session", + "operationId": "usersDeleteSession", + "tags": [ + "users" + ], + "description": "Delete a user sessions by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 274, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "sessionId", + "description": "Session ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<SESSION_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/status": { + "patch": { + "summary": "Update user status", + "operationId": "usersUpdateStatus", + "tags": [ + "users" + ], + "description": "Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateStatus", + "group": "users", + "weight": 256, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "User Status. To activate the user pass `true` and to block the user pass `false`.", + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/targets": { + "get": { + "summary": "List user targets", + "operationId": "usersListTargets", + "tags": [ + "users" + ], + "description": "List the messaging targets that are associated with a user.", + "responses": { + "200": { + "description": "Target list", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/targetList" + } + } + } + } + }, + "x-appwrite": { + "method": "listTargets", + "group": "targets", + "weight": 254, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "in": "query" + } + ] + }, + "post": { + "summary": "Create user target", + "operationId": "usersCreateTarget", + "tags": [ + "users" + ], + "description": "Create a messaging target.", + "responses": { + "201": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "x-appwrite": { + "method": "createTarget", + "group": "targets", + "weight": 246, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "x-example": "<TARGET_ID>" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email", + "enum": [ + "email", + "sms", + "push" + ], + "x-enum-name": "MessagingProviderType", + "x-enum-keys": [] + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "x-example": "<NAME>" + } + }, + "required": [ + "targetId", + "providerType", + "identifier" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/targets\/{targetId}": { + "get": { + "summary": "Get user target", + "operationId": "usersGetTarget", + "tags": [ + "users" + ], + "description": "Get a user's push notification target by ID.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "x-appwrite": { + "method": "getTarget", + "group": "targets", + "weight": 250, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/get-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TARGET_ID>" + }, + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user target", + "operationId": "usersUpdateTarget", + "tags": [ + "users" + ], + "description": "Update a messaging target.", + "responses": { + "200": { + "description": "Target", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/target" + } + } + } + } + }, + "x-appwrite": { + "method": "updateTarget", + "group": "targets", + "weight": 265, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TARGET_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "x-example": "<NAME>" + } + } + } + } + } + } + }, + "delete": { + "summary": "Delete user target", + "operationId": "usersDeleteTarget", + "tags": [ + "users" + ], + "description": "Delete a messaging target.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteTarget", + "group": "targets", + "weight": 277, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<TARGET_ID>" + }, + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/tokens": { + "post": { + "summary": "Create token", + "operationId": "usersCreateToken", + "tags": [ + "users" + ], + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", + "responses": { + "201": { + "description": "Token", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/token" + } + } + } + } + }, + "x-appwrite": { + "method": "createToken", + "group": "sessions", + "weight": 273, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-token.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "length": { + "type": "integer", + "description": "Token length in characters. The default length is 6 characters", + "x-example": 4 + }, + "expire": { + "type": "integer", + "description": "Token expiration period in seconds. The default expiration is 15 minutes.", + "x-example": 60 + } + } + } + } + } + } + } + }, + "\/users\/{userId}\/verification": { + "patch": { + "summary": "Update email verification", + "operationId": "usersUpdateEmailVerification", + "tags": [ + "users" + ], + "description": "Update the user email verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updateEmailVerification", + "group": "users", + "weight": 263, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-email-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "emailVerification": { + "type": "boolean", + "description": "User email verification status.", + "x-example": false + } + }, + "required": [ + "emailVerification" + ] + } + } + } + } + } + }, + "\/users\/{userId}\/verification\/phone": { + "patch": { + "summary": "Update phone verification", + "operationId": "usersUpdatePhoneVerification", + "tags": [ + "users" + ], + "description": "Update the user phone verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/user" + } + } + } + } + }, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "users", + "weight": 258, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<USER_ID>" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "phoneVerification": { + "type": "boolean", + "description": "User phone verification status.", + "x-example": false + } + }, + "required": [ + "phoneVerification" + ] + } + } + } + } + } + } + }, + "tags": [ + { + "name": "account", + "description": "The Account service allows you to authenticate and manage a user account." + }, + { + "name": "avatars", + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + }, + { + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" + }, + { + "name": "locale", + "description": "The Locale service allows you to customize your app based on your users' location." + }, + { + "name": "health", + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." + }, + { + "name": "projects", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "project", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "storage", + "description": "The Storage service allows you to manage your project files." + }, + { + "name": "teams", + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" + }, + { + "name": "users", + "description": "The Users service allows you to manage your project users." + }, + { + "name": "sites", + "description": "The Sites Service allows you view, create and manage your web applications." + }, + { + "name": "functions", + "description": "The Functions Service allows you view, create and manage your Cloud Functions." + }, + { + "name": "proxy", + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." + }, + { + "name": "graphql", + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." + }, + { + "name": "console", + "description": "The Console service allows you to interact with console relevant informations." + }, + { + "name": "migrations", + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." + }, + { + "name": "messaging", + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." + } + ], + "components": { + "schemas": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true + }, + "error": { + "description": "Error", + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Error message.", + "x-example": "Not found" + }, + "code": { + "type": "string", + "description": "Error code.", + "x-example": "404" + }, + "type": { + "type": "string", + "description": "Error type. You can learn more about all the error types at https:\/\/appwrite.io\/docs\/error-codes#errorTypes", + "x-example": "not_found" + }, + "version": { + "type": "string", + "description": "Server version number.", + "x-example": "1.0" + } + }, + "required": [ + "message", + "code", + "type", + "version" + ] + }, + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { + "$ref": "#\/components\/schemas\/document" + }, + "x-example": "" + } + }, + "required": [ + "total", + "documents" + ] + }, + "collectionList": { + "description": "Collections List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of collections documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "collections": { + "type": "array", + "description": "List of collections.", + "items": { + "$ref": "#\/components\/schemas\/collection" + }, + "x-example": "" + } + }, + "required": [ + "total", + "collections" + ] + }, + "databaseList": { + "description": "Databases List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of databases documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "databases": { + "type": "array", + "description": "List of databases.", + "items": { + "$ref": "#\/components\/schemas\/database" + }, + "x-example": "" + } + }, + "required": [ + "total", + "databases" + ] + }, + "indexList": { + "description": "Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "$ref": "#\/components\/schemas\/index" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ] + }, + "userList": { + "description": "Users List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of users documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "users": { + "type": "array", + "description": "List of users.", + "items": { + "$ref": "#\/components\/schemas\/user" + }, + "x-example": "" + } + }, + "required": [ + "total", + "users" + ] + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { + "$ref": "#\/components\/schemas\/session" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sessions" + ] + }, + "identityList": { + "description": "Identities List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of identities documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "identities": { + "type": "array", + "description": "List of identities.", + "items": { + "$ref": "#\/components\/schemas\/identity" + }, + "x-example": "" + } + }, + "required": [ + "total", + "identities" + ] + }, + "logList": { + "description": "Logs List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of logs documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "logs": { + "type": "array", + "description": "List of logs.", + "items": { + "$ref": "#\/components\/schemas\/log" + }, + "x-example": "" + } + }, + "required": [ + "total", + "logs" + ] + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { + "$ref": "#\/components\/schemas\/file" + }, + "x-example": "" + } + }, + "required": [ + "total", + "files" + ] + }, + "bucketList": { + "description": "Buckets List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of buckets documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "buckets": { + "type": "array", + "description": "List of buckets.", + "items": { + "$ref": "#\/components\/schemas\/bucket" + }, + "x-example": "" + } + }, + "required": [ + "total", + "buckets" + ] + }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "$ref": "#\/components\/schemas\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { + "$ref": "#\/components\/schemas\/team" + }, + "x-example": "" + } + }, + "required": [ + "total", + "teams" + ] + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { + "$ref": "#\/components\/schemas\/membership" + }, + "x-example": "" + } + }, + "required": [ + "total", + "memberships" + ] + }, + "siteList": { + "description": "Sites List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sites documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sites": { + "type": "array", + "description": "List of sites.", + "items": { + "$ref": "#\/components\/schemas\/site" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sites" + ] + }, + "functionList": { + "description": "Functions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of functions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "functions": { + "type": "array", + "description": "List of functions.", + "items": { + "$ref": "#\/components\/schemas\/function" + }, + "x-example": "" + } + }, + "required": [ + "total", + "functions" + ] + }, + "frameworkList": { + "description": "Frameworks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of frameworks documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "frameworks": { + "type": "array", + "description": "List of frameworks.", + "items": { + "$ref": "#\/components\/schemas\/framework" + }, + "x-example": "" + } + }, + "required": [ + "total", + "frameworks" + ] + }, + "runtimeList": { + "description": "Runtimes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "runtimes": { + "type": "array", + "description": "List of runtimes.", + "items": { + "$ref": "#\/components\/schemas\/runtime" + }, + "x-example": "" + } + }, + "required": [ + "total", + "runtimes" + ] + }, + "deploymentList": { + "description": "Deployments List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of deployments documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "List of deployments.", + "items": { + "$ref": "#\/components\/schemas\/deployment" + }, + "x-example": "" + } + }, + "required": [ + "total", + "deployments" + ] + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { + "$ref": "#\/components\/schemas\/execution" + }, + "x-example": "" + } + }, + "required": [ + "total", + "executions" + ] + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { + "$ref": "#\/components\/schemas\/country" + }, + "x-example": "" + } + }, + "required": [ + "total", + "countries" + ] + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { + "$ref": "#\/components\/schemas\/continent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "continents" + ] + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { + "$ref": "#\/components\/schemas\/language" + }, + "x-example": "" + } + }, + "required": [ + "total", + "languages" + ] + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { + "$ref": "#\/components\/schemas\/currency" + }, + "x-example": "" + } + }, + "required": [ + "total", + "currencies" + ] + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { + "$ref": "#\/components\/schemas\/phone" + }, + "x-example": "" + } + }, + "required": [ + "total", + "phones" + ] + }, + "variableList": { + "description": "Variables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of variables documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "variables": { + "type": "array", + "description": "List of variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "x-example": "" + } + }, + "required": [ + "total", + "variables" + ] + }, + "localeCodeList": { + "description": "Locale codes list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of localeCodes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "localeCodes": { + "type": "array", + "description": "List of localeCodes.", + "items": { + "$ref": "#\/components\/schemas\/localeCode" + }, + "x-example": "" + } + }, + "required": [ + "total", + "localeCodes" + ] + }, + "providerList": { + "description": "Provider list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of providers documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "providers": { + "type": "array", + "description": "List of providers.", + "items": { + "$ref": "#\/components\/schemas\/provider" + }, + "x-example": "" + } + }, + "required": [ + "total", + "providers" + ] + }, + "messageList": { + "description": "Message list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of messages documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "messages": { + "type": "array", + "description": "List of messages.", + "items": { + "$ref": "#\/components\/schemas\/message" + }, + "x-example": "" + } + }, + "required": [ + "total", + "messages" + ] + }, + "topicList": { + "description": "Topic list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of topics documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "topics": { + "type": "array", + "description": "List of topics.", + "items": { + "$ref": "#\/components\/schemas\/topic" + }, + "x-example": "" + } + }, + "required": [ + "total", + "topics" + ] + }, + "subscriberList": { + "description": "Subscriber list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of subscribers documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "subscribers": { + "type": "array", + "description": "List of subscribers.", + "items": { + "$ref": "#\/components\/schemas\/subscriber" + }, + "x-example": "" + } + }, + "required": [ + "total", + "subscribers" + ] + }, + "targetList": { + "description": "Target list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of targets documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "targets": { + "type": "array", + "description": "List of targets.", + "items": { + "$ref": "#\/components\/schemas\/target" + }, + "x-example": "" + } + }, + "required": [ + "total", + "targets" + ] + }, + "specificationList": { + "description": "Specifications List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of specifications documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "specifications": { + "type": "array", + "description": "List of specifications.", + "items": { + "$ref": "#\/components\/schemas\/specification" + }, + "x-example": "" + } + }, + "required": [ + "total", + "specifications" + ] + }, + "database": { + "description": "Database", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Database name.", + "x-example": "My Database" + }, + "$createdAt": { + "type": "string", + "description": "Database creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Database update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "enabled": { + "type": "boolean", + "description": "If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + } + }, + "required": [ + "$id", + "name", + "$createdAt", + "$updatedAt", + "enabled" + ] + }, + "collection": { + "description": "Collection", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Collection creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Collection update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Collection permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Collection name.", + "x-example": "My Collection" + }, + "enabled": { + "type": "boolean", + "description": "Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "documentSecurity": { + "type": "boolean", + "description": "Whether document-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "attributes": { + "type": "array", + "description": "Collection attributes.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Collection indexes.", + "items": { + "$ref": "#\/components\/schemas\/index" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "documentSecurity", + "attributes", + "indexes" + ] + }, + "attributeList": { + "description": "Attributes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of attributes in the given collection.", + "x-example": 5, + "format": "int32" + }, + "attributes": { + "type": "array", + "description": "List of attributes.", + "items": { + "anyOf": [ + { + "$ref": "#\/components\/schemas\/attributeBoolean" + }, + { + "$ref": "#\/components\/schemas\/attributeInteger" + }, + { + "$ref": "#\/components\/schemas\/attributeFloat" + }, + { + "$ref": "#\/components\/schemas\/attributeEmail" + }, + { + "$ref": "#\/components\/schemas\/attributeEnum" + }, + { + "$ref": "#\/components\/schemas\/attributeUrl" + }, + { + "$ref": "#\/components\/schemas\/attributeIp" + }, + { + "$ref": "#\/components\/schemas\/attributeDatetime" + }, + { + "$ref": "#\/components\/schemas\/attributeRelationship" + }, + { + "$ref": "#\/components\/schemas\/attributeString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "attributes" + ] + }, + "attributeString": { + "description": "AttributeString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Attribute size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default", + "nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ] + }, + "attributeInteger": { + "description": "AttributeInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 10, + "format": "int32", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ] + }, + "attributeFloat": { + "description": "AttributeFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "nullable": true + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 2.5, + "format": "double", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ] + }, + "attributeBoolean": { + "description": "AttributeBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false, + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ] + }, + "attributeEmail": { + "description": "AttributeEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default@example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeEnum": { + "description": "AttributeEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "element", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ] + }, + "attributeIp": { + "description": "AttributeIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "192.0.2.0", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeUrl": { + "description": "AttributeURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "http:\/\/example.com", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeDatetime": { + "description": "AttributeDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeRelationship": { + "description": "AttributeRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedCollection": { + "type": "string", + "description": "The ID of the related collection.", + "x-example": "collection" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedCollection", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ] + }, + "index": { + "description": "Index", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "attributes": { + "type": "array", + "description": "Index attributes.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index attributes length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "attributes", + "lengths", + "$createdAt", + "$updatedAt" + ] + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, + "$collectionId": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c15117e" + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e" + }, + "$createdAt": { + "type": "string", + "description": "Document creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Document update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Document permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$collectionId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ] + }, + "log": { + "description": "Log", + "type": "object", + "properties": { + "event": { + "type": "string", + "description": "Event name.", + "x-example": "account.sessions.create" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "610fc2f985ee0" + }, + "userEmail": { + "type": "string", + "description": "User Email.", + "x-example": "john@appwrite.io" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "John Doe" + }, + "mode": { + "type": "string", + "description": "API mode when event triggered.", + "x-example": "admin" + }, + "ip": { + "type": "string", + "description": "IP session in use when the session was created.", + "x-example": "127.0.0.1" + }, + "time": { + "type": "string", + "description": "Log creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "event", + "userId", + "userEmail", + "userName", + "mode", + "ip", + "time", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName" + ] + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "User creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "User update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "User name.", + "x-example": "John Doe" + }, + "password": { + "type": "string", + "description": "Hashed user password.", + "x-example": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "nullable": true + }, + "hash": { + "type": "string", + "description": "Password hashing algorithm.", + "x-example": "argon2", + "nullable": true + }, + "hashOptions": { + "type": "object", + "description": "Password hashing algorithm configuration.", + "x-example": {}, + "items": { + "oneOf": [ + { + "$ref": "#\/components\/schemas\/algoArgon2" + }, + { + "$ref": "#\/components\/schemas\/algoScrypt" + }, + { + "$ref": "#\/components\/schemas\/algoScryptModified" + }, + { + "$ref": "#\/components\/schemas\/algoBcrypt" + }, + { + "$ref": "#\/components\/schemas\/algoPhpass" + }, + { + "$ref": "#\/components\/schemas\/algoSha" + }, + { + "$ref": "#\/components\/schemas\/algoMd5" + } + ] + }, + "nullable": true + }, + "registration": { + "type": "string", + "description": "User registration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "x-example": true + }, + "labels": { + "type": "array", + "description": "Labels for the user.", + "items": { + "type": "string" + }, + "x-example": [ + "vip" + ] + }, + "passwordUpdate": { + "type": "string", + "description": "Password update time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "email": { + "type": "string", + "description": "User email address.", + "x-example": "john@appwrite.io" + }, + "phone": { + "type": "string", + "description": "User phone number in E.164 format.", + "x-example": "+4930901820" + }, + "emailVerification": { + "type": "boolean", + "description": "Email verification status.", + "x-example": true + }, + "phoneVerification": { + "type": "boolean", + "description": "Phone verification status.", + "x-example": true + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status.", + "x-example": true + }, + "prefs": { + "type": "object", + "description": "User preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "$ref": "#\/components\/schemas\/preferences" + } + }, + "targets": { + "type": "array", + "description": "A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.", + "items": { + "$ref": "#\/components\/schemas\/target" + }, + "x-example": [] + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "registration", + "status", + "labels", + "passwordUpdate", + "email", + "phone", + "emailVerification", + "phoneVerification", + "mfa", + "prefs", + "targets", + "accessedAt" + ] + }, + "algoMd5": { + "description": "AlgoMD5", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "md5" + } + }, + "required": [ + "type" + ] + }, + "algoSha": { + "description": "AlgoSHA", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "sha" + } + }, + "required": [ + "type" + ] + }, + "algoPhpass": { + "description": "AlgoPHPass", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "phpass" + } + }, + "required": [ + "type" + ] + }, + "algoBcrypt": { + "description": "AlgoBcrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "bcrypt" + } + }, + "required": [ + "type" + ] + }, + "algoScrypt": { + "description": "AlgoScrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scrypt" + }, + "costCpu": { + "type": "integer", + "description": "CPU complexity of computed hash.", + "x-example": 8, + "format": "int32" + }, + "costMemory": { + "type": "integer", + "description": "Memory complexity of computed hash.", + "x-example": 14, + "format": "int32" + }, + "costParallel": { + "type": "integer", + "description": "Parallelization of computed hash.", + "x-example": 1, + "format": "int32" + }, + "length": { + "type": "integer", + "description": "Length used to compute hash.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "type", + "costCpu", + "costMemory", + "costParallel", + "length" + ] + }, + "algoScryptModified": { + "description": "AlgoScryptModified", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scryptMod" + }, + "salt": { + "type": "string", + "description": "Salt used to compute hash.", + "x-example": "UxLMreBr6tYyjQ==" + }, + "saltSeparator": { + "type": "string", + "description": "Separator used to compute hash.", + "x-example": "Bw==" + }, + "signerKey": { + "type": "string", + "description": "Key used to compute hash.", + "x-example": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "required": [ + "type", + "salt", + "saltSeparator", + "signerKey" + ] + }, + "algoArgon2": { + "description": "AlgoArgon2", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "argon2" + }, + "memoryCost": { + "type": "integer", + "description": "Memory used to compute hash.", + "x-example": 65536, + "format": "int32" + }, + "timeCost": { + "type": "integer", + "description": "Amount of time consumed to compute hash", + "x-example": 4, + "format": "int32" + }, + "threads": { + "type": "integer", + "description": "Number of threads used to compute hash.", + "x-example": 3, + "format": "int32" + } + }, + "required": [ + "type", + "memoryCost", + "timeCost", + "threads" + ] + }, + "preferences": { + "description": "Preferences", + "type": "object", + "additionalProperties": true + }, + "session": { + "description": "Session", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Session ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Session creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Session update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "expire": { + "type": "string", + "description": "Session expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "Session Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "Session Provider User ID.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "x-example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "x-example": true + }, + "factors": { + "type": "array", + "description": "Returns a list of active session factors.", + "items": { + "type": "string" + }, + "x-example": [ + "email" + ] + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate the user. Only included if the request was made with an API key", + "x-example": "5e5bb8c16897e" + }, + "mfaUpdatedAt": { + "type": "string", + "description": "Most recent date in ISO 8601 format when the session successfully passed MFA challenge.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "ip", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName", + "current", + "factors", + "secret", + "mfaUpdatedAt" + ] + }, + "identity": { + "description": "Identity", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Identity ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Identity creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Identity update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "provider": { + "type": "string", + "description": "Identity Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "ID of the User in the Identity Provider.", + "x-example": "5e5bb8c16897e" + }, + "providerEmail": { + "type": "string", + "description": "Email of the User in the Identity Provider.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Identity Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Identity Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "provider", + "providerUid", + "providerEmail", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken" + ] + }, + "token": { + "description": "Token", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "secret": { + "type": "string", + "description": "Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "phrase": { + "type": "string", + "description": "Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.", + "x-example": "Golden Fox" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "secret", + "expire", + "phrase" + ] + }, + "jwt": { + "description": "JWT", + "type": "object", + "properties": { + "jwt": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "required": [ + "jwt" + ] + }, + "locale": { + "description": "Locale", + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "User IP address.", + "x-example": "127.0.0.1" + }, + "countryCode": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format", + "x-example": "US" + }, + "country": { + "type": "string", + "description": "Country name. This field support localization.", + "x-example": "United States" + }, + "continentCode": { + "type": "string", + "description": "Continent code. A two character continent code \"AF\" for Africa, \"AN\" for Antarctica, \"AS\" for Asia, \"EU\" for Europe, \"NA\" for North America, \"OC\" for Oceania, and \"SA\" for South America.", + "x-example": "NA" + }, + "continent": { + "type": "string", + "description": "Continent name. This field support localization.", + "x-example": "North America" + }, + "eu": { + "type": "boolean", + "description": "True if country is part of the European Union.", + "x-example": false + }, + "currency": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format", + "x-example": "USD" + } + }, + "required": [ + "ip", + "countryCode", + "country", + "continentCode", + "continent", + "eu", + "currency" + ] + }, + "localeCode": { + "description": "LocaleCode", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes)", + "x-example": "en-us" + }, + "name": { + "type": "string", + "description": "Locale name", + "x-example": "US" + } + }, + "required": [ + "code", + "name" + ] + }, + "file": { + "description": "File", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "File ID.", + "x-example": "5e5ea5c16897e" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "File creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "File update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "File permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "name": { + "type": "string", + "description": "File name.", + "x-example": "Pink.png" + }, + "signature": { + "type": "string", + "description": "File MD5 signature.", + "x-example": "5d529fd02b544198ae075bd57c1762bb" + }, + "mimeType": { + "type": "string", + "description": "File mime type.", + "x-example": "image\/png" + }, + "sizeOriginal": { + "type": "integer", + "description": "File original size in bytes.", + "x-example": 17890, + "format": "int32" + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "x-example": 17890, + "format": "int32" + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "x-example": 17890, + "format": "int32" + } + }, + "required": [ + "$id", + "bucketId", + "$createdAt", + "$updatedAt", + "$permissions", + "name", + "signature", + "mimeType", + "sizeOriginal", + "chunksTotal", + "chunksUploaded" + ] + }, + "bucket": { + "description": "Bucket", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Bucket creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Bucket update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Bucket permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "fileSecurity": { + "type": "boolean", + "description": "Whether file-level security is enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "name": { + "type": "string", + "description": "Bucket name.", + "x-example": "Documents" + }, + "enabled": { + "type": "boolean", + "description": "Bucket enabled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size supported.", + "x-example": 100, + "format": "int32" + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions.", + "items": { + "type": "string" + }, + "x-example": [ + "jpg", + "png" + ] + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "x-example": "gzip" + }, + "encryption": { + "type": "boolean", + "description": "Bucket is encrypted.", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Virus scanning is enabled.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "fileSecurity", + "name", + "enabled", + "maximumFileSize", + "allowedFileExtensions", + "compression", + "encryption", + "antivirus" + ] + }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "files" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceType", + "expire", + "secret", + "accessedAt" + ] + }, + "team": { + "description": "Team", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Team creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Team update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "x-example": 7, + "format": "int32" + }, + "prefs": { + "type": "object", + "description": "Team preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "$ref": "#\/components\/schemas\/preferences" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "total", + "prefs" + ] + }, + "membership": { + "description": "Membership", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Membership ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Membership creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Membership update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "John Doe" + }, + "userEmail": { + "type": "string", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "john@appwrite.io" + }, + "teamId": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "teamName": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "invited": { + "type": "string", + "description": "Date, the user has been invited to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "joined": { + "type": "string", + "description": "Date, the user has accepted the invitation to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "confirm": { + "type": "boolean", + "description": "User confirmation status, true if the user has joined the team or false otherwise.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", + "x-example": false + }, + "roles": { + "type": "array", + "description": "User list of roles", + "items": { + "type": "string" + }, + "x-example": [ + "owner" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "userName", + "userEmail", + "teamId", + "teamName", + "invited", + "joined", + "confirm", + "mfa", + "roles" + ] + }, + "site": { + "description": "Site", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Site ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Site creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Site update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Site name.", + "x-example": "My Site" + }, + "enabled": { + "type": "boolean", + "description": "Site enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "framework": { + "type": "string", + "description": "Site framework.", + "x-example": "react" + }, + "deploymentId": { + "type": "string", + "description": "Site's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "deploymentScreenshotLight": { + "type": "string", + "description": "Screenshot of active deployment with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentScreenshotDark": { + "type": "string", + "description": "Screenshot of active deployment with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentId": { + "type": "string", + "description": "Site's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "vars": { + "type": "array", + "description": "Site variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "x-example": [] + }, + "timeout": { + "type": "integer", + "description": "Site request timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "installCommand": { + "type": "string", + "description": "The install command used to install the site dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "The build command used to build the site.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "The directory where the site build output is located.", + "x-example": "build" + }, + "installationId": { + "type": "string", + "description": "Site VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site in VCS (Version Control System) repository", + "x-example": "sites\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + }, + "buildRuntime": { + "type": "string", + "description": "Site build runtime.", + "x-example": "node-22" + }, + "adapter": { + "type": "string", + "description": "Site framework adapter.", + "x-example": "static" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "enabled", + "live", + "logging", + "framework", + "deploymentId", + "deploymentCreatedAt", + "deploymentScreenshotLight", + "deploymentScreenshotDark", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "vars", + "timeout", + "installCommand", + "buildCommand", + "outputDirectory", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification", + "buildRuntime", + "adapter", + "fallbackFile" + ] + }, + "function": { + "description": "Function", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Function creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Function update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "execute": { + "type": "array", + "description": "Execution permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + }, + "name": { + "type": "string", + "description": "Function name.", + "x-example": "My Function" + }, + "enabled": { + "type": "boolean", + "description": "Function enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "runtime": { + "type": "string", + "description": "Function execution and build runtime.", + "x-example": "python-3.8" + }, + "deploymentId": { + "type": "string", + "description": "Function's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentId": { + "type": "string", + "description": "Function's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + }, + "vars": { + "type": "array", + "description": "Function variables.", + "items": { + "$ref": "#\/components\/schemas\/variable" + }, + "x-example": [] + }, + "events": { + "type": "array", + "description": "Function trigger events.", + "items": { + "type": "string" + }, + "x-example": "account.create" + }, + "schedule": { + "type": "string", + "description": "Function execution schedule in CRON format.", + "x-example": "5 4 * * *" + }, + "timeout": { + "type": "integer", + "description": "Function execution timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file used to execute the deployment.", + "x-example": "index.js" + }, + "commands": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm install" + }, + "version": { + "type": "string", + "description": "Version of Open Runtimes used for the function.", + "x-example": "v2" + }, + "installationId": { + "type": "string", + "description": "Function VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function in VCS (Version Control System) repository", + "x-example": "functions\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "execute", + "name", + "enabled", + "live", + "logging", + "runtime", + "deploymentId", + "deploymentCreatedAt", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "scopes", + "vars", + "events", + "schedule", + "timeout", + "entrypoint", + "commands", + "version", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification" + ] + }, + "runtime": { + "description": "Runtime", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Runtime ID.", + "x-example": "python-3.8" + }, + "key": { + "type": "string", + "description": "Parent runtime key.", + "x-example": "python" + }, + "name": { + "type": "string", + "description": "Runtime Name.", + "x-example": "Python" + }, + "version": { + "type": "string", + "description": "Runtime version.", + "x-example": "3.8" + }, + "base": { + "type": "string", + "description": "Base Docker image used to build the runtime.", + "x-example": "python:3.8-alpine" + }, + "image": { + "type": "string", + "description": "Image name of Docker Hub.", + "x-example": "appwrite\\\/runtime-for-python:3.8" + }, + "logo": { + "type": "string", + "description": "Name of the logo image.", + "x-example": "python.png" + }, + "supports": { + "type": "array", + "description": "List of supported architectures.", + "items": { + "type": "string" + }, + "x-example": "amd64" + } + }, + "required": [ + "$id", + "key", + "name", + "version", + "base", + "image", + "logo", + "supports" + ] + }, + "framework": { + "description": "Framework", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Framework key.", + "x-example": "sveltekit" + }, + "name": { + "type": "string", + "description": "Framework Name.", + "x-example": "SvelteKit" + }, + "buildRuntime": { + "type": "string", + "description": "Default runtime version.", + "x-example": "node-22" + }, + "runtimes": { + "type": "array", + "description": "List of supported runtime versions.", + "items": { + "type": "string" + }, + "x-example": [ + "static-1", + "node-22" + ] + }, + "adapters": { + "type": "array", + "description": "List of supported adapters.", + "items": { + "$ref": "#\/components\/schemas\/frameworkAdapter" + }, + "x-example": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "required": [ + "key", + "name", + "buildRuntime", + "runtimes", + "adapters" + ] + }, + "frameworkAdapter": { + "description": "Framework Adapter", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Adapter key.", + "x-example": "static" + }, + "installCommand": { + "type": "string", + "description": "Default command to download dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "Default command to build site into output directory.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "Default output directory of build.", + "x-example": ".\/dist" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "key", + "installCommand", + "buildCommand", + "outputDirectory", + "fallbackFile" + ] + }, + "deployment": { + "description": "Deployment", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Deployment update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "type": { + "type": "string", + "description": "Type of deployment.", + "x-example": "vcs" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea6g16897e" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "functions" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file to use to execute the deployment code.", + "x-example": "index.js" + }, + "sourceSize": { + "type": "integer", + "description": "The code size in bytes.", + "x-example": 128, + "format": "int32" + }, + "buildSize": { + "type": "integer", + "description": "The build output size in bytes.", + "x-example": 128, + "format": "int32" + }, + "totalSize": { + "type": "integer", + "description": "The total size in bytes (source and build output).", + "x-example": 128, + "format": "int32" + }, + "buildId": { + "type": "string", + "description": "The current build ID.", + "x-example": "5e5ea5c16897e" + }, + "activate": { + "type": "boolean", + "description": "Whether the deployment should be automatically activated.", + "x-example": true + }, + "screenshotLight": { + "type": "string", + "description": "Screenshot with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "screenshotDark": { + "type": "string", + "description": "Screenshot with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "status": { + "type": "string", + "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "buildLogs": { + "type": "string", + "description": "The build logs.", + "x-example": "Compiling source files..." + }, + "buildDuration": { + "type": "integer", + "description": "The current build time in seconds.", + "x-example": 128, + "format": "int32" + }, + "providerRepositoryName": { + "type": "string", + "description": "The name of the vcs provider repository", + "x-example": "database" + }, + "providerRepositoryOwner": { + "type": "string", + "description": "The name of the vcs provider repository owner", + "x-example": "utopia" + }, + "providerRepositoryUrl": { + "type": "string", + "description": "The url of the vcs provider repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" + }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, + "providerCommitHash": { + "type": "string", + "description": "The commit hash of the vcs commit", + "x-example": "7c3f25d" + }, + "providerCommitAuthorUrl": { + "type": "string", + "description": "The url of vcs commit author", + "x-example": "https:\/\/github.com\/vermakhushboo" + }, + "providerCommitAuthor": { + "type": "string", + "description": "The name of vcs commit author", + "x-example": "Khushboo Verma" + }, + "providerCommitMessage": { + "type": "string", + "description": "The commit message", + "x-example": "Update index.js" + }, + "providerCommitUrl": { + "type": "string", + "description": "The url of the vcs commit", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" + }, + "providerBranchUrl": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "type", + "resourceId", + "resourceType", + "entrypoint", + "sourceSize", + "buildSize", + "totalSize", + "buildId", + "activate", + "screenshotLight", + "screenshotDark", + "status", + "buildLogs", + "buildDuration", + "providerRepositoryName", + "providerRepositoryOwner", + "providerRepositoryUrl", + "providerBranch", + "providerCommitHash", + "providerCommitAuthorUrl", + "providerCommitAuthor", + "providerCommitMessage", + "providerCommitUrl", + "providerBranchUrl" + ] + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Execution creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Execution upate date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Execution roles.", + "items": { + "type": "string" + }, + "x-example": [ + "any" + ] + }, + "functionId": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea6g16897e" + }, + "trigger": { + "type": "string", + "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", + "x-example": "http" + }, + "status": { + "type": "string", + "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", + "x-example": "processing" + }, + "requestMethod": { + "type": "string", + "description": "HTTP request method type.", + "x-example": "GET" + }, + "requestPath": { + "type": "string", + "description": "HTTP request path and query.", + "x-example": "\/articles?id=5" + }, + "requestHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "responseStatusCode": { + "type": "integer", + "description": "HTTP response status code.", + "x-example": 200, + "format": "int32" + }, + "responseBody": { + "type": "string", + "description": "HTTP response body. This will return empty unless execution is created as synchronous.", + "x-example": "" + }, + "responseHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "$ref": "#\/components\/schemas\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "logs": { + "type": "string", + "description": "Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "errors": { + "type": "string", + "description": "Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "duration": { + "type": "number", + "description": "Resource(function\/site) execution duration in seconds.", + "x-example": 0.4, + "format": "double" + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for execution. If left empty, execution will be queued immediately.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "functionId", + "trigger", + "status", + "requestMethod", + "requestPath", + "requestHeaders", + "responseStatusCode", + "responseBody", + "responseHeaders", + "logs", + "errors", + "duration" + ] + }, + "variable": { + "description": "Variable", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Variable ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Variable key.", + "x-example": "API_KEY" + }, + "value": { + "type": "string", + "description": "Variable value.", + "x-example": "myPa$$word1" + }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, + "resourceType": { + "type": "string", + "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", + "x-example": "function" + }, + "resourceId": { + "type": "string", + "description": "ID of resource to which the variable belongs. If resourceType is \"project\", it is empty. If resourceType is \"function\", it is ID of the function.", + "x-example": "myAwesomeFunction" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "value", + "secret", + "resourceType", + "resourceId" + ] + }, + "country": { + "description": "Country", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "code": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + } + }, + "required": [ + "name", + "code" + ] + }, + "continent": { + "description": "Continent", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Continent name.", + "x-example": "Europe" + }, + "code": { + "type": "string", + "description": "Continent two letter code.", + "x-example": "EU" + } + }, + "required": [ + "name", + "code" + ] + }, + "language": { + "description": "Language", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Language name.", + "x-example": "Italian" + }, + "code": { + "type": "string", + "description": "Language two-character ISO 639-1 codes.", + "x-example": "it" + }, + "nativeName": { + "type": "string", + "description": "Language native name.", + "x-example": "Italiano" + } + }, + "required": [ + "name", + "code", + "nativeName" + ] + }, + "currency": { + "description": "Currency", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Currency symbol.", + "x-example": "$" + }, + "name": { + "type": "string", + "description": "Currency name.", + "x-example": "US dollar" + }, + "symbolNative": { + "type": "string", + "description": "Currency native symbol.", + "x-example": "$" + }, + "decimalDigits": { + "type": "integer", + "description": "Number of decimal digits.", + "x-example": 2, + "format": "int32" + }, + "rounding": { + "type": "number", + "description": "Currency digit rounding.", + "x-example": 0, + "format": "double" + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.", + "x-example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "x-example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ] + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "x-example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "code", + "countryCode", + "countryName" + ] + }, + "healthAntivirus": { + "description": "Health Antivirus", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Antivirus version.", + "x-example": "1.0.0" + }, + "status": { + "type": "string", + "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", + "x-example": "online" + } + }, + "required": [ + "version", + "status" + ] + }, + "healthQueue": { + "description": "Health Queue", + "type": "object", + "properties": { + "size": { + "type": "integer", + "description": "Amount of actions in the queue.", + "x-example": 8, + "format": "int32" + } + }, + "required": [ + "size" + ] + }, + "healthStatus": { + "description": "Health Status", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the service.", + "x-example": "database" + }, + "ping": { + "type": "integer", + "description": "Duration in milliseconds how long the health check took.", + "x-example": 128, + "format": "int32" + }, + "status": { + "type": "string", + "description": "Service status. Possible values can are: `pass`, `fail`", + "x-example": "pass" + } + }, + "required": [ + "name", + "ping", + "status" + ] + }, + "healthCertificate": { + "description": "Health Certificate", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Certificate name", + "x-example": "\/CN=www.google.com" + }, + "subjectSN": { + "type": "string", + "description": "Subject SN", + "x-example": "" + }, + "issuerOrganisation": { + "type": "string", + "description": "Issuer organisation", + "x-example": "" + }, + "validFrom": { + "type": "string", + "description": "Valid from", + "x-example": "1704200998" + }, + "validTo": { + "type": "string", + "description": "Valid to", + "x-example": "1711458597" + }, + "signatureTypeSN": { + "type": "string", + "description": "Signature type SN", + "x-example": "RSA-SHA256" + } + }, + "required": [ + "name", + "subjectSN", + "issuerOrganisation", + "validFrom", + "validTo", + "signatureTypeSN" + ] + }, + "healthTime": { + "description": "Health Time", + "type": "object", + "properties": { + "remoteTime": { + "type": "integer", + "description": "Current unix timestamp on trustful remote server.", + "x-example": 1639490751, + "format": "int32" + }, + "localTime": { + "type": "integer", + "description": "Current unix timestamp of local server where Appwrite runs.", + "x-example": 1639490844, + "format": "int32" + }, + "diff": { + "type": "integer", + "description": "Difference of unix remote and local timestamps in milliseconds.", + "x-example": 93, + "format": "int32" + } + }, + "required": [ + "remoteTime", + "localTime", + "diff" + ] + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "x-example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "x-example": "application\/json" + } + }, + "required": [ + "name", + "value" + ] + }, + "specification": { + "description": "Specification", + "type": "object", + "properties": { + "memory": { + "type": "integer", + "description": "Memory size in MB.", + "x-example": 512, + "format": "int32" + }, + "cpus": { + "type": "number", + "description": "Number of CPUs.", + "x-example": 1, + "format": "double" + }, + "enabled": { + "type": "boolean", + "description": "Is size enabled.", + "x-example": true + }, + "slug": { + "type": "string", + "description": "Size slug.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "memory", + "cpus", + "enabled", + "slug" + ] + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ] + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "x-example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ] + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "x-example": true + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "x-example": true + } + }, + "required": [ + "secret", + "uri" + ] + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "x-example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "x-example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "x-example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "x-example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode" + ] + }, + "provider": { + "description": "Provider", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Provider ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Provider creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Provider update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name for the provider instance.", + "x-example": "Mailgun" + }, + "provider": { + "type": "string", + "description": "The name of the provider service.", + "x-example": "mailgun" + }, + "enabled": { + "type": "boolean", + "description": "Is provider enabled?", + "x-example": true + }, + "type": { + "type": "string", + "description": "Type of provider.", + "x-example": "sms" + }, + "credentials": { + "type": "object", + "description": "Provider credentials.", + "x-example": { + "key": "123456789" + } + }, + "options": { + "type": "object", + "description": "Provider options.", + "x-example": { + "from": "sender-email@mydomain" + }, + "nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "provider", + "enabled", + "type", + "credentials" + ] + }, + "message": { + "description": "Message", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Message ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Message creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Message update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerType": { + "type": "string", + "description": "Message provider type.", + "x-example": "email" + }, + "topics": { + "type": "array", + "description": "Topic IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "users": { + "type": "array", + "description": "User IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "targets": { + "type": "array", + "description": "Target IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for message.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "deliveredAt": { + "type": "string", + "description": "The time when the message was delivered.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "nullable": true + }, + "deliveryErrors": { + "type": "array", + "description": "Delivery errors if any.", + "items": { + "type": "string" + }, + "x-example": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "nullable": true + }, + "deliveredTotal": { + "type": "integer", + "description": "Number of recipients the message was delivered to.", + "x-example": 1, + "format": "int32" + }, + "data": { + "type": "object", + "description": "Data of the message.", + "x-example": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + } + }, + "status": { + "type": "string", + "description": "Status of delivery.", + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "providerType", + "topics", + "users", + "targets", + "deliveredTotal", + "data", + "status" + ] + }, + "topic": { + "description": "Topic", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Topic creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Topic update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name of the topic.", + "x-example": "events" + }, + "emailTotal": { + "type": "integer", + "description": "Total count of email subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "smsTotal": { + "type": "integer", + "description": "Total count of SMS subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "pushTotal": { + "type": "integer", + "description": "Total count of push subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "subscribe": { + "type": "array", + "description": "Subscribe permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "emailTotal", + "smsTotal", + "pushTotal", + "subscribe" + ] + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "x-example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "items": { + "$ref": "#\/components\/schemas\/target" + } + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ] + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "x-example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "x-example": "259125845563242502", + "nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ] + } + }, + "securitySchemes": { + "Project": { + "type": "apiKey", + "name": "X-Appwrite-Project", + "description": "Your project ID", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_PROJECT_ID>" + } + }, + "Key": { + "type": "apiKey", + "name": "X-Appwrite-Key", + "description": "Your secret API key", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_API_KEY>" + } + }, + "JWT": { + "type": "apiKey", + "name": "X-Appwrite-JWT", + "description": "Your secret JSON Web Token", + "in": "header" + }, + "Locale": { + "type": "apiKey", + "name": "X-Appwrite-Locale", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "en" + } + }, + "Session": { + "type": "apiKey", + "name": "X-Appwrite-Session", + "description": "The user session to authenticate with", + "in": "header" + }, + "ForwardedUserAgent": { + "type": "apiKey", + "name": "X-Forwarded-User-Agent", + "description": "The user agent string of the client that made the request", + "in": "header" + } + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index 16d29c5f28..d09108e51d 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -4457,6 +4457,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", "server", "server" @@ -4466,6 +4467,7 @@ { "name": "createDocument", "auth": { + "Admin": [], "Session": [], "Key": [], "JWT": [] @@ -4490,29 +4492,6 @@ } ], "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." - }, - { - "name": "createDocuments", - "auth": { - "Key": [] - }, - "parameters": [ - "databaseId", - "collectionId", - "documents" - ], - "required": [ - "databaseId", - "collectionId", - "documents" - ], - "responses": [ - { - "code": 201, - "model": "#\/components\/schemas\/documentList" - } - ], - "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nCreate new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { @@ -4913,7 +4892,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -4974,6 +4953,236 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, "\/functions\/{functionId}\/executions": { "get": { "summary": "List executions", @@ -4997,7 +5206,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -5072,7 +5281,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -5187,7 +5396,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -5261,7 +5470,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -5313,7 +5522,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 306, "cookies": false, "type": "graphql", "deprecated": false, @@ -5365,7 +5574,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5417,7 +5626,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -5469,7 +5678,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -5521,7 +5730,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -5573,7 +5782,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -5625,7 +5834,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -5677,7 +5886,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -5729,7 +5938,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -5781,7 +5990,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -5864,7 +6073,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -5939,7 +6148,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -6025,7 +6234,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -6123,7 +6332,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6195,7 +6404,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6284,7 +6493,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -6351,7 +6560,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -6429,7 +6638,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -6618,7 +6827,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -6656,7 +6866,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -6741,7 +6951,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -6817,7 +7027,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -6902,7 +7112,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -6964,7 +7174,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7038,7 +7248,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7102,7 +7312,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -7188,7 +7398,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7299,7 +7509,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -7371,7 +7581,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -7458,7 +7668,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -7532,7 +7742,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -7630,7 +7840,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7691,7 +7901,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -8205,6 +8415,12 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, "$collectionId": { "type": "string", "description": "Collection ID.", @@ -8239,6 +8455,7 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index 83525478a4..b7450bc7e6 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -4359,7 +4359,7 @@ "x-appwrite": { "method": "chat", "group": "console", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -4419,7 +4419,7 @@ "x-appwrite": { "method": "getResource", "group": null, - "weight": 432, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -4494,7 +4494,7 @@ "x-appwrite": { "method": "variables", "group": "console", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -4694,7 +4694,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 119, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -8016,6 +8016,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", "server", "server" @@ -8025,6 +8026,7 @@ { "name": "createDocument", "auth": { + "Admin": [], "Session": [], "Key": [], "JWT": [] @@ -8053,6 +8055,7 @@ { "name": "createDocuments", "auth": { + "Admin": [], "Key": [] }, "parameters": [ @@ -8167,7 +8170,7 @@ "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -8178,6 +8181,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8227,7 +8231,10 @@ "type": "object" } } - } + }, + "required": [ + "documents" + ] } } } @@ -8239,7 +8246,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nUpdate all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -8255,7 +8262,7 @@ "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -8266,6 +8273,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8348,7 +8356,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -8359,6 +8367,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8741,7 +8750,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -8895,6 +8904,236 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -9362,7 +9601,7 @@ "x-appwrite": { "method": "getCollectionUsage", "group": null, - "weight": 121, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -9527,7 +9766,7 @@ "x-appwrite": { "method": "getDatabaseUsage", "group": null, - "weight": 120, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -9609,7 +9848,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -9682,7 +9921,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -9764,6 +10003,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9789,7 +10029,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9913,7 +10154,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -9962,7 +10203,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -10012,7 +10253,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 402, + "weight": 403, "cookies": false, "type": "", "deprecated": false, @@ -10112,7 +10353,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 401, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -10172,7 +10413,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 395, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -10244,7 +10485,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -10303,7 +10544,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -10392,6 +10633,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -10417,7 +10659,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -10531,7 +10774,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -10592,7 +10835,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -10672,7 +10915,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -10755,7 +10998,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 381, "cookies": false, "type": "upload", "deprecated": false, @@ -10851,7 +11094,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -10936,7 +11179,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -11039,7 +11282,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -11136,7 +11379,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -11198,7 +11441,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -11262,7 +11505,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 388, "cookies": false, "type": "location", "deprecated": false, @@ -11352,7 +11595,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -11423,7 +11666,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -11498,7 +11741,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -11613,7 +11856,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -11678,7 +11921,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -11749,7 +11992,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 394, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -11831,7 +12074,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -11890,7 +12133,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -11981,7 +12224,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -12050,7 +12293,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -12141,7 +12384,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -12212,7 +12455,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -12264,7 +12507,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 306, "cookies": false, "type": "graphql", "deprecated": false, @@ -12316,7 +12559,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12365,7 +12608,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -12414,7 +12657,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12463,7 +12706,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12523,7 +12766,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -12572,7 +12815,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12621,7 +12864,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -12683,7 +12926,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -12745,7 +12988,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -12818,7 +13061,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -12880,7 +13123,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -12968,7 +13211,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -13030,7 +13273,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -13092,7 +13335,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -13154,7 +13397,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13216,7 +13459,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13278,7 +13521,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -13340,7 +13583,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -13402,7 +13645,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -13464,7 +13707,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -13513,7 +13756,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -13562,7 +13805,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -13611,7 +13854,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13663,7 +13906,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -13715,7 +13958,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -13767,7 +14010,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -13819,7 +14062,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -13871,7 +14114,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -13923,7 +14166,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -13975,7 +14218,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -14027,7 +14270,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14103,7 +14346,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -14247,7 +14490,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -14393,7 +14636,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14567,7 +14810,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -14745,7 +14988,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -14854,7 +15097,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -14966,7 +15209,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15019,7 +15262,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15081,7 +15324,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15156,7 +15399,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15231,7 +15474,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -15307,7 +15550,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -15412,7 +15655,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -15520,7 +15763,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -15605,7 +15848,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -15693,7 +15936,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 323, "cookies": false, "type": "", "deprecated": false, @@ -15808,7 +16051,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -15926,7 +16169,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -16021,7 +16264,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -16119,7 +16362,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -16224,7 +16467,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -16332,7 +16575,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -16475,7 +16718,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -16620,7 +16863,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -16715,7 +16958,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -16813,7 +17056,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -16908,7 +17151,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -17006,7 +17249,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -17101,7 +17344,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -17199,7 +17442,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -17294,7 +17537,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -17392,7 +17635,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -17445,7 +17688,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -17507,7 +17750,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -17582,7 +17825,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -17657,7 +17900,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -17731,7 +17974,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -17814,7 +18057,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -17874,7 +18117,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -17951,7 +18194,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -18013,7 +18256,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -18088,7 +18331,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -18172,7 +18415,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -18262,7 +18505,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -18325,7 +18568,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -18400,7 +18643,7 @@ "x-appwrite": { "method": "list", "group": null, - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -18474,7 +18717,7 @@ "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -18562,7 +18805,7 @@ "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 316, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -18655,7 +18898,7 @@ "x-appwrite": { "method": "createCsvMigration", "group": null, - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -18734,7 +18977,7 @@ "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -18810,7 +19053,7 @@ "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 317, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -18882,7 +19125,7 @@ "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -18993,7 +19236,7 @@ "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -19126,7 +19369,7 @@ "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -19231,7 +19474,7 @@ "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -19355,7 +19598,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 315, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -19413,7 +19656,7 @@ "x-appwrite": { "method": "retry", "group": null, - "weight": 320, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -19464,7 +19707,7 @@ "x-appwrite": { "method": "delete", "group": null, - "weight": 321, + "weight": 322, "cookies": false, "type": "", "deprecated": false, @@ -19524,7 +19767,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 200, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -19612,7 +19855,7 @@ "x-appwrite": { "method": "listVariables", "group": null, - "weight": 202, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -19658,7 +19901,7 @@ "x-appwrite": { "method": "createVariable", "group": null, - "weight": 201, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -19736,7 +19979,7 @@ "x-appwrite": { "method": "getVariable", "group": null, - "weight": 203, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -19794,7 +20037,7 @@ "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 204, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -19874,7 +20117,7 @@ "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 205, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -19934,7 +20177,7 @@ "x-appwrite": { "method": "list", "group": "projects", - "weight": 155, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -20006,7 +20249,7 @@ "x-appwrite": { "method": "create", "group": "projects", - "weight": 154, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -20140,7 +20383,7 @@ "x-appwrite": { "method": "get", "group": "projects", - "weight": 156, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -20198,7 +20441,7 @@ "x-appwrite": { "method": "update", "group": "projects", - "weight": 157, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -20313,7 +20556,7 @@ "x-appwrite": { "method": "delete", "group": "projects", - "weight": 174, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -20373,7 +20616,7 @@ "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 161, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -20465,7 +20708,7 @@ "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 162, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -20544,7 +20787,7 @@ "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 167, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20623,7 +20866,7 @@ "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 166, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -20702,7 +20945,7 @@ "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 172, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -20781,7 +21024,7 @@ "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 165, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -20872,7 +21115,7 @@ "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 173, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -20954,7 +21197,7 @@ "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 170, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -21033,7 +21276,7 @@ "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 169, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -21112,7 +21355,7 @@ "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 171, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -21191,7 +21434,7 @@ "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 164, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -21270,7 +21513,7 @@ "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 168, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -21370,7 +21613,7 @@ "x-appwrite": { "method": "listDevKeys", "group": "devKeys", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -21438,7 +21681,7 @@ "x-appwrite": { "method": "createDevKey", "group": "devKeys", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -21523,7 +21766,7 @@ "x-appwrite": { "method": "getDevKey", "group": "devKeys", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -21591,7 +21834,7 @@ "x-appwrite": { "method": "updateDevKey", "group": "devKeys", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -21677,7 +21920,7 @@ "x-appwrite": { "method": "deleteDevKey", "group": "devKeys", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -21747,7 +21990,7 @@ "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 186, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -21834,7 +22077,7 @@ "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 182, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -21892,7 +22135,7 @@ "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 181, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -21985,7 +22228,7 @@ "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 183, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -22053,7 +22296,7 @@ "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 184, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -22147,7 +22390,7 @@ "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 185, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -22217,7 +22460,7 @@ "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 163, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -22355,7 +22598,7 @@ "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 188, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -22413,7 +22656,7 @@ "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 187, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -22532,7 +22775,7 @@ "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 189, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -22600,7 +22843,7 @@ "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 190, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -22695,7 +22938,7 @@ "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 191, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -22765,7 +23008,7 @@ "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 159, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -22866,7 +23109,7 @@ "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 160, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -22945,7 +23188,7 @@ "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 192, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -23063,7 +23306,7 @@ "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 193, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -23194,7 +23437,7 @@ "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 158, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -23273,7 +23516,7 @@ "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 195, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -23497,7 +23740,7 @@ "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 197, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -23761,7 +24004,7 @@ "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 199, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -23987,7 +24230,7 @@ "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 194, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -24208,7 +24451,7 @@ "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 196, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -24448,7 +24691,7 @@ "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 198, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -24671,7 +24914,7 @@ "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 176, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -24729,7 +24972,7 @@ "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 175, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -24844,7 +25087,7 @@ "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 177, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -24912,7 +25155,7 @@ "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 178, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -25028,7 +25271,7 @@ "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 180, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -25098,7 +25341,7 @@ "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 179, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -25168,7 +25411,7 @@ "x-appwrite": { "method": "listRules", "group": null, - "weight": 292, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -25242,7 +25485,7 @@ "x-appwrite": { "method": "createAPIRule", "group": null, - "weight": 433, + "weight": 434, "cookies": false, "type": "", "deprecated": false, @@ -25309,7 +25552,7 @@ "x-appwrite": { "method": "createFunctionRule", "group": null, - "weight": 435, + "weight": 436, "cookies": false, "type": "", "deprecated": false, @@ -25387,7 +25630,7 @@ "x-appwrite": { "method": "createRedirectRule", "group": null, - "weight": 436, + "weight": 437, "cookies": false, "type": "", "deprecated": false, @@ -25443,12 +25686,33 @@ "Temporary Redirect 307", "Permanent Redirect 308" ] + }, + "resourceId": { + "type": "string", + "description": "ID of parent resource.", + "x-example": "<RESOURCE_ID>" + }, + "resourceType": { + "type": "string", + "description": "Type of parent resource.", + "x-example": "site", + "enum": [ + "site", + "function" + ], + "x-enum-name": "ProxyResourceType", + "x-enum-keys": [ + "Site", + "Function" + ] } }, "required": [ "domain", "url", - "statusCode" + "statusCode", + "resourceId", + "resourceType" ] } } @@ -25479,7 +25743,7 @@ "x-appwrite": { "method": "createSiteRule", "group": null, - "weight": 434, + "weight": 435, "cookies": false, "type": "", "deprecated": false, @@ -25557,7 +25821,7 @@ "x-appwrite": { "method": "getRule", "group": null, - "weight": 293, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -25608,7 +25872,7 @@ "x-appwrite": { "method": "deleteRule", "group": null, - "weight": 294, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -25668,7 +25932,7 @@ "x-appwrite": { "method": "updateRuleVerification", "group": null, - "weight": 295, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -25728,7 +25992,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -25798,7 +26062,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -25933,6 +26197,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -25958,7 +26223,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26045,7 +26311,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -26094,7 +26360,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -26144,7 +26410,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 427, + "weight": 428, "cookies": false, "type": "", "deprecated": false, @@ -26244,7 +26510,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 428, + "weight": 429, "cookies": false, "type": "", "deprecated": false, @@ -26304,7 +26570,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 429, + "weight": 430, "cookies": false, "type": "", "deprecated": false, @@ -26376,7 +26642,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -26435,7 +26701,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -26577,6 +26843,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -26602,7 +26869,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26678,7 +26946,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -26739,7 +27007,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -26819,7 +27087,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -26902,7 +27170,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 410, "cookies": false, "type": "upload", "deprecated": false, @@ -27003,7 +27271,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -27083,7 +27351,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -27186,7 +27454,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -27284,7 +27552,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -27346,7 +27614,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -27410,7 +27678,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 417, "cookies": false, "type": "location", "deprecated": false, @@ -27500,7 +27768,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -27571,7 +27839,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -27642,7 +27910,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -27704,7 +27972,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -27775,7 +28043,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 430, + "weight": 431, "cookies": false, "type": "", "deprecated": false, @@ -27857,7 +28125,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -27916,7 +28184,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -28007,7 +28275,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -28076,7 +28344,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -28167,7 +28435,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -28238,7 +28506,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -28311,7 +28579,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -28438,7 +28706,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -28497,7 +28765,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -28621,7 +28889,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 212, "cookies": false, "type": "", "deprecated": false, @@ -28682,7 +28950,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -28768,7 +29036,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -28866,7 +29134,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -28938,7 +29206,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -29027,7 +29295,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -29094,7 +29362,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -29172,7 +29440,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -29361,7 +29629,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -29399,7 +29668,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -29484,7 +29753,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -29556,7 +29825,7 @@ "x-appwrite": { "method": "getBucketUsage", "group": null, - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -29638,7 +29907,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -29714,7 +29983,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -29799,7 +30068,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -29861,7 +30130,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -29935,7 +30204,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -29999,7 +30268,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 235, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -30072,7 +30341,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -30158,7 +30427,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -30269,7 +30538,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -30341,7 +30610,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -30428,7 +30697,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -30502,7 +30771,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -30599,7 +30868,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -30659,7 +30928,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -30740,7 +31009,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 440, "cookies": false, "type": "", "deprecated": false, @@ -30820,7 +31089,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 438, "cookies": false, "type": "", "deprecated": false, @@ -30909,7 +31178,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 439, "cookies": false, "type": "", "deprecated": false, @@ -30969,7 +31238,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 441, "cookies": false, "type": "", "deprecated": false, @@ -31039,7 +31308,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 442, "cookies": false, "type": "", "deprecated": false, @@ -31101,7 +31370,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -31174,7 +31443,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -31262,7 +31531,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -31347,7 +31616,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -31432,7 +31701,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -31500,7 +31769,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -31561,7 +31830,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -31646,7 +31915,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -31731,7 +32000,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -31846,7 +32115,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -31949,7 +32218,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -32054,7 +32323,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 278, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -32126,7 +32395,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -32178,7 +32447,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -32239,7 +32508,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -32319,7 +32588,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -32401,7 +32670,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -32484,7 +32753,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -32558,7 +32827,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -32643,7 +32912,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -32716,7 +32985,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -32792,7 +33061,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -32853,7 +33122,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -32912,7 +33181,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -32971,7 +33240,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -33032,7 +33301,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -33112,7 +33381,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -33192,7 +33461,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -33272,7 +33541,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -33331,7 +33600,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -33411,7 +33680,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -33470,7 +33739,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -33522,7 +33791,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -33576,7 +33845,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -33647,7 +33916,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -33727,7 +33996,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -33765,7 +34034,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "schema": { "type": "array", @@ -33800,7 +34069,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -33910,7 +34179,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -33980,7 +34249,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -34069,7 +34338,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, @@ -34141,7 +34410,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -34223,7 +34492,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -34303,7 +34572,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -34383,7 +34652,7 @@ "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 282, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -34479,7 +34748,7 @@ "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 283, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -34564,7 +34833,7 @@ "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 284, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -34649,7 +34918,7 @@ "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 285, + "weight": 287, "cookies": false, "type": "", "deprecated": false, @@ -34719,7 +34988,7 @@ "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 286, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -34773,7 +35042,7 @@ "tags": [ "vcs" ], - "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.\n", + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", "responses": { "200": { "description": "VCS Content List", @@ -34789,7 +35058,7 @@ "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 281, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -34843,6 +35112,17 @@ "default": "" }, "in": "query" + }, + { + "name": "providerReference", + "description": "Git reference (branch, tag, commit) to get contents from", + "required": false, + "schema": { + "type": "string", + "x-example": "<PROVIDER_REFERENCE>", + "default": "" + }, + "in": "query" } ] } @@ -34863,7 +35143,7 @@ "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 291, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -34952,7 +35232,7 @@ "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 288, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -35026,7 +35306,7 @@ "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 289, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -35077,7 +35357,7 @@ "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 290, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -37344,6 +37624,12 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, "$collectionId": { "type": "string", "description": "Collection ID.", @@ -37378,6 +37664,7 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index da05c6a1a7..8056d5f21b 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -7497,6 +7497,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", "server", "server" @@ -7506,6 +7507,7 @@ { "name": "createDocument", "auth": { + "Admin": [], "Session": [], "Key": [], "JWT": [] @@ -7534,6 +7536,7 @@ { "name": "createDocuments", "auth": { + "Admin": [], "Key": [] }, "parameters": [ @@ -7650,7 +7653,7 @@ "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -7661,6 +7664,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -7711,7 +7715,10 @@ "type": "object" } } - } + }, + "required": [ + "documents" + ] } } } @@ -7723,7 +7730,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nUpdate all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -7739,7 +7746,7 @@ "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -7750,6 +7757,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -7833,7 +7841,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -7844,6 +7852,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8233,7 +8242,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -8296,6 +8305,240 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "content": { + "application\/json": { + "schema": { + "$ref": "#\/components\/schemas\/document" + } + } + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DATABASE_ID>" + }, + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<COLLECTION_ID>" + }, + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "schema": { + "type": "string", + "x-example": "<DOCUMENT_ID>" + }, + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "schema": { + "type": "string" + }, + "in": "path" + } + ], + "requestBody": { + "content": { + "application\/json": { + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "x-example": null + } + } + } + } + } + } + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -8684,7 +8927,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -8758,7 +9001,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -8841,6 +9084,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -8866,7 +9110,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -8990,7 +9235,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -9040,7 +9285,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -9091,7 +9336,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -9151,7 +9396,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -9241,6 +9486,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9266,7 +9512,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9380,7 +9627,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -9442,7 +9689,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -9523,7 +9770,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -9607,7 +9854,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 381, "cookies": false, "type": "upload", "deprecated": false, @@ -9704,7 +9951,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -9790,7 +10037,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -9894,7 +10141,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -9992,7 +10239,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -10055,7 +10302,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -10120,7 +10367,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 388, "cookies": false, "type": "location", "deprecated": false, @@ -10211,7 +10458,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -10283,7 +10530,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -10360,7 +10607,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -10477,7 +10724,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -10544,7 +10791,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -10616,7 +10863,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -10676,7 +10923,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -10768,7 +11015,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -10838,7 +11085,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -10930,7 +11177,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -11002,7 +11249,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -11056,7 +11303,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 306, "cookies": false, "type": "graphql", "deprecated": false, @@ -11110,7 +11357,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -11160,7 +11407,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -11210,7 +11457,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -11260,7 +11507,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11321,7 +11568,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11371,7 +11618,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11421,7 +11668,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11484,7 +11731,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11547,7 +11794,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11621,7 +11868,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11684,7 +11931,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -11773,7 +12020,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11836,7 +12083,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -11899,7 +12146,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -11962,7 +12209,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12025,7 +12272,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -12088,7 +12335,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12151,7 +12398,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -12214,7 +12461,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12277,7 +12524,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -12327,7 +12574,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -12377,7 +12624,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12427,7 +12674,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12481,7 +12728,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -12535,7 +12782,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -12589,7 +12836,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -12643,7 +12890,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -12697,7 +12944,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -12751,7 +12998,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12805,7 +13052,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12859,7 +13106,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -12936,7 +13183,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -13081,7 +13328,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -13228,7 +13475,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -13403,7 +13650,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -13582,7 +13829,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -13692,7 +13939,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -13805,7 +14052,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -13859,7 +14106,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -13922,7 +14169,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -13998,7 +14245,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -14074,7 +14321,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -14151,7 +14398,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -14257,7 +14504,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -14366,7 +14613,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -14452,7 +14699,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -14541,7 +14788,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 323, "cookies": false, "type": "", "deprecated": false, @@ -14657,7 +14904,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -14776,7 +15023,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -14872,7 +15119,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -14971,7 +15218,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -15077,7 +15324,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -15186,7 +15433,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -15330,7 +15577,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -15476,7 +15723,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -15572,7 +15819,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -15671,7 +15918,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -15767,7 +16014,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -15866,7 +16113,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -15962,7 +16209,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -16061,7 +16308,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -16157,7 +16404,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -16256,7 +16503,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -16310,7 +16557,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -16373,7 +16620,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -16449,7 +16696,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -16525,7 +16772,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -16600,7 +16847,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -16684,7 +16931,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -16745,7 +16992,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -16823,7 +17070,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -16886,7 +17133,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -16962,7 +17209,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -17047,7 +17294,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -17139,7 +17386,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -17203,7 +17450,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -17280,7 +17527,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -17351,7 +17598,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -17487,6 +17734,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -17512,7 +17760,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -17599,7 +17848,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -17649,7 +17898,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -17700,7 +17949,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -17760,7 +18009,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -17903,6 +18152,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -17928,7 +18178,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -18004,7 +18255,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -18066,7 +18317,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -18147,7 +18398,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -18231,7 +18482,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 410, "cookies": false, "type": "upload", "deprecated": false, @@ -18333,7 +18584,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -18414,7 +18665,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -18518,7 +18769,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -18617,7 +18868,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -18680,7 +18931,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -18745,7 +18996,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 417, "cookies": false, "type": "location", "deprecated": false, @@ -18836,7 +19087,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -18908,7 +19159,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -18980,7 +19231,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -19043,7 +19294,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -19115,7 +19366,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -19175,7 +19426,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -19267,7 +19518,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -19337,7 +19588,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -19429,7 +19680,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -19501,7 +19752,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -19575,7 +19826,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -19703,7 +19954,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -19763,7 +20014,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -19888,7 +20139,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 212, "cookies": false, "type": "", "deprecated": false, @@ -19950,7 +20201,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -20038,7 +20289,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -20138,7 +20389,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -20212,7 +20463,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -20303,7 +20554,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -20372,7 +20623,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -20452,7 +20703,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -20643,7 +20894,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -20681,7 +20933,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -20768,7 +21020,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -20846,7 +21098,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -20933,7 +21185,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -20997,7 +21249,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -21073,7 +21325,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -21139,7 +21391,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -21227,7 +21479,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -21340,7 +21592,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -21414,7 +21666,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -21503,7 +21755,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -21579,7 +21831,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -21678,7 +21930,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -21740,7 +21992,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -21823,7 +22075,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 440, "cookies": false, "type": "", "deprecated": false, @@ -21904,7 +22156,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 438, "cookies": false, "type": "", "deprecated": false, @@ -21994,7 +22246,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 439, "cookies": false, "type": "", "deprecated": false, @@ -22055,7 +22307,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 441, "cookies": false, "type": "", "deprecated": false, @@ -22126,7 +22378,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 442, "cookies": false, "type": "", "deprecated": false, @@ -22189,7 +22441,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -22263,7 +22515,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -22352,7 +22604,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -22438,7 +22690,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -22524,7 +22776,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -22593,7 +22845,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -22655,7 +22907,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -22741,7 +22993,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -22827,7 +23079,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -22943,7 +23195,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -23047,7 +23299,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -23153,7 +23405,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -23206,7 +23458,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -23268,7 +23520,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -23349,7 +23601,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -23432,7 +23684,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -23516,7 +23768,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -23591,7 +23843,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -23677,7 +23929,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -23751,7 +24003,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -23828,7 +24080,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -23890,7 +24142,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -23950,7 +24202,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -24010,7 +24262,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -24072,7 +24324,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -24153,7 +24405,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -24234,7 +24486,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -24315,7 +24567,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -24375,7 +24627,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -24456,7 +24708,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -24516,7 +24768,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -24569,7 +24821,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -24624,7 +24876,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -24696,7 +24948,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -24777,7 +25029,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -24816,7 +25068,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "schema": { "type": "array", @@ -24851,7 +25103,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -24962,7 +25214,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -25033,7 +25285,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -25123,7 +25375,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, @@ -25196,7 +25448,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -25279,7 +25531,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -25360,7 +25612,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -27312,6 +27564,12 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, "$collectionId": { "type": "string", "description": "Collection ID.", @@ -27346,6 +27604,7 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", diff --git a/app/config/specs/swagger2-1.7.x-client.json b/app/config/specs/swagger2-1.7.x-client.json index d2bc6d2e7e..c3353e157f 100644 --- a/app/config/specs/swagger2-1.7.x-client.json +++ b/app/config/specs/swagger2-1.7.x-client.json @@ -3451,7 +3451,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3576,7 +3575,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3707,7 +3705,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3770,7 +3767,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4257,7 +4253,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4340,7 +4335,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4431,7 +4425,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4522,7 +4515,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4603,8 +4595,8 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", - "server", "server" ], "packaging": false, @@ -4612,6 +4604,7 @@ { "name": "createDocument", "auth": { + "Admin": [], "Session": [], "Key": [], "JWT": [] @@ -4636,29 +4629,6 @@ } ], "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." - }, - { - "name": "createDocuments", - "auth": { - "Key": [] - }, - "parameters": [ - "databaseId", - "collectionId", - "documents" - ], - "required": [ - "databaseId", - "collectionId", - "documents" - ], - "responses": [ - { - "code": 201, - "model": "#\/definitions\/documentList" - } - ], - "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nCreate new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { @@ -4766,7 +4736,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4856,7 +4825,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4961,7 +4929,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5046,7 +5013,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -5058,7 +5025,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5101,6 +5067,222 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, "\/functions\/{functionId}\/executions": { "get": { "summary": "List executions", @@ -5124,7 +5306,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -5136,7 +5318,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5198,7 +5379,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -5210,7 +5391,6 @@ "scope": "execution.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5315,7 +5495,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -5327,7 +5507,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5387,7 +5566,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -5399,8 +5578,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -5461,7 +5639,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 306, "cookies": false, "type": "graphql", "deprecated": false, @@ -5473,8 +5651,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -5533,7 +5710,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5545,7 +5722,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5585,7 +5761,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -5597,7 +5773,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5637,7 +5812,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -5649,7 +5824,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5689,7 +5863,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -5701,7 +5875,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5741,7 +5914,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -5753,7 +5926,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5793,7 +5965,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -5805,7 +5977,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5845,7 +6016,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -5857,7 +6028,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5897,7 +6067,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -5909,7 +6079,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5951,7 +6120,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -5964,8 +6133,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -6036,7 +6204,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -6049,8 +6217,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -6107,7 +6274,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -6119,7 +6286,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6190,7 +6356,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -6202,7 +6368,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6280,7 +6445,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6292,7 +6457,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6350,7 +6514,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6362,7 +6526,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6439,7 +6602,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -6451,7 +6614,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6509,7 +6671,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -6521,7 +6683,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6588,7 +6749,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -6600,7 +6761,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6752,7 +6912,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -6794,7 +6955,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -6806,7 +6967,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6873,7 +7033,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -6885,7 +7045,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6948,7 +7107,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -6960,7 +7119,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7038,7 +7196,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7050,7 +7208,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7100,7 +7257,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7112,7 +7269,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7175,7 +7331,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7187,7 +7343,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7237,7 +7392,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -7249,7 +7404,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7320,7 +7474,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7332,7 +7486,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7433,7 +7586,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -7445,7 +7598,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7503,7 +7655,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -7515,7 +7667,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7589,7 +7740,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -7601,7 +7752,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7661,7 +7811,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -7755,7 +7905,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7816,7 +7966,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -8308,6 +8458,12 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, "$collectionId": { "type": "string", "description": "Collection ID.", @@ -8342,6 +8498,7 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", diff --git a/app/config/specs/swagger2-1.7.x-console.json b/app/config/specs/swagger2-1.7.x-console.json index 249769e186..4fa839aa39 100644 --- a/app/config/specs/swagger2-1.7.x-console.json +++ b/app/config/specs/swagger2-1.7.x-console.json @@ -3466,7 +3466,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3591,7 +3590,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3722,7 +3720,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3785,7 +3782,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4272,7 +4268,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4355,7 +4350,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4446,7 +4440,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4527,7 +4520,7 @@ "x-appwrite": { "method": "chat", "group": "console", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -4590,7 +4583,7 @@ "x-appwrite": { "method": "getResource", "group": null, - "weight": 432, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -4661,7 +4654,7 @@ "x-appwrite": { "method": "variables", "group": "console", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -4863,7 +4856,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 119, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -8064,7 +8057,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8145,8 +8137,8 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", - "server", "server" ], "packaging": false, @@ -8154,6 +8146,7 @@ { "name": "createDocument", "auth": { + "Admin": [], "Session": [], "Key": [], "JWT": [] @@ -8182,6 +8175,7 @@ { "name": "createDocuments", "auth": { + "Admin": [], "Key": [] }, "parameters": [ @@ -8296,7 +8290,7 @@ "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -8307,6 +8301,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8346,13 +8341,16 @@ "documents": { "type": "array", "description": "Array of document data as JSON objects. May contain partial documents.", - "default": [], + "default": null, "x-example": null, "items": { "type": "object" } } - } + }, + "required": [ + "documents" + ] } } ] @@ -8369,7 +8367,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nUpdate all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -8381,7 +8379,7 @@ "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -8392,6 +8390,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8472,7 +8471,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -8483,6 +8482,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8569,7 +8569,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8659,7 +8658,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8764,7 +8762,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8849,7 +8846,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -8861,7 +8858,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8990,6 +8986,222 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -9440,7 +9652,7 @@ "x-appwrite": { "method": "getCollectionUsage", "group": null, - "weight": 121, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -9596,7 +9808,7 @@ "x-appwrite": { "method": "getDatabaseUsage", "group": null, - "weight": 120, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -9674,7 +9886,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -9746,7 +9958,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -9832,6 +10044,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9857,7 +10070,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9995,7 +10209,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -10044,7 +10258,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -10094,7 +10308,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 402, + "weight": 403, "cookies": false, "type": "", "deprecated": false, @@ -10188,7 +10402,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 401, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -10246,7 +10460,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 395, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -10316,7 +10530,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -10375,7 +10589,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -10463,6 +10677,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -10488,7 +10703,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -10620,7 +10836,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -10681,7 +10897,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -10758,7 +10974,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -10838,7 +11054,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 381, "cookies": false, "type": "upload", "deprecated": false, @@ -10930,7 +11146,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -11015,7 +11231,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -11121,7 +11337,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -11217,7 +11433,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -11279,7 +11495,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -11346,7 +11562,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 388, "cookies": false, "type": "location", "deprecated": false, @@ -11357,7 +11573,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "functions.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -11432,7 +11647,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -11499,7 +11714,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -11511,7 +11726,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -11573,7 +11787,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -11585,7 +11799,6 @@ "scope": "execution.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -11690,7 +11903,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -11702,7 +11915,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -11755,7 +11967,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -11822,7 +12034,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 394, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -11900,7 +12112,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -11959,7 +12171,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -12049,7 +12261,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -12116,7 +12328,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -12208,7 +12420,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -12277,7 +12489,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -12289,8 +12501,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -12351,7 +12562,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 306, "cookies": false, "type": "graphql", "deprecated": false, @@ -12363,8 +12574,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -12423,7 +12633,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12472,7 +12682,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -12521,7 +12731,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12570,7 +12780,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12628,7 +12838,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -12677,7 +12887,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12726,7 +12936,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -12786,7 +12996,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -12846,7 +13056,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -12915,7 +13125,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -12975,7 +13185,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -13059,7 +13269,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -13119,7 +13329,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -13179,7 +13389,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -13239,7 +13449,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13299,7 +13509,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13359,7 +13569,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -13419,7 +13629,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -13479,7 +13689,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -13539,7 +13749,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -13588,7 +13798,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -13637,7 +13847,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -13686,7 +13896,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13698,7 +13908,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13738,7 +13947,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -13750,7 +13959,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13790,7 +13998,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -13802,7 +14010,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13842,7 +14049,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -13854,7 +14061,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13894,7 +14100,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -13906,7 +14112,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13946,7 +14151,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -13958,7 +14163,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13998,7 +14202,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -14010,7 +14214,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -14050,7 +14253,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -14062,7 +14265,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -14102,7 +14304,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14177,7 +14379,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -14335,7 +14537,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -14490,7 +14692,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14685,7 +14887,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -14879,7 +15081,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -14997,7 +15199,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15111,7 +15313,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15166,7 +15368,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15226,7 +15428,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15298,7 +15500,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15370,7 +15572,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -15445,7 +15647,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -15560,7 +15762,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -15673,7 +15875,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -15764,7 +15966,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -15853,7 +16055,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 323, "cookies": false, "type": "", "deprecated": false, @@ -15980,7 +16182,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -16105,7 +16307,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -16208,7 +16410,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -16309,7 +16511,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -16424,7 +16626,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -16537,7 +16739,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -16696,7 +16898,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -16852,7 +17054,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -16955,7 +17157,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -17056,7 +17258,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -17159,7 +17361,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -17260,7 +17462,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -17363,7 +17565,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -17464,7 +17666,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -17567,7 +17769,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -17666,7 +17868,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -17721,7 +17923,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -17781,7 +17983,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -17853,7 +18055,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -17925,7 +18127,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -17998,7 +18200,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -18086,7 +18288,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -18146,7 +18348,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -18225,7 +18427,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -18285,7 +18487,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -18357,7 +18559,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -18438,7 +18640,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -18451,8 +18653,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -18526,7 +18727,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -18589,7 +18790,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -18602,8 +18803,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -18660,7 +18860,7 @@ "x-appwrite": { "method": "list", "group": null, - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -18733,7 +18933,7 @@ "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -18825,7 +19025,7 @@ "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 316, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -18913,7 +19113,7 @@ "x-appwrite": { "method": "createCsvMigration", "group": null, - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -18997,7 +19197,7 @@ "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -19075,7 +19275,7 @@ "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 317, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -19146,7 +19346,7 @@ "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -19265,7 +19465,7 @@ "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -19385,7 +19585,7 @@ "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -19497,7 +19697,7 @@ "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -19608,7 +19808,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 315, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -19666,7 +19866,7 @@ "x-appwrite": { "method": "retry", "group": null, - "weight": 320, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -19719,7 +19919,7 @@ "x-appwrite": { "method": "delete", "group": null, - "weight": 321, + "weight": 322, "cookies": false, "type": "", "deprecated": false, @@ -19777,7 +19977,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 200, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -19859,7 +20059,7 @@ "x-appwrite": { "method": "listVariables", "group": null, - "weight": 202, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -19907,7 +20107,7 @@ "x-appwrite": { "method": "createVariable", "group": null, - "weight": 201, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -19988,7 +20188,7 @@ "x-appwrite": { "method": "getVariable", "group": null, - "weight": 203, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -20046,7 +20246,7 @@ "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 204, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -20129,7 +20329,7 @@ "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 205, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -20187,7 +20387,7 @@ "x-appwrite": { "method": "list", "group": "projects", - "weight": 155, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -20258,7 +20458,7 @@ "x-appwrite": { "method": "create", "group": "projects", - "weight": 154, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -20405,7 +20605,7 @@ "x-appwrite": { "method": "get", "group": "projects", - "weight": 156, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -20463,7 +20663,7 @@ "x-appwrite": { "method": "update", "group": "projects", - "weight": 157, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -20588,7 +20788,7 @@ "x-appwrite": { "method": "delete", "group": "projects", - "weight": 174, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -20648,7 +20848,7 @@ "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 161, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -20740,7 +20940,7 @@ "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 162, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -20818,7 +21018,7 @@ "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 167, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20896,7 +21096,7 @@ "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 166, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -20974,7 +21174,7 @@ "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 172, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -21052,7 +21252,7 @@ "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 165, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -21144,7 +21344,7 @@ "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 173, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -21225,7 +21425,7 @@ "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 170, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -21303,7 +21503,7 @@ "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 169, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -21381,7 +21581,7 @@ "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 171, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -21459,7 +21659,7 @@ "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 164, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -21537,7 +21737,7 @@ "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 168, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -21632,7 +21832,7 @@ "x-appwrite": { "method": "listDevKeys", "group": "devKeys", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -21702,7 +21902,7 @@ "x-appwrite": { "method": "createDevKey", "group": "devKeys", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -21785,7 +21985,7 @@ "x-appwrite": { "method": "getDevKey", "group": "devKeys", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -21851,7 +22051,7 @@ "x-appwrite": { "method": "updateDevKey", "group": "devKeys", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -21937,7 +22137,7 @@ "x-appwrite": { "method": "deleteDevKey", "group": "devKeys", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -22005,7 +22205,7 @@ "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 186, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -22090,7 +22290,7 @@ "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 182, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -22148,7 +22348,7 @@ "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 181, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -22240,7 +22440,7 @@ "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 183, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -22306,7 +22506,7 @@ "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 184, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -22401,7 +22601,7 @@ "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 185, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -22469,7 +22669,7 @@ "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 163, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -22607,7 +22807,7 @@ "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 188, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -22665,7 +22865,7 @@ "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 187, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -22785,7 +22985,7 @@ "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 189, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -22851,7 +23051,7 @@ "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 190, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -22948,7 +23148,7 @@ "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 191, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -23016,7 +23216,7 @@ "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 159, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -23117,7 +23317,7 @@ "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 160, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -23195,7 +23395,7 @@ "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 192, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -23324,7 +23524,7 @@ "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 193, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -23462,7 +23662,7 @@ "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 158, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -23538,7 +23738,7 @@ "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 195, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -23758,7 +23958,7 @@ "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 197, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -24021,7 +24221,7 @@ "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 199, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -24241,7 +24441,7 @@ "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 194, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -24458,7 +24658,7 @@ "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 196, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -24693,7 +24893,7 @@ "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 198, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -24910,7 +25110,7 @@ "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 176, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -24968,7 +25168,7 @@ "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 175, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -25086,7 +25286,7 @@ "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 177, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -25152,7 +25352,7 @@ "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 178, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -25273,7 +25473,7 @@ "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 180, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -25341,7 +25541,7 @@ "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 179, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -25407,7 +25607,7 @@ "x-appwrite": { "method": "listRules", "group": null, - "weight": 292, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -25480,7 +25680,7 @@ "x-appwrite": { "method": "createAPIRule", "group": null, - "weight": 433, + "weight": 434, "cookies": false, "type": "", "deprecated": false, @@ -25550,7 +25750,7 @@ "x-appwrite": { "method": "createFunctionRule", "group": null, - "weight": 435, + "weight": 436, "cookies": false, "type": "", "deprecated": false, @@ -25633,7 +25833,7 @@ "x-appwrite": { "method": "createRedirectRule", "group": null, - "weight": 436, + "weight": 437, "cookies": false, "type": "", "deprecated": false, @@ -25693,12 +25893,35 @@ "Temporary Redirect 307", "Permanent Redirect 308" ] + }, + "resourceId": { + "type": "string", + "description": "ID of parent resource.", + "default": null, + "x-example": "<RESOURCE_ID>" + }, + "resourceType": { + "type": "string", + "description": "Type of parent resource.", + "default": null, + "x-example": "site", + "enum": [ + "site", + "function" + ], + "x-enum-name": "ProxyResourceType", + "x-enum-keys": [ + "Site", + "Function" + ] } }, "required": [ "domain", "url", - "statusCode" + "statusCode", + "resourceId", + "resourceType" ] } } @@ -25730,7 +25953,7 @@ "x-appwrite": { "method": "createSiteRule", "group": null, - "weight": 434, + "weight": 435, "cookies": false, "type": "", "deprecated": false, @@ -25811,7 +26034,7 @@ "x-appwrite": { "method": "getRule", "group": null, - "weight": 293, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -25864,7 +26087,7 @@ "x-appwrite": { "method": "deleteRule", "group": null, - "weight": 294, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -25924,7 +26147,7 @@ "x-appwrite": { "method": "updateRuleVerification", "group": null, - "weight": 295, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -25982,7 +26205,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -26054,7 +26277,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -26200,6 +26423,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -26225,7 +26449,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26319,7 +26544,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -26368,7 +26593,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -26418,7 +26643,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 427, + "weight": 428, "cookies": false, "type": "", "deprecated": false, @@ -26512,7 +26737,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 428, + "weight": 429, "cookies": false, "type": "", "deprecated": false, @@ -26570,7 +26795,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 429, + "weight": 430, "cookies": false, "type": "", "deprecated": false, @@ -26640,7 +26865,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -26699,7 +26924,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -26847,6 +27072,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -26872,7 +27098,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26959,7 +27186,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -27020,7 +27247,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -27097,7 +27324,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -27177,7 +27404,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 410, "cookies": false, "type": "upload", "deprecated": false, @@ -27277,7 +27504,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -27356,7 +27583,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -27462,7 +27689,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -27559,7 +27786,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -27621,7 +27848,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -27688,7 +27915,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 417, "cookies": false, "type": "location", "deprecated": false, @@ -27699,7 +27926,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "sites.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -27774,7 +28000,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -27841,7 +28067,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -27912,7 +28138,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -27976,7 +28202,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -28043,7 +28269,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 430, + "weight": 431, "cookies": false, "type": "", "deprecated": false, @@ -28121,7 +28347,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -28180,7 +28406,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -28270,7 +28496,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -28337,7 +28563,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -28429,7 +28655,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -28496,7 +28722,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -28568,7 +28794,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -28705,7 +28931,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -28764,7 +28990,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -28897,7 +29123,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 212, "cookies": false, "type": "", "deprecated": false, @@ -28956,7 +29182,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -28968,7 +29194,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29039,7 +29264,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -29051,7 +29276,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29129,7 +29353,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -29141,7 +29365,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29199,7 +29422,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -29211,7 +29434,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29288,7 +29510,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -29300,7 +29522,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29358,7 +29579,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -29370,7 +29591,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29437,7 +29657,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -29449,7 +29669,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29601,7 +29820,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -29643,7 +29863,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -29655,7 +29875,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29722,7 +29941,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -29792,7 +30011,7 @@ "x-appwrite": { "method": "getBucketUsage", "group": null, - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -29870,7 +30089,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -29882,7 +30101,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29945,7 +30163,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -29957,7 +30175,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30035,7 +30252,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -30047,7 +30264,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30097,7 +30313,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -30109,7 +30325,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30172,7 +30387,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -30184,7 +30399,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30234,7 +30448,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 235, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -30304,7 +30518,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -30316,7 +30530,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30387,7 +30600,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -30399,7 +30612,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30500,7 +30712,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -30512,7 +30724,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30570,7 +30781,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -30582,7 +30793,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30656,7 +30866,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -30668,7 +30878,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30728,7 +30937,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -30821,7 +31030,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -30881,7 +31090,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -30959,7 +31168,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 440, "cookies": false, "type": "", "deprecated": false, @@ -31039,7 +31248,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 438, "cookies": false, "type": "", "deprecated": false, @@ -31123,7 +31332,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 439, "cookies": false, "type": "", "deprecated": false, @@ -31183,7 +31392,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 441, "cookies": false, "type": "", "deprecated": false, @@ -31254,7 +31463,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 442, "cookies": false, "type": "", "deprecated": false, @@ -31314,7 +31523,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -31386,7 +31595,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -31481,7 +31690,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -31572,7 +31781,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -31661,7 +31870,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -31730,7 +31939,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -31791,7 +32000,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -31882,7 +32091,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -31973,7 +32182,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -32099,7 +32308,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -32211,7 +32420,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -32321,7 +32530,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 278, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -32391,7 +32600,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -32445,7 +32654,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -32506,7 +32715,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -32585,7 +32794,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -32667,7 +32876,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -32747,7 +32956,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -32818,7 +33027,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -32900,7 +33109,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -32974,7 +33183,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -33046,7 +33255,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -33105,7 +33314,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -33164,7 +33373,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -33223,7 +33432,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -33284,7 +33493,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -33363,7 +33572,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -33442,7 +33651,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -33519,7 +33728,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -33578,7 +33787,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -33655,7 +33864,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -33714,7 +33923,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -33768,7 +33977,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -33824,7 +34033,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -33893,7 +34102,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -33970,7 +34179,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -34006,7 +34215,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "type": "array", "collectionFormat": "multi", @@ -34042,7 +34251,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -34153,7 +34362,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -34221,7 +34430,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -34311,7 +34520,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, @@ -34381,7 +34590,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -34463,7 +34672,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -34542,7 +34751,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -34621,7 +34830,7 @@ "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 282, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -34716,7 +34925,7 @@ "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 283, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -34797,7 +35006,7 @@ "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 284, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -34880,7 +35089,7 @@ "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 285, + "weight": 287, "cookies": false, "type": "", "deprecated": false, @@ -34946,7 +35155,7 @@ "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 286, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -35000,7 +35209,7 @@ "tags": [ "vcs" ], - "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.\n", + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", "responses": { "200": { "description": "VCS Content List", @@ -35012,7 +35221,7 @@ "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 281, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -35060,6 +35269,15 @@ "x-example": "<PROVIDER_ROOT_DIRECTORY>", "default": "", "in": "query" + }, + { + "name": "providerReference", + "description": "Git reference (branch, tag, commit) to get contents from", + "required": false, + "type": "string", + "x-example": "<PROVIDER_REFERENCE>", + "default": "", + "in": "query" } ] } @@ -35086,7 +35304,7 @@ "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 291, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -35170,7 +35388,7 @@ "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 288, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -35241,7 +35459,7 @@ "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 289, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -35294,7 +35512,7 @@ "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 290, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -37573,6 +37791,12 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, "$collectionId": { "type": "string", "description": "Collection ID.", @@ -37607,6 +37831,7 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", diff --git a/app/config/specs/swagger2-1.7.x-server.json b/app/config/specs/swagger2-1.7.x-server.json index 2bce9b4d7d..5dc7b6d925 100644 --- a/app/config/specs/swagger2-1.7.x-server.json +++ b/app/config/specs/swagger2-1.7.x-server.json @@ -3142,7 +3142,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3269,7 +3268,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3402,7 +3400,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3467,7 +3464,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3956,7 +3952,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4041,7 +4036,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4134,7 +4128,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7533,7 +7526,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7616,8 +7608,8 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", - "server", "server" ], "packaging": false, @@ -7625,6 +7617,7 @@ { "name": "createDocument", "auth": { + "Admin": [], "Session": [], "Key": [], "JWT": [] @@ -7653,6 +7646,7 @@ { "name": "createDocuments", "auth": { + "Admin": [], "Key": [] }, "parameters": [ @@ -7769,7 +7763,7 @@ "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -7780,6 +7774,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -7820,13 +7815,16 @@ "documents": { "type": "array", "description": "Array of document data as JSON objects. May contain partial documents.", - "default": [], + "default": null, "x-example": null, "items": { "type": "object" } } - } + }, + "required": [ + "documents" + ] } } ] @@ -7843,7 +7841,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nUpdate all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -7855,7 +7853,7 @@ "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -7866,6 +7864,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -7947,7 +7946,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -7958,6 +7957,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8045,7 +8045,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8137,7 +8136,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8244,7 +8242,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8331,7 +8328,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -8343,7 +8340,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8388,6 +8384,226 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -8764,7 +8980,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -8837,7 +9053,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -8924,6 +9140,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -8949,7 +9166,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9087,7 +9305,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -9137,7 +9355,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -9188,7 +9406,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -9248,7 +9466,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -9337,6 +9555,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9362,7 +9581,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9494,7 +9714,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -9556,7 +9776,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -9634,7 +9854,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -9715,7 +9935,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 381, "cookies": false, "type": "upload", "deprecated": false, @@ -9808,7 +10028,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -9894,7 +10114,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -10001,7 +10221,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -10098,7 +10318,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -10161,7 +10381,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -10229,7 +10449,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 388, "cookies": false, "type": "location", "deprecated": false, @@ -10240,7 +10460,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "functions.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -10316,7 +10535,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -10384,7 +10603,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -10396,7 +10615,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -10460,7 +10678,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -10472,7 +10690,6 @@ "scope": "execution.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -10579,7 +10796,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -10591,7 +10808,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -10646,7 +10862,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -10714,7 +10930,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -10774,7 +10990,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -10865,7 +11081,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -10933,7 +11149,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -11026,7 +11242,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -11096,7 +11312,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -11108,8 +11324,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -11172,7 +11387,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 306, "cookies": false, "type": "graphql", "deprecated": false, @@ -11184,8 +11399,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -11246,7 +11460,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -11296,7 +11510,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -11346,7 +11560,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -11396,7 +11610,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11455,7 +11669,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11505,7 +11719,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11555,7 +11769,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11616,7 +11830,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11677,7 +11891,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11747,7 +11961,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11808,7 +12022,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -11893,7 +12107,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11954,7 +12168,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -12015,7 +12229,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -12076,7 +12290,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12137,7 +12351,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -12198,7 +12412,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12259,7 +12473,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -12320,7 +12534,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12381,7 +12595,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -12431,7 +12645,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -12481,7 +12695,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12531,7 +12745,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12543,7 +12757,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12585,7 +12798,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -12597,7 +12810,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12639,7 +12851,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -12651,7 +12863,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12693,7 +12904,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -12705,7 +12916,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12747,7 +12957,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -12759,7 +12969,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12801,7 +13010,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -12813,7 +13022,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12855,7 +13063,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12867,7 +13075,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12909,7 +13116,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12921,7 +13128,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12963,7 +13169,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -13039,7 +13245,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -13198,7 +13404,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -13354,7 +13560,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -13550,7 +13756,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -13745,7 +13951,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -13864,7 +14070,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -13979,7 +14185,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -14035,7 +14241,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -14096,7 +14302,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14169,7 +14375,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -14242,7 +14448,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -14318,7 +14524,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -14434,7 +14640,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -14548,7 +14754,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -14640,7 +14846,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -14730,7 +14936,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 323, "cookies": false, "type": "", "deprecated": false, @@ -14858,7 +15064,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -14984,7 +15190,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -15088,7 +15294,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -15190,7 +15396,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -15306,7 +15512,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -15420,7 +15626,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -15580,7 +15786,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -15737,7 +15943,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -15841,7 +16047,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -15943,7 +16149,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -16047,7 +16253,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -16149,7 +16355,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -16253,7 +16459,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -16355,7 +16561,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -16459,7 +16665,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -16559,7 +16765,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -16615,7 +16821,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -16676,7 +16882,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -16749,7 +16955,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -16822,7 +17028,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -16896,7 +17102,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -16985,7 +17191,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -17046,7 +17252,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -17126,7 +17332,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -17187,7 +17393,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -17260,7 +17466,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -17342,7 +17548,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -17355,8 +17561,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -17432,7 +17637,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -17496,7 +17701,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -17509,8 +17714,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -17569,7 +17773,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -17642,7 +17846,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -17789,6 +17993,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -17814,7 +18019,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -17908,7 +18114,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -17958,7 +18164,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -18009,7 +18215,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -18069,7 +18275,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -18218,6 +18424,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -18243,7 +18450,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -18330,7 +18538,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -18392,7 +18600,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -18470,7 +18678,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -18551,7 +18759,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 410, "cookies": false, "type": "upload", "deprecated": false, @@ -18652,7 +18860,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -18732,7 +18940,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -18839,7 +19047,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -18937,7 +19145,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -19000,7 +19208,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -19068,7 +19276,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 417, "cookies": false, "type": "location", "deprecated": false, @@ -19079,7 +19287,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "sites.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -19155,7 +19362,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -19223,7 +19430,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -19295,7 +19502,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -19360,7 +19567,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -19428,7 +19635,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -19488,7 +19695,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -19579,7 +19786,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -19647,7 +19854,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -19740,7 +19947,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -19808,7 +20015,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -19881,7 +20088,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -20019,7 +20226,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -20079,7 +20286,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -20213,7 +20420,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 212, "cookies": false, "type": "", "deprecated": false, @@ -20273,7 +20480,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -20285,7 +20492,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20358,7 +20564,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -20370,7 +20576,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20450,7 +20655,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -20462,7 +20667,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20522,7 +20726,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -20534,7 +20738,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20613,7 +20816,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -20625,7 +20828,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20685,7 +20887,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -20697,7 +20899,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20766,7 +20967,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -20778,7 +20979,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20932,7 +21132,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -20974,7 +21175,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -20986,7 +21187,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21055,7 +21255,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -21067,7 +21267,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21132,7 +21331,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -21144,7 +21343,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21224,7 +21422,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -21236,7 +21434,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21288,7 +21485,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -21300,7 +21497,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21365,7 +21561,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -21377,7 +21573,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21429,7 +21624,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -21441,7 +21636,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21514,7 +21708,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -21526,7 +21720,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21629,7 +21822,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -21641,7 +21834,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21701,7 +21893,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -21713,7 +21905,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21789,7 +21980,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -21801,7 +21992,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21863,7 +22053,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -21958,7 +22148,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -22020,7 +22210,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -22100,7 +22290,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 440, "cookies": false, "type": "", "deprecated": false, @@ -22181,7 +22371,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 438, "cookies": false, "type": "", "deprecated": false, @@ -22266,7 +22456,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 439, "cookies": false, "type": "", "deprecated": false, @@ -22327,7 +22517,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 441, "cookies": false, "type": "", "deprecated": false, @@ -22399,7 +22589,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 442, "cookies": false, "type": "", "deprecated": false, @@ -22460,7 +22650,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -22533,7 +22723,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -22629,7 +22819,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -22721,7 +22911,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -22811,7 +23001,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -22881,7 +23071,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -22943,7 +23133,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -23035,7 +23225,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -23127,7 +23317,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -23254,7 +23444,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -23367,7 +23557,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -23478,7 +23668,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -23533,7 +23723,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -23595,7 +23785,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -23675,7 +23865,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -23758,7 +23948,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -23839,7 +24029,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -23911,7 +24101,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -23994,7 +24184,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -24069,7 +24259,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -24142,7 +24332,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -24202,7 +24392,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -24262,7 +24452,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -24322,7 +24512,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -24384,7 +24574,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -24464,7 +24654,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -24544,7 +24734,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -24622,7 +24812,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -24682,7 +24872,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -24760,7 +24950,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -24820,7 +25010,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -24875,7 +25065,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -24932,7 +25122,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -25002,7 +25192,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -25080,7 +25270,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -25117,7 +25307,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "type": "array", "collectionFormat": "multi", @@ -25153,7 +25343,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -25265,7 +25455,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -25334,7 +25524,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -25425,7 +25615,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, @@ -25496,7 +25686,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -25579,7 +25769,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -25659,7 +25849,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -27608,6 +27798,12 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, "$collectionId": { "type": "string", "description": "Collection ID.", @@ -27642,6 +27838,7 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", diff --git a/app/config/specs/swagger2-1.8.x-client.json b/app/config/specs/swagger2-1.8.x-client.json new file mode 100644 index 0000000000..33fe1a93c9 --- /dev/null +++ b/app/config/specs/swagger2-1.8.x-client.json @@ -0,0 +1,10175 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.7.4", + "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@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "host": "cloud.appwrite.io", + "x-host-docs": "<REGION>.cloud.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", + "x-appwrite": { + "demo": "<YOUR_PROJECT_ID>" + } + }, + "JWT": { + "type": "apiKey", + "name": "X-Appwrite-JWT", + "description": "Your secret JSON Web Token", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_JWT>" + } + }, + "Locale": { + "type": "apiKey", + "name": "X-Appwrite-Locale", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "en" + } + }, + "Session": { + "type": "apiKey", + "name": "X-Appwrite-Session", + "description": "The user session to authenticate with", + "in": "header" + }, + "DevKey": { + "type": "apiKey", + "name": "X-Appwrite-Dev-Key", + "description": "Your secret dev API key", + "in": "header" + } + }, + "paths": { + "\/account": { + "get": { + "summary": "Get account", + "operationId": "accountGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the currently logged in user.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "account", + "weight": 10, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create account", + "operationId": "accountCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailSession).", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "create", + "group": "account", + "weight": 9, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "default": null, + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/email": { + "patch": { + "summary": "Update email", + "operationId": "accountUpdateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateEmail", + "group": "account", + "weight": 35, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/identities": { + "get": { + "summary": "List identities", + "operationId": "accountListIdentities", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of identities for the currently logged in user.", + "responses": { + "200": { + "description": "Identities List", + "schema": { + "$ref": "#\/definitions\/identityList" + } + } + }, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 58, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "accountDeleteIdentity", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 59, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "type": "string", + "x-example": "<IDENTITY_ID>", + "in": "path" + } + ] + } + }, + "\/account\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "accountCreateJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.", + "responses": { + "201": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "x-appwrite": { + "method": "createJWT", + "group": "tokens", + "weight": 30, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/logs": { + "get": { + "summary": "List logs", + "operationId": "accountListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 32, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "accountUpdateMFA", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Enable or disable MFA on an account.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateMFA", + "group": "mfa", + "weight": 45, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-m-f-a.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "default": null, + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + ] + } + }, + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "schema": { + "$ref": "#\/definitions\/mfaType" + } + } + }, + "x-appwrite": { + "method": "createMfaAuthenticator", + "group": "mfa", + "weight": 47, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateMfaAuthenticator", + "group": "mfa", + "weight": 48, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "otp": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<OTP>" + } + }, + "required": [ + "otp" + ] + } + } + ] + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 52, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + } + }, + "\/account\/mfa\/challenge": { + "post": { + "summary": "Create MFA challenge", + "operationId": "accountCreateMfaChallenge", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Challenge", + "schema": { + "$ref": "#\/definitions\/mfaChallenge" + } + } + }, + "x-appwrite": { + "method": "createMfaChallenge", + "group": "mfa", + "weight": 53, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "factor": { + "type": "string", + "description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.", + "default": null, + "x-example": "email", + "enum": [ + "email", + "phone", + "totp", + "recoverycode" + ], + "x-enum-name": "AuthenticationFactor", + "x-enum-keys": [] + } + }, + "required": [ + "factor" + ] + } + } + ] + }, + "put": { + "summary": "Update MFA challenge (confirmation)", + "operationId": "accountUpdateMfaChallenge", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "updateMfaChallenge", + "group": "mfa", + "weight": 54, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},challengeId:{param-challengeId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "challengeId": { + "type": "string", + "description": "ID of the challenge.", + "default": null, + "x-example": "<CHALLENGE_ID>" + }, + "otp": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<OTP>" + } + }, + "required": [ + "challengeId", + "otp" + ] + } + } + ] + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "schema": { + "$ref": "#\/definitions\/mfaFactors" + } + } + }, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 46, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 51, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 49, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 50, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/name": { + "patch": { + "summary": "Update name", + "operationId": "accountUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account name.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "account", + "weight": 33, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + } + }, + "\/account\/password": { + "patch": { + "summary": "Update password", + "operationId": "accountUpdatePassword", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updatePassword", + "group": "account", + "weight": 34, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "default": null, + "x-example": null + }, + "oldPassword": { + "type": "string", + "description": "Current user password. Must be at least 8 chars.", + "default": "", + "x-example": "password" + } + }, + "required": [ + "password" + ] + } + } + ] + } + }, + "\/account\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "accountUpdatePhone", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createPhoneVerification) endpoint to send a confirmation SMS.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updatePhone", + "group": "account", + "weight": 36, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "phone", + "password" + ] + } + } + ] + } + }, + "\/account\/prefs": { + "get": { + "summary": "Get account preferences", + "operationId": "accountGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the preferences as a key-value object for the currently logged in user.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "account", + "weight": 31, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update preferences", + "operationId": "accountUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "account", + "weight": 37, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + }, + "\/account\/recovery": { + "post": { + "summary": "Create password recovery", + "operationId": "accountCreateRecovery", + "consumes": [ + "application\/json" + ], + "produces": [ + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createRecovery", + "group": "recovery", + "weight": 39, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "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.", + "default": null, + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "email", + "url" + ] + } + } + ] + }, + "put": { + "summary": "Update password recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "consumes": [ + "application\/json" + ], + "produces": [ + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/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.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "updateRecovery", + "group": "recovery", + "weight": 40, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid reset token.", + "default": null, + "x-example": "<SECRET>" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "default": null, + "x-example": null + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + ] + } + }, + "\/account\/sessions": { + "get": { + "summary": "List sessions", + "operationId": "accountListSessions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of active sessions across different devices for the currently logged in user.", + "responses": { + "200": { + "description": "Sessions List", + "schema": { + "$ref": "#\/definitions\/sessionList" + } + } + }, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 12, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "delete": { + "summary": "Delete sessions", + "operationId": "accountDeleteSessions", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete all sessions from the user account and remove any sessions cookies from the end client.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 13, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/anonymous": { + "post": { + "summary": "Create anonymous session", + "operationId": "accountCreateAnonymousSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmail) or create an [OAuth2 session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#CreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "createAnonymousSession", + "group": "sessions", + "weight": 18, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-anonymous-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/sessions\/email": { + "post": { + "summary": "Create email password session", + "operationId": "accountCreateEmailPasswordSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "createEmailPasswordSession", + "group": "sessions", + "weight": 17, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-email-password-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},email:{param-email}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/sessions\/magic-url": { + "put": { + "summary": "Update magic URL session", + "operationId": "accountUpdateMagicURLSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "updateMagicURLSession", + "group": "sessions", + "weight": 27, + "cookies": false, + "type": "", + "deprecated": true, + "demo": "account\/update-magic-u-r-l-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 session", + "operationId": "accountCreateOAuth2Session", + "consumes": [], + "produces": [ + "text\/html" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their 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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "301": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "createOAuth2Session", + "group": "sessions", + "weight": 20, + "cookies": false, + "type": "webAuth", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's 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": "", + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's 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": "", + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/sessions\/phone": { + "put": { + "summary": "Update phone session", + "operationId": "accountUpdatePhoneSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "updatePhoneSession", + "group": "sessions", + "weight": 28, + "cookies": false, + "type": "", + "deprecated": true, + "demo": "account\/update-phone-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/token": { + "post": { + "summary": "Create session", + "operationId": "accountCreateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 19, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/{sessionId}": { + "get": { + "summary": "Get session", + "operationId": "accountGetSession", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "getSession", + "group": "sessions", + "weight": 14, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/get-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update session", + "operationId": "accountUpdateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "updateSession", + "group": "sessions", + "weight": 16, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete session", + "operationId": "accountDeleteSession", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#deleteSessions) instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 15, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to delete the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + } + }, + "\/account\/status": { + "patch": { + "summary": "Update status", + "operationId": "accountUpdateStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateStatus", + "group": "account", + "weight": 38, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/targets\/push": { + "post": { + "summary": "Create push target", + "operationId": "accountCreatePushTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", + "responses": { + "201": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "x-appwrite": { + "method": "createPushTarget", + "group": "pushTargets", + "weight": 55, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TARGET_ID>" + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": null, + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "default": "", + "x-example": "<PROVIDER_ID>" + } + }, + "required": [ + "targetId", + "identifier" + ] + } + } + ] + } + }, + "\/account\/targets\/{targetId}\/push": { + "put": { + "summary": "Update push target", + "operationId": "accountUpdatePushTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", + "responses": { + "200": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "x-appwrite": { + "method": "updatePushTarget", + "group": "pushTargets", + "weight": 56, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": null, + "x-example": "<IDENTIFIER>" + } + }, + "required": [ + "identifier" + ] + } + } + ] + }, + "delete": { + "summary": "Delete push target", + "operationId": "accountDeletePushTarget", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deletePushTarget", + "group": "pushTargets", + "weight": 57, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + } + ] + } + }, + "\/account\/tokens\/email": { + "post": { + "summary": "Create email token (OTP)", + "operationId": "accountCreateEmailToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createEmailToken", + "group": "tokens", + "weight": 26, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-email-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "default": false, + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + ] + } + }, + "\/account\/tokens\/magic-url": { + "post": { + "summary": "Create magic URL token", + "operationId": "accountCreateMagicURLToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createMagicURLToken", + "group": "tokens", + "weight": 25, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-magic-u-r-l-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the magic URL login. 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.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "default": false, + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + ] + } + }, + "\/account\/tokens\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 token", + "operationId": "accountCreateOAuth2Token", + "consumes": [], + "produces": [ + "text\/html" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their 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. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "301": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "createOAuth2Token", + "group": "tokens", + "weight": 24, + "cookies": false, + "type": "webAuth", + "deprecated": false, + "demo": "account\/create-o-auth2token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's 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": "", + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's 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": "", + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/tokens\/phone": { + "post": { + "summary": "Create phone token", + "operationId": "accountCreatePhoneToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createPhoneToken", + "group": "tokens", + "weight": 29, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-phone-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},phone:{param-phone}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + } + }, + "required": [ + "userId", + "phone" + ] + } + } + ] + } + }, + "\/account\/verification": { + "post": { + "summary": "Create email verification", + "operationId": "accountCreateVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\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", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createVerification", + "group": "verification", + "weight": 41, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "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.", + "default": null, + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "url" + ] + } + } + ] + }, + "put": { + "summary": "Update email verification (confirmation)", + "operationId": "accountUpdateVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "updateVerification", + "group": "verification", + "weight": 42, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/verification\/phone": { + "post": { + "summary": "Create phone verification", + "operationId": "accountCreatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createPhoneVerification", + "group": "verification", + "weight": 43, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},userId:{userId}", + "url:{url},ip:{ip}" + ], + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "put": { + "summary": "Update phone verification (confirmation)", + "operationId": "accountUpdatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "verification", + "weight": 44, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/avatars\/browsers\/{code}": { + "get": { + "summary": "Get browser icon", + "operationId": "avatarsGetBrowser", + "consumes": [], + "produces": [ + "image\/png" + ], + "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 [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getBrowser", + "group": null, + "weight": 61, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Browser Code.", + "required": true, + "type": "string", + "x-example": "aa", + "enum": [ + "aa", + "an", + "ch", + "ci", + "cm", + "cr", + "ff", + "sf", + "mf", + "ps", + "oi", + "om", + "op", + "on" + ], + "x-enum-name": "Browser", + "x-enum-keys": [ + "Avant Browser", + "Android WebView Beta", + "Google Chrome", + "Google Chrome (iOS)", + "Google Chrome (Mobile)", + "Chromium", + "Mozilla Firefox", + "Safari", + "Mobile Safari", + "Microsoft Edge", + "Microsoft Edge (iOS)", + "Opera Mini", + "Opera", + "Opera (Next)" + ], + "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 keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/credit-cards\/{code}": { + "get": { + "summary": "Get credit card icon", + "operationId": "avatarsGetCreditCard", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getCreditCard", + "group": null, + "weight": 60, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "required": true, + "type": "string", + "x-example": "amex", + "enum": [ + "amex", + "argencard", + "cabal", + "cencosud", + "diners", + "discover", + "elo", + "hipercard", + "jcb", + "mastercard", + "naranja", + "targeta-shopping", + "union-china-pay", + "visa", + "mir", + "maestro", + "rupay" + ], + "x-enum-name": "CreditCard", + "x-enum-keys": [ + "American Express", + "Argencard", + "Cabal", + "Cencosud", + "Diners Club", + "Discover", + "Elo", + "Hipercard", + "JCB", + "Mastercard", + "Naranja", + "Tarjeta Shopping", + "Union China Pay", + "Visa", + "MIR", + "Maestro", + "Rupay" + ], + "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 keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/favicon": { + "get": { + "summary": "Get favicon", + "operationId": "avatarsGetFavicon", + "consumes": [], + "produces": [ + "image\/*" + ], + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getFavicon", + "group": null, + "weight": 64, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "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": "avatarsGetFlag", + "consumes": [], + "produces": [ + "image\/png" + ], + "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. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getFlag", + "group": null, + "weight": 62, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Country Code. ISO Alpha-2 country code format.", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ao", + "al", + "ad", + "ae", + "ar", + "am", + "ag", + "au", + "at", + "az", + "bi", + "be", + "bj", + "bf", + "bd", + "bg", + "bh", + "bs", + "ba", + "by", + "bz", + "bo", + "br", + "bb", + "bn", + "bt", + "bw", + "cf", + "ca", + "ch", + "cl", + "cn", + "ci", + "cm", + "cd", + "cg", + "co", + "km", + "cv", + "cr", + "cu", + "cy", + "cz", + "de", + "dj", + "dm", + "dk", + "do", + "dz", + "ec", + "eg", + "er", + "es", + "ee", + "et", + "fi", + "fj", + "fr", + "fm", + "ga", + "gb", + "ge", + "gh", + "gn", + "gm", + "gw", + "gq", + "gr", + "gd", + "gt", + "gy", + "hn", + "hr", + "ht", + "hu", + "id", + "in", + "ie", + "ir", + "iq", + "is", + "il", + "it", + "jm", + "jo", + "jp", + "kz", + "ke", + "kg", + "kh", + "ki", + "kn", + "kr", + "kw", + "la", + "lb", + "lr", + "ly", + "lc", + "li", + "lk", + "ls", + "lt", + "lu", + "lv", + "ma", + "mc", + "md", + "mg", + "mv", + "mx", + "mh", + "mk", + "ml", + "mt", + "mm", + "me", + "mn", + "mz", + "mr", + "mu", + "mw", + "my", + "na", + "ne", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nz", + "om", + "pk", + "pa", + "pe", + "ph", + "pw", + "pg", + "pl", + "pf", + "kp", + "pt", + "py", + "qa", + "ro", + "ru", + "rw", + "sa", + "sd", + "sn", + "sg", + "sb", + "sl", + "sv", + "sm", + "so", + "rs", + "ss", + "st", + "sr", + "sk", + "si", + "se", + "sz", + "sc", + "sy", + "td", + "tg", + "th", + "tj", + "tm", + "tl", + "to", + "tt", + "tn", + "tr", + "tv", + "tz", + "ug", + "ua", + "uy", + "us", + "uz", + "va", + "vc", + "ve", + "vn", + "vu", + "ws", + "ye", + "za", + "zm", + "zw" + ], + "x-enum-name": "Flag", + "x-enum-keys": [ + "Afghanistan", + "Angola", + "Albania", + "Andorra", + "United Arab Emirates", + "Argentina", + "Armenia", + "Antigua and Barbuda", + "Australia", + "Austria", + "Azerbaijan", + "Burundi", + "Belgium", + "Benin", + "Burkina Faso", + "Bangladesh", + "Bulgaria", + "Bahrain", + "Bahamas", + "Bosnia and Herzegovina", + "Belarus", + "Belize", + "Bolivia", + "Brazil", + "Barbados", + "Brunei Darussalam", + "Bhutan", + "Botswana", + "Central African Republic", + "Canada", + "Switzerland", + "Chile", + "China", + "C\u00f4te d'Ivoire", + "Cameroon", + "Democratic Republic of the Congo", + "Republic of the Congo", + "Colombia", + "Comoros", + "Cape Verde", + "Costa Rica", + "Cuba", + "Cyprus", + "Czech Republic", + "Germany", + "Djibouti", + "Dominica", + "Denmark", + "Dominican Republic", + "Algeria", + "Ecuador", + "Egypt", + "Eritrea", + "Spain", + "Estonia", + "Ethiopia", + "Finland", + "Fiji", + "France", + "Micronesia (Federated States of)", + "Gabon", + "United Kingdom", + "Georgia", + "Ghana", + "Guinea", + "Gambia", + "Guinea-Bissau", + "Equatorial Guinea", + "Greece", + "Grenada", + "Guatemala", + "Guyana", + "Honduras", + "Croatia", + "Haiti", + "Hungary", + "Indonesia", + "India", + "Ireland", + "Iran (Islamic Republic of)", + "Iraq", + "Iceland", + "Israel", + "Italy", + "Jamaica", + "Jordan", + "Japan", + "Kazakhstan", + "Kenya", + "Kyrgyzstan", + "Cambodia", + "Kiribati", + "Saint Kitts and Nevis", + "South Korea", + "Kuwait", + "Lao People's Democratic Republic", + "Lebanon", + "Liberia", + "Libya", + "Saint Lucia", + "Liechtenstein", + "Sri Lanka", + "Lesotho", + "Lithuania", + "Luxembourg", + "Latvia", + "Morocco", + "Monaco", + "Moldova", + "Madagascar", + "Maldives", + "Mexico", + "Marshall Islands", + "North Macedonia", + "Mali", + "Malta", + "Myanmar", + "Montenegro", + "Mongolia", + "Mozambique", + "Mauritania", + "Mauritius", + "Malawi", + "Malaysia", + "Namibia", + "Niger", + "Nigeria", + "Nicaragua", + "Netherlands", + "Norway", + "Nepal", + "Nauru", + "New Zealand", + "Oman", + "Pakistan", + "Panama", + "Peru", + "Philippines", + "Palau", + "Papua New Guinea", + "Poland", + "French Polynesia", + "North Korea", + "Portugal", + "Paraguay", + "Qatar", + "Romania", + "Russia", + "Rwanda", + "Saudi Arabia", + "Sudan", + "Senegal", + "Singapore", + "Solomon Islands", + "Sierra Leone", + "El Salvador", + "San Marino", + "Somalia", + "Serbia", + "South Sudan", + "Sao Tome and Principe", + "Suriname", + "Slovakia", + "Slovenia", + "Sweden", + "Eswatini", + "Seychelles", + "Syria", + "Chad", + "Togo", + "Thailand", + "Tajikistan", + "Turkmenistan", + "Timor-Leste", + "Tonga", + "Trinidad and Tobago", + "Tunisia", + "Turkey", + "Tuvalu", + "Tanzania", + "Uganda", + "Ukraine", + "Uruguay", + "United States", + "Uzbekistan", + "Vatican City", + "Saint Vincent and the Grenadines", + "Venezuela", + "Vietnam", + "Vanuatu", + "Samoa", + "Yemen", + "South Africa", + "Zambia", + "Zimbabwe" + ], + "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 keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/image": { + "get": { + "summary": "Get image from URL", + "operationId": "avatarsGetImage", + "consumes": [], + "produces": [ + "image\/*" + ], + "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getImage", + "group": null, + "weight": 63, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "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. Defaults to 400.", + "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. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400, + "in": "query" + } + ] + } + }, + "\/avatars\/initials": { + "get": { + "summary": "Get user initials", + "operationId": "avatarsGetInitials", + "consumes": [], + "produces": [ + "image\/png" + ], + "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getInitials", + "group": null, + "weight": 66, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "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": "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": "avatarsGetQR", + "consumes": [], + "produces": [ + "image\/png" + ], + "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.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getQR", + "group": null, + "weight": 65, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "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 1 to 1000. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 1, + "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" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "databasesListDocuments", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "listDocuments", + "group": "documents", + "weight": 110, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "createDocument", + "group": "documents", + "weight": 109, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createDocument", + "auth": { + "Admin": [], + "Session": [], + "Key": [], + "JWT": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "<DOCUMENT_ID>" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "databasesGetDocument", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "getDocument", + "group": "documents", + "weight": 111, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert document", + "operationId": "databasesUpsertDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "upsertDocument", + "group": "documents", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include all required attributes of the document to be created or updated.", + "default": {}, + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ] + } + } + ] + }, + "patch": { + "summary": "Update document", + "operationId": "databasesUpdateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "updateDocument", + "group": "documents", + "weight": 113, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete document", + "operationId": "databasesDeleteDocument", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDocument", + "group": "documents", + "weight": 119, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/functions\/{functionId}\/executions": { + "get": { + "summary": "List executions", + "operationId": "functionsListExecutions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "schema": { + "$ref": "#\/definitions\/executionList" + } + } + }, + "x-appwrite": { + "method": "listExecutions", + "group": "executions", + "weight": 394, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-executions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create execution", + "operationId": "functionsCreateExecution", + "consumes": [ + "application\/json" + ], + "produces": [ + "multipart\/form-data" + ], + "tags": [ + "functions" + ], + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "responses": { + "201": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "x-appwrite": { + "method": "createExecution", + "group": "executions", + "weight": 392, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "default": "", + "x-example": "<BODY>" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "default": false, + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "default": "\/", + "x-example": "<PATH>" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is GET.", + "default": "POST", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "object", + "description": "HTTP headers of execution. Defaults to empty.", + "default": [], + "x-example": "{}" + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/functions\/{functionId}\/executions\/{executionId}": { + "get": { + "summary": "Get execution", + "operationId": "functionsGetExecution", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function execution log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "x-appwrite": { + "method": "getExecution", + "group": "executions", + "weight": 393, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "type": "string", + "x-example": "<EXECUTION_ID>", + "in": "path" + } + ] + } + }, + "\/graphql": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlQuery", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "schema": { + "$ref": "#\/definitions\/any" + } + } + }, + "x-appwrite": { + "method": "query", + "group": "graphql", + "weight": 308, + "cookies": false, + "type": "graphql", + "deprecated": false, + "demo": "graphql\/query.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "description": "The query or queries to execute.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "query" + ] + } + } + ] + } + }, + "\/graphql\/mutation": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlMutation", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "schema": { + "$ref": "#\/definitions\/any" + } + } + }, + "x-appwrite": { + "method": "mutation", + "group": "graphql", + "weight": 307, + "cookies": false, + "type": "graphql", + "deprecated": false, + "demo": "graphql\/mutation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "description": "The query or queries to execute.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "query" + ] + } + } + ] + } + }, + "\/locale": { + "get": { + "summary": "Get user locale", + "operationId": "localeGet", + "consumes": [], + "produces": [ + "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))", + "responses": { + "200": { + "description": "Locale", + "schema": { + "$ref": "#\/definitions\/locale" + } + } + }, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 124, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/codes": { + "get": { + "summary": "List locale codes", + "operationId": "localeListCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes).", + "responses": { + "200": { + "description": "Locale codes list", + "schema": { + "$ref": "#\/definitions\/localeCodeList" + } + } + }, + "x-appwrite": { + "method": "listCodes", + "group": null, + "weight": 125, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/continents": { + "get": { + "summary": "List continents", + "operationId": "localeListContinents", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all continents. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Continents List", + "schema": { + "$ref": "#\/definitions\/continentList" + } + } + }, + "x-appwrite": { + "method": "listContinents", + "group": null, + "weight": 129, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-continents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries": { + "get": { + "summary": "List countries", + "operationId": "localeListCountries", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all countries. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "schema": { + "$ref": "#\/definitions\/countryList" + } + } + }, + "x-appwrite": { + "method": "listCountries", + "group": null, + "weight": 126, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/eu": { + "get": { + "summary": "List EU countries", + "operationId": "localeListCountriesEU", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Countries List", + "schema": { + "$ref": "#\/definitions\/countryList" + } + } + }, + "x-appwrite": { + "method": "listCountriesEU", + "group": null, + "weight": 127, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries-e-u.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/phones": { + "get": { + "summary": "List countries phone codes", + "operationId": "localeListCountriesPhones", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Phones List", + "schema": { + "$ref": "#\/definitions\/phoneList" + } + } + }, + "x-appwrite": { + "method": "listCountriesPhones", + "group": null, + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries-phones.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/currencies": { + "get": { + "summary": "List currencies", + "operationId": "localeListCurrencies", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Currencies List", + "schema": { + "$ref": "#\/definitions\/currencyList" + } + } + }, + "x-appwrite": { + "method": "listCurrencies", + "group": null, + "weight": 130, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-currencies.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/locale\/languages": { + "get": { + "summary": "List languages", + "operationId": "localeListLanguages", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Languages List", + "schema": { + "$ref": "#\/definitions\/languageList" + } + } + }, + "x-appwrite": { + "method": "listLanguages", + "group": null, + "weight": 131, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-languages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers": { + "post": { + "summary": "Create subscriber", + "operationId": "messagingCreateSubscriber", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new subscriber.", + "responses": { + "201": { + "description": "Subscriber", + "schema": { + "$ref": "#\/definitions\/subscriber" + } + } + }, + "x-appwrite": { + "method": "createSubscriber", + "group": "subscribers", + "weight": 354, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID to subscribe to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "subscriberId": { + "type": "string", + "description": "Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.", + "default": null, + "x-example": "<SUBSCRIBER_ID>" + }, + "targetId": { + "type": "string", + "description": "Target ID. The target ID to link to the specified Topic ID.", + "default": null, + "x-example": "<TARGET_ID>" + } + }, + "required": [ + "subscriberId", + "targetId" + ] + } + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers\/{subscriberId}": { + "delete": { + "summary": "Delete subscriber", + "operationId": "messagingDeleteSubscriber", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a subscriber by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSubscriber", + "group": "subscribers", + "weight": 358, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "type": "string", + "x-example": "<SUBSCRIBER_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files": { + "get": { + "summary": "List files", + "operationId": "storageListFiles", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a list of all the user files. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Files List", + "schema": { + "$ref": "#\/definitions\/fileList" + } + } + }, + "x-appwrite": { + "method": "listFiles", + "group": "files", + "weight": 214, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create file", + "operationId": "storageCreateFile", + "consumes": [ + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "x-appwrite": { + "method": "createFile", + "group": "files", + "weight": 213, + "cookies": false, + "type": "upload", + "deprecated": false, + "demo": "storage\/create-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "x-upload-id": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "formData" + }, + { + "name": "file", + "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", + "required": true, + "type": "file", + "in": "formData" + }, + { + "name": "permissions", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "x-example": "[\"read(\"any\")\"]", + "in": "formData" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "Get file", + "operationId": "storageGetFile", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.", + "responses": { + "200": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "x-appwrite": { + "method": "getFile", + "group": "files", + "weight": 215, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update file", + "operationId": "storageUpdateFile", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "x-appwrite": { + "method": "updateFile", + "group": "files", + "weight": 220, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/update-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the file", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete file", + "operationId": "storageDeleteFile", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "storage" + ], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteFile", + "group": "files", + "weight": 221, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/delete-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download": { + "get": { + "summary": "Get file for download", + "operationId": "storageGetFileDownload", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "storage" + ], + "description": "Get a 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.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getFileDownload", + "group": "files", + "weight": 217, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/preview": { + "get": { + "summary": "Get file preview", + "operationId": "storageGetFilePreview", + "consumes": [], + "produces": [ + "image\/*" + ], + "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. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getFilePreview", + "group": "files", + "weight": 216, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File 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": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "type": "string", + "x-example": "center", + "enum": [ + "center", + "top-left", + "top", + "top-right", + "left", + "right", + "bottom-left", + "bottom", + "bottom-right" + ], + "x-enum-name": "ImageGravity", + "x-enum-keys": [], + "default": "center", + "in": "query" + }, + { + "name": "quality", + "description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + }, + { + "name": "borderWidth", + "description": "Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "borderColor", + "description": "Preview image border color. Use a valid HEX color, no # is needed for prefix.", + "required": false, + "type": "string", + "default": "", + "in": "query" + }, + { + "name": "borderRadius", + "description": "Preview image border radius in pixels. Pass an integer between 0 to 4000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "opacity", + "description": "Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.", + "required": false, + "type": "number", + "format": "float", + "x-example": 0, + "default": 1, + "in": "query" + }, + { + "name": "rotation", + "description": "Preview image rotation in degrees. Pass an integer between -360 and 360.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -360, + "default": 0, + "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", + "enum": [ + "jpg", + "jpeg", + "png", + "webp", + "heic", + "avif", + "gif" + ], + "x-enum-name": "ImageFormat", + "x-enum-keys": [], + "default": "", + "in": "query" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/view": { + "get": { + "summary": "Get file for view", + "operationId": "storageGetFileView", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getFileView", + "group": "files", + "weight": 218, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/teams": { + "get": { + "summary": "List teams", + "operationId": "teamsList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.", + "responses": { + "200": { + "description": "Teams List", + "schema": { + "$ref": "#\/definitions\/teamList" + } + } + }, + "x-appwrite": { + "method": "list", + "group": "teams", + "weight": 225, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create team", + "operationId": "teamsCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "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. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "x-appwrite": { + "method": "create", + "group": "teams", + "weight": 224, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TEAM_ID>" + }, + "name": { + "type": "string", + "description": "Team name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "roles": { + "type": "array", + "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](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": [ + "owner" + ], + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "teamId", + "name" + ] + } + } + ] + } + }, + "\/teams\/{teamId}": { + "get": { + "summary": "Get team", + "operationId": "teamsGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "teams", + "weight": 226, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update name", + "operationId": "teamsUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Update the team's name by its unique ID.", + "responses": { + "200": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "teams", + "weight": 228, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "New team name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete team", + "operationId": "teamsDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "teams" + ], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "teams", + "weight": 230, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships": { + "get": { + "summary": "List team memberships", + "operationId": "teamsListMemberships", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Memberships List", + "schema": { + "$ref": "#\/definitions\/membershipList" + } + } + }, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 232, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create team membership", + "operationId": "teamsCreateMembership", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", + "responses": { + "201": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "x-appwrite": { + "method": "createMembership", + "group": "memberships", + "weight": 231, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/create-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the new team member.", + "default": "", + "x-example": "email@example.com" + }, + "userId": { + "type": "string", + "description": "ID of the user to be added to a team.", + "default": "", + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "roles": { + "type": "array", + "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](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "name": { + "type": "string", + "description": "Name of the new team member. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "roles" + ] + } + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}": { + "get": { + "summary": "Get team membership", + "operationId": "teamsGetMembership", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "x-appwrite": { + "method": "getMembership", + "group": "memberships", + "weight": 233, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/get-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update membership", + "operationId": "teamsUpdateMembership", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "x-appwrite": { + "method": "updateMembership", + "group": "memberships", + "weight": 234, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "roles": { + "type": "array", + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "roles" + ] + } + } + ] + }, + "delete": { + "summary": "Delete team membership", + "operationId": "teamsDeleteMembership", + "consumes": [ + "application\/json" + ], + "produces": [], + "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 it is not accepted.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMembership", + "group": "memberships", + "weight": 236, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}\/status": { + "patch": { + "summary": "Update team membership status", + "operationId": "teamsUpdateMembershipStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "x-appwrite": { + "method": "updateMembershipStatus", + "group": "memberships", + "weight": 235, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/teams\/{teamId}\/prefs": { + "get": { + "summary": "Get team preferences", + "operationId": "teamsGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getPrefs).", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "teams", + "weight": 227, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update preferences", + "operationId": "teamsUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "teams", + "weight": 229, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + } + }, + "tags": [ + { + "name": "account", + "description": "The Account service allows you to authenticate and manage a user account." + }, + { + "name": "avatars", + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + }, + { + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" + }, + { + "name": "locale", + "description": "The Locale service allows you to customize your app based on your users' location." + }, + { + "name": "health", + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." + }, + { + "name": "projects", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "project", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "storage", + "description": "The Storage service allows you to manage your project files." + }, + { + "name": "teams", + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" + }, + { + "name": "users", + "description": "The Users service allows you to manage your project users." + }, + { + "name": "sites", + "description": "The Sites Service allows you view, create and manage your web applications." + }, + { + "name": "functions", + "description": "The Functions Service allows you view, create and manage your Cloud Functions." + }, + { + "name": "proxy", + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." + }, + { + "name": "graphql", + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." + }, + { + "name": "console", + "description": "The Console service allows you to interact with console relevant informations." + }, + { + "name": "migrations", + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." + }, + { + "name": "messaging", + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." + } + ], + "definitions": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true + }, + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { + "type": "object", + "$ref": "#\/definitions\/document" + }, + "x-example": "" + } + }, + "required": [ + "total", + "documents" + ] + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/session" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sessions" + ] + }, + "identityList": { + "description": "Identities List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of identities documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "identities": { + "type": "array", + "description": "List of identities.", + "items": { + "type": "object", + "$ref": "#\/definitions\/identity" + }, + "x-example": "" + } + }, + "required": [ + "total", + "identities" + ] + }, + "logList": { + "description": "Logs List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of logs documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "logs": { + "type": "array", + "description": "List of logs.", + "items": { + "type": "object", + "$ref": "#\/definitions\/log" + }, + "x-example": "" + } + }, + "required": [ + "total", + "logs" + ] + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { + "type": "object", + "$ref": "#\/definitions\/file" + }, + "x-example": "" + } + }, + "required": [ + "total", + "files" + ] + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { + "type": "object", + "$ref": "#\/definitions\/team" + }, + "x-example": "" + } + }, + "required": [ + "total", + "teams" + ] + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { + "type": "object", + "$ref": "#\/definitions\/membership" + }, + "x-example": "" + } + }, + "required": [ + "total", + "memberships" + ] + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/execution" + }, + "x-example": "" + } + }, + "required": [ + "total", + "executions" + ] + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { + "type": "object", + "$ref": "#\/definitions\/country" + }, + "x-example": "" + } + }, + "required": [ + "total", + "countries" + ] + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { + "type": "object", + "$ref": "#\/definitions\/continent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "continents" + ] + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { + "type": "object", + "$ref": "#\/definitions\/language" + }, + "x-example": "" + } + }, + "required": [ + "total", + "languages" + ] + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { + "type": "object", + "$ref": "#\/definitions\/currency" + }, + "x-example": "" + } + }, + "required": [ + "total", + "currencies" + ] + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { + "type": "object", + "$ref": "#\/definitions\/phone" + }, + "x-example": "" + } + }, + "required": [ + "total", + "phones" + ] + }, + "localeCodeList": { + "description": "Locale codes list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of localeCodes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "localeCodes": { + "type": "array", + "description": "List of localeCodes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/localeCode" + }, + "x-example": "" + } + }, + "required": [ + "total", + "localeCodes" + ] + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, + "$collectionId": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c15117e" + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e" + }, + "$createdAt": { + "type": "string", + "description": "Document creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Document update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Document permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$collectionId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ] + }, + "log": { + "description": "Log", + "type": "object", + "properties": { + "event": { + "type": "string", + "description": "Event name.", + "x-example": "account.sessions.create" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "610fc2f985ee0" + }, + "userEmail": { + "type": "string", + "description": "User Email.", + "x-example": "john@appwrite.io" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "John Doe" + }, + "mode": { + "type": "string", + "description": "API mode when event triggered.", + "x-example": "admin" + }, + "ip": { + "type": "string", + "description": "IP session in use when the session was created.", + "x-example": "127.0.0.1" + }, + "time": { + "type": "string", + "description": "Log creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "event", + "userId", + "userEmail", + "userName", + "mode", + "ip", + "time", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName" + ] + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "User creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "User update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "User name.", + "x-example": "John Doe" + }, + "password": { + "type": "string", + "description": "Hashed user password.", + "x-example": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "x-nullable": true + }, + "hash": { + "type": "string", + "description": "Password hashing algorithm.", + "x-example": "argon2", + "x-nullable": true + }, + "hashOptions": { + "type": "object", + "description": "Password hashing algorithm configuration.", + "x-example": {}, + "items": { + "x-oneOf": [ + { + "$ref": "#\/definitions\/algoArgon2" + }, + { + "$ref": "#\/definitions\/algoScrypt" + }, + { + "$ref": "#\/definitions\/algoScryptModified" + }, + { + "$ref": "#\/definitions\/algoBcrypt" + }, + { + "$ref": "#\/definitions\/algoPhpass" + }, + { + "$ref": "#\/definitions\/algoSha" + }, + { + "$ref": "#\/definitions\/algoMd5" + } + ] + }, + "x-nullable": true + }, + "registration": { + "type": "string", + "description": "User registration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "x-example": true + }, + "labels": { + "type": "array", + "description": "Labels for the user.", + "items": { + "type": "string" + }, + "x-example": [ + "vip" + ] + }, + "passwordUpdate": { + "type": "string", + "description": "Password update time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "email": { + "type": "string", + "description": "User email address.", + "x-example": "john@appwrite.io" + }, + "phone": { + "type": "string", + "description": "User phone number in E.164 format.", + "x-example": "+4930901820" + }, + "emailVerification": { + "type": "boolean", + "description": "Email verification status.", + "x-example": true + }, + "phoneVerification": { + "type": "boolean", + "description": "Phone verification status.", + "x-example": true + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status.", + "x-example": true + }, + "prefs": { + "type": "object", + "description": "User preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/preferences" + } + }, + "targets": { + "type": "array", + "description": "A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.", + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + }, + "x-example": [] + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "registration", + "status", + "labels", + "passwordUpdate", + "email", + "phone", + "emailVerification", + "phoneVerification", + "mfa", + "prefs", + "targets", + "accessedAt" + ] + }, + "algoMd5": { + "description": "AlgoMD5", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "md5" + } + }, + "required": [ + "type" + ] + }, + "algoSha": { + "description": "AlgoSHA", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "sha" + } + }, + "required": [ + "type" + ] + }, + "algoPhpass": { + "description": "AlgoPHPass", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "phpass" + } + }, + "required": [ + "type" + ] + }, + "algoBcrypt": { + "description": "AlgoBcrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "bcrypt" + } + }, + "required": [ + "type" + ] + }, + "algoScrypt": { + "description": "AlgoScrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scrypt" + }, + "costCpu": { + "type": "integer", + "description": "CPU complexity of computed hash.", + "x-example": 8, + "format": "int32" + }, + "costMemory": { + "type": "integer", + "description": "Memory complexity of computed hash.", + "x-example": 14, + "format": "int32" + }, + "costParallel": { + "type": "integer", + "description": "Parallelization of computed hash.", + "x-example": 1, + "format": "int32" + }, + "length": { + "type": "integer", + "description": "Length used to compute hash.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "type", + "costCpu", + "costMemory", + "costParallel", + "length" + ] + }, + "algoScryptModified": { + "description": "AlgoScryptModified", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scryptMod" + }, + "salt": { + "type": "string", + "description": "Salt used to compute hash.", + "x-example": "UxLMreBr6tYyjQ==" + }, + "saltSeparator": { + "type": "string", + "description": "Separator used to compute hash.", + "x-example": "Bw==" + }, + "signerKey": { + "type": "string", + "description": "Key used to compute hash.", + "x-example": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "required": [ + "type", + "salt", + "saltSeparator", + "signerKey" + ] + }, + "algoArgon2": { + "description": "AlgoArgon2", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "argon2" + }, + "memoryCost": { + "type": "integer", + "description": "Memory used to compute hash.", + "x-example": 65536, + "format": "int32" + }, + "timeCost": { + "type": "integer", + "description": "Amount of time consumed to compute hash", + "x-example": 4, + "format": "int32" + }, + "threads": { + "type": "integer", + "description": "Number of threads used to compute hash.", + "x-example": 3, + "format": "int32" + } + }, + "required": [ + "type", + "memoryCost", + "timeCost", + "threads" + ] + }, + "preferences": { + "description": "Preferences", + "type": "object", + "additionalProperties": true + }, + "session": { + "description": "Session", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Session ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Session creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Session update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "expire": { + "type": "string", + "description": "Session expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "Session Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "Session Provider User ID.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "x-example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "x-example": true + }, + "factors": { + "type": "array", + "description": "Returns a list of active session factors.", + "items": { + "type": "string" + }, + "x-example": [ + "email" + ] + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate the user. Only included if the request was made with an API key", + "x-example": "5e5bb8c16897e" + }, + "mfaUpdatedAt": { + "type": "string", + "description": "Most recent date in ISO 8601 format when the session successfully passed MFA challenge.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "ip", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName", + "current", + "factors", + "secret", + "mfaUpdatedAt" + ] + }, + "identity": { + "description": "Identity", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Identity ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Identity creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Identity update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "provider": { + "type": "string", + "description": "Identity Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "ID of the User in the Identity Provider.", + "x-example": "5e5bb8c16897e" + }, + "providerEmail": { + "type": "string", + "description": "Email of the User in the Identity Provider.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Identity Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Identity Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "provider", + "providerUid", + "providerEmail", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken" + ] + }, + "token": { + "description": "Token", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "secret": { + "type": "string", + "description": "Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "phrase": { + "type": "string", + "description": "Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.", + "x-example": "Golden Fox" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "secret", + "expire", + "phrase" + ] + }, + "jwt": { + "description": "JWT", + "type": "object", + "properties": { + "jwt": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "required": [ + "jwt" + ] + }, + "locale": { + "description": "Locale", + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "User IP address.", + "x-example": "127.0.0.1" + }, + "countryCode": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format", + "x-example": "US" + }, + "country": { + "type": "string", + "description": "Country name. This field support localization.", + "x-example": "United States" + }, + "continentCode": { + "type": "string", + "description": "Continent code. A two character continent code \"AF\" for Africa, \"AN\" for Antarctica, \"AS\" for Asia, \"EU\" for Europe, \"NA\" for North America, \"OC\" for Oceania, and \"SA\" for South America.", + "x-example": "NA" + }, + "continent": { + "type": "string", + "description": "Continent name. This field support localization.", + "x-example": "North America" + }, + "eu": { + "type": "boolean", + "description": "True if country is part of the European Union.", + "x-example": false + }, + "currency": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format", + "x-example": "USD" + } + }, + "required": [ + "ip", + "countryCode", + "country", + "continentCode", + "continent", + "eu", + "currency" + ] + }, + "localeCode": { + "description": "LocaleCode", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes)", + "x-example": "en-us" + }, + "name": { + "type": "string", + "description": "Locale name", + "x-example": "US" + } + }, + "required": [ + "code", + "name" + ] + }, + "file": { + "description": "File", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "File ID.", + "x-example": "5e5ea5c16897e" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "File creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "File update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "File permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "name": { + "type": "string", + "description": "File name.", + "x-example": "Pink.png" + }, + "signature": { + "type": "string", + "description": "File MD5 signature.", + "x-example": "5d529fd02b544198ae075bd57c1762bb" + }, + "mimeType": { + "type": "string", + "description": "File mime type.", + "x-example": "image\/png" + }, + "sizeOriginal": { + "type": "integer", + "description": "File original size in bytes.", + "x-example": 17890, + "format": "int32" + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "x-example": 17890, + "format": "int32" + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "x-example": 17890, + "format": "int32" + } + }, + "required": [ + "$id", + "bucketId", + "$createdAt", + "$updatedAt", + "$permissions", + "name", + "signature", + "mimeType", + "sizeOriginal", + "chunksTotal", + "chunksUploaded" + ] + }, + "team": { + "description": "Team", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Team creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Team update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "x-example": 7, + "format": "int32" + }, + "prefs": { + "type": "object", + "description": "Team preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/preferences" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "total", + "prefs" + ] + }, + "membership": { + "description": "Membership", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Membership ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Membership creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Membership update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "John Doe" + }, + "userEmail": { + "type": "string", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "john@appwrite.io" + }, + "teamId": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "teamName": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "invited": { + "type": "string", + "description": "Date, the user has been invited to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "joined": { + "type": "string", + "description": "Date, the user has accepted the invitation to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "confirm": { + "type": "boolean", + "description": "User confirmation status, true if the user has joined the team or false otherwise.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", + "x-example": false + }, + "roles": { + "type": "array", + "description": "User list of roles", + "items": { + "type": "string" + }, + "x-example": [ + "owner" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "userName", + "userEmail", + "teamId", + "teamName", + "invited", + "joined", + "confirm", + "mfa", + "roles" + ] + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Execution creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Execution upate date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Execution roles.", + "items": { + "type": "string" + }, + "x-example": [ + "any" + ] + }, + "functionId": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea6g16897e" + }, + "trigger": { + "type": "string", + "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", + "x-example": "http" + }, + "status": { + "type": "string", + "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", + "x-example": "processing" + }, + "requestMethod": { + "type": "string", + "description": "HTTP request method type.", + "x-example": "GET" + }, + "requestPath": { + "type": "string", + "description": "HTTP request path and query.", + "x-example": "\/articles?id=5" + }, + "requestHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "type": "object", + "$ref": "#\/definitions\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "responseStatusCode": { + "type": "integer", + "description": "HTTP response status code.", + "x-example": 200, + "format": "int32" + }, + "responseBody": { + "type": "string", + "description": "HTTP response body. This will return empty unless execution is created as synchronous.", + "x-example": "" + }, + "responseHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "type": "object", + "$ref": "#\/definitions\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "logs": { + "type": "string", + "description": "Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "errors": { + "type": "string", + "description": "Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "duration": { + "type": "number", + "description": "Resource(function\/site) execution duration in seconds.", + "x-example": 0.4, + "format": "double" + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for execution. If left empty, execution will be queued immediately.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "functionId", + "trigger", + "status", + "requestMethod", + "requestPath", + "requestHeaders", + "responseStatusCode", + "responseBody", + "responseHeaders", + "logs", + "errors", + "duration" + ] + }, + "country": { + "description": "Country", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "code": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + } + }, + "required": [ + "name", + "code" + ] + }, + "continent": { + "description": "Continent", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Continent name.", + "x-example": "Europe" + }, + "code": { + "type": "string", + "description": "Continent two letter code.", + "x-example": "EU" + } + }, + "required": [ + "name", + "code" + ] + }, + "language": { + "description": "Language", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Language name.", + "x-example": "Italian" + }, + "code": { + "type": "string", + "description": "Language two-character ISO 639-1 codes.", + "x-example": "it" + }, + "nativeName": { + "type": "string", + "description": "Language native name.", + "x-example": "Italiano" + } + }, + "required": [ + "name", + "code", + "nativeName" + ] + }, + "currency": { + "description": "Currency", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Currency symbol.", + "x-example": "$" + }, + "name": { + "type": "string", + "description": "Currency name.", + "x-example": "US dollar" + }, + "symbolNative": { + "type": "string", + "description": "Currency native symbol.", + "x-example": "$" + }, + "decimalDigits": { + "type": "integer", + "description": "Number of decimal digits.", + "x-example": 2, + "format": "int32" + }, + "rounding": { + "type": "number", + "description": "Currency digit rounding.", + "x-example": 0, + "format": "double" + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.", + "x-example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "x-example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ] + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "x-example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "code", + "countryCode", + "countryName" + ] + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "x-example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "x-example": "application\/json" + } + }, + "required": [ + "name", + "value" + ] + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ] + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "x-example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ] + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "x-example": true + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "x-example": true + } + }, + "required": [ + "secret", + "uri" + ] + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "x-example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "x-example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "x-example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "x-example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode" + ] + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "x-example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + } + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ] + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "x-example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "x-example": "259125845563242502", + "x-nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ] + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file diff --git a/app/config/specs/swagger2-1.8.x-console.json b/app/config/specs/swagger2-1.8.x-console.json new file mode 100644 index 0000000000..a11fd21b42 --- /dev/null +++ b/app/config/specs/swagger2-1.8.x-console.json @@ -0,0 +1,44339 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.7.4", + "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@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "host": "cloud.appwrite.io", + "x-host-docs": "<REGION>.cloud.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", + "x-appwrite": { + "demo": "<YOUR_PROJECT_ID>" + } + }, + "Key": { + "type": "apiKey", + "name": "X-Appwrite-Key", + "description": "Your secret API key", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_API_KEY>" + } + }, + "JWT": { + "type": "apiKey", + "name": "X-Appwrite-JWT", + "description": "Your secret JSON Web Token", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_JWT>" + } + }, + "Locale": { + "type": "apiKey", + "name": "X-Appwrite-Locale", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "en" + } + }, + "Mode": { + "type": "apiKey", + "name": "X-Appwrite-Mode", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "" + } + } + }, + "paths": { + "\/account": { + "get": { + "summary": "Get account", + "operationId": "accountGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the currently logged in user.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "account", + "weight": 10, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create account", + "operationId": "accountCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailSession).", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "create", + "group": "account", + "weight": 9, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "default": null, + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + }, + "delete": { + "summary": "Delete account", + "operationId": "accountDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete the currently logged in user.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "account", + "weight": 11, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/email": { + "patch": { + "summary": "Update email", + "operationId": "accountUpdateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateEmail", + "group": "account", + "weight": 35, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/identities": { + "get": { + "summary": "List identities", + "operationId": "accountListIdentities", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of identities for the currently logged in user.", + "responses": { + "200": { + "description": "Identities List", + "schema": { + "$ref": "#\/definitions\/identityList" + } + } + }, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 58, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "accountDeleteIdentity", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 59, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "type": "string", + "x-example": "<IDENTITY_ID>", + "in": "path" + } + ] + } + }, + "\/account\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "accountCreateJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.", + "responses": { + "201": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "x-appwrite": { + "method": "createJWT", + "group": "tokens", + "weight": 30, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/logs": { + "get": { + "summary": "List logs", + "operationId": "accountListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 32, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "accountUpdateMFA", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Enable or disable MFA on an account.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateMFA", + "group": "mfa", + "weight": 45, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-m-f-a.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "default": null, + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + ] + } + }, + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "schema": { + "$ref": "#\/definitions\/mfaType" + } + } + }, + "x-appwrite": { + "method": "createMfaAuthenticator", + "group": "mfa", + "weight": 47, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateMfaAuthenticator", + "group": "mfa", + "weight": 48, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "otp": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<OTP>" + } + }, + "required": [ + "otp" + ] + } + } + ] + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 52, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + } + }, + "\/account\/mfa\/challenge": { + "post": { + "summary": "Create MFA challenge", + "operationId": "accountCreateMfaChallenge", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Challenge", + "schema": { + "$ref": "#\/definitions\/mfaChallenge" + } + } + }, + "x-appwrite": { + "method": "createMfaChallenge", + "group": "mfa", + "weight": 53, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "factor": { + "type": "string", + "description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.", + "default": null, + "x-example": "email", + "enum": [ + "email", + "phone", + "totp", + "recoverycode" + ], + "x-enum-name": "AuthenticationFactor", + "x-enum-keys": [] + } + }, + "required": [ + "factor" + ] + } + } + ] + }, + "put": { + "summary": "Update MFA challenge (confirmation)", + "operationId": "accountUpdateMfaChallenge", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "updateMfaChallenge", + "group": "mfa", + "weight": 54, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},challengeId:{param-challengeId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "challengeId": { + "type": "string", + "description": "ID of the challenge.", + "default": null, + "x-example": "<CHALLENGE_ID>" + }, + "otp": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<OTP>" + } + }, + "required": [ + "challengeId", + "otp" + ] + } + } + ] + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "schema": { + "$ref": "#\/definitions\/mfaFactors" + } + } + }, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 46, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 51, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 49, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 50, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/name": { + "patch": { + "summary": "Update name", + "operationId": "accountUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account name.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "account", + "weight": 33, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + } + }, + "\/account\/password": { + "patch": { + "summary": "Update password", + "operationId": "accountUpdatePassword", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updatePassword", + "group": "account", + "weight": 34, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "default": null, + "x-example": null + }, + "oldPassword": { + "type": "string", + "description": "Current user password. Must be at least 8 chars.", + "default": "", + "x-example": "password" + } + }, + "required": [ + "password" + ] + } + } + ] + } + }, + "\/account\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "accountUpdatePhone", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createPhoneVerification) endpoint to send a confirmation SMS.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updatePhone", + "group": "account", + "weight": 36, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "phone", + "password" + ] + } + } + ] + } + }, + "\/account\/prefs": { + "get": { + "summary": "Get account preferences", + "operationId": "accountGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the preferences as a key-value object for the currently logged in user.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "account", + "weight": 31, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update preferences", + "operationId": "accountUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "account", + "weight": 37, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + }, + "\/account\/recovery": { + "post": { + "summary": "Create password recovery", + "operationId": "accountCreateRecovery", + "consumes": [ + "application\/json" + ], + "produces": [ + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createRecovery", + "group": "recovery", + "weight": 39, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "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.", + "default": null, + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "email", + "url" + ] + } + } + ] + }, + "put": { + "summary": "Update password recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "consumes": [ + "application\/json" + ], + "produces": [ + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/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.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "updateRecovery", + "group": "recovery", + "weight": 40, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid reset token.", + "default": null, + "x-example": "<SECRET>" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "default": null, + "x-example": null + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + ] + } + }, + "\/account\/sessions": { + "get": { + "summary": "List sessions", + "operationId": "accountListSessions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of active sessions across different devices for the currently logged in user.", + "responses": { + "200": { + "description": "Sessions List", + "schema": { + "$ref": "#\/definitions\/sessionList" + } + } + }, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 12, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "delete": { + "summary": "Delete sessions", + "operationId": "accountDeleteSessions", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete all sessions from the user account and remove any sessions cookies from the end client.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 13, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/anonymous": { + "post": { + "summary": "Create anonymous session", + "operationId": "accountCreateAnonymousSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmail) or create an [OAuth2 session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#CreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "createAnonymousSession", + "group": "sessions", + "weight": 18, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-anonymous-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/sessions\/email": { + "post": { + "summary": "Create email password session", + "operationId": "accountCreateEmailPasswordSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "createEmailPasswordSession", + "group": "sessions", + "weight": 17, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-email-password-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},email:{param-email}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/sessions\/magic-url": { + "put": { + "summary": "Update magic URL session", + "operationId": "accountUpdateMagicURLSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "updateMagicURLSession", + "group": "sessions", + "weight": 27, + "cookies": false, + "type": "", + "deprecated": true, + "demo": "account\/update-magic-u-r-l-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 session", + "operationId": "accountCreateOAuth2Session", + "consumes": [], + "produces": [ + "text\/html" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their 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.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "301": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "createOAuth2Session", + "group": "sessions", + "weight": 20, + "cookies": false, + "type": "webAuth", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's 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": "", + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's 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": "", + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/sessions\/phone": { + "put": { + "summary": "Update phone session", + "operationId": "accountUpdatePhoneSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "updatePhoneSession", + "group": "sessions", + "weight": 28, + "cookies": false, + "type": "", + "deprecated": true, + "demo": "account\/update-phone-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/token": { + "post": { + "summary": "Create session", + "operationId": "accountCreateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 19, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/{sessionId}": { + "get": { + "summary": "Get session", + "operationId": "accountGetSession", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "getSession", + "group": "sessions", + "weight": 14, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/get-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update session", + "operationId": "accountUpdateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "updateSession", + "group": "sessions", + "weight": 16, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete session", + "operationId": "accountDeleteSession", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#deleteSessions) instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 15, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to delete the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + } + }, + "\/account\/status": { + "patch": { + "summary": "Update status", + "operationId": "accountUpdateStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateStatus", + "group": "account", + "weight": 38, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + } + }, + "\/account\/targets\/push": { + "post": { + "summary": "Create push target", + "operationId": "accountCreatePushTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.", + "responses": { + "201": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "x-appwrite": { + "method": "createPushTarget", + "group": "pushTargets", + "weight": 55, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TARGET_ID>" + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": null, + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "default": "", + "x-example": "<PROVIDER_ID>" + } + }, + "required": [ + "targetId", + "identifier" + ] + } + } + ] + } + }, + "\/account\/targets\/{targetId}\/push": { + "put": { + "summary": "Update push target", + "operationId": "accountUpdatePushTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update the currently logged in user's push notification target. You can modify the target's identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.", + "responses": { + "200": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "x-appwrite": { + "method": "updatePushTarget", + "group": "pushTargets", + "weight": 56, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": null, + "x-example": "<IDENTIFIER>" + } + }, + "required": [ + "identifier" + ] + } + } + ] + }, + "delete": { + "summary": "Delete push target", + "operationId": "accountDeletePushTarget", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deletePushTarget", + "group": "pushTargets", + "weight": 57, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-push-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-push-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + } + ] + } + }, + "\/account\/tokens\/email": { + "post": { + "summary": "Create email token (OTP)", + "operationId": "accountCreateEmailToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createEmailToken", + "group": "tokens", + "weight": 26, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-email-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "default": false, + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + ] + } + }, + "\/account\/tokens\/magic-url": { + "post": { + "summary": "Create magic URL token", + "operationId": "accountCreateMagicURLToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createMagicURLToken", + "group": "tokens", + "weight": 25, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-magic-u-r-l-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the magic URL login. 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.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "default": false, + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + ] + } + }, + "\/account\/tokens\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 token", + "operationId": "accountCreateOAuth2Token", + "consumes": [], + "produces": [ + "text\/html" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their 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. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "301": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "createOAuth2Token", + "group": "tokens", + "weight": 24, + "cookies": false, + "type": "webAuth", + "deprecated": false, + "demo": "account\/create-o-auth2token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's 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": "", + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's 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": "", + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/tokens\/phone": { + "post": { + "summary": "Create phone token", + "operationId": "accountCreatePhoneToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createPhoneToken", + "group": "tokens", + "weight": 29, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-phone-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},phone:{param-phone}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + } + }, + "required": [ + "userId", + "phone" + ] + } + } + ] + } + }, + "\/account\/verification": { + "post": { + "summary": "Create email verification", + "operationId": "accountCreateVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\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", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createVerification", + "group": "verification", + "weight": 41, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "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.", + "default": null, + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "url" + ] + } + } + ] + }, + "put": { + "summary": "Update email verification (confirmation)", + "operationId": "accountUpdateVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "updateVerification", + "group": "verification", + "weight": 42, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/verification\/phone": { + "post": { + "summary": "Create phone verification", + "operationId": "accountCreatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createPhoneVerification", + "group": "verification", + "weight": 43, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},userId:{userId}", + "url:{url},ip:{ip}" + ], + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ] + }, + "put": { + "summary": "Update phone verification (confirmation)", + "operationId": "accountUpdatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "verification", + "weight": 44, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/avatars\/browsers\/{code}": { + "get": { + "summary": "Get browser icon", + "operationId": "avatarsGetBrowser", + "consumes": [], + "produces": [ + "image\/png" + ], + "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 [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getBrowser", + "group": null, + "weight": 61, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Browser Code.", + "required": true, + "type": "string", + "x-example": "aa", + "enum": [ + "aa", + "an", + "ch", + "ci", + "cm", + "cr", + "ff", + "sf", + "mf", + "ps", + "oi", + "om", + "op", + "on" + ], + "x-enum-name": "Browser", + "x-enum-keys": [ + "Avant Browser", + "Android WebView Beta", + "Google Chrome", + "Google Chrome (iOS)", + "Google Chrome (Mobile)", + "Chromium", + "Mozilla Firefox", + "Safari", + "Mobile Safari", + "Microsoft Edge", + "Microsoft Edge (iOS)", + "Opera Mini", + "Opera", + "Opera (Next)" + ], + "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 keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/credit-cards\/{code}": { + "get": { + "summary": "Get credit card icon", + "operationId": "avatarsGetCreditCard", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getCreditCard", + "group": null, + "weight": 60, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "required": true, + "type": "string", + "x-example": "amex", + "enum": [ + "amex", + "argencard", + "cabal", + "cencosud", + "diners", + "discover", + "elo", + "hipercard", + "jcb", + "mastercard", + "naranja", + "targeta-shopping", + "union-china-pay", + "visa", + "mir", + "maestro", + "rupay" + ], + "x-enum-name": "CreditCard", + "x-enum-keys": [ + "American Express", + "Argencard", + "Cabal", + "Cencosud", + "Diners Club", + "Discover", + "Elo", + "Hipercard", + "JCB", + "Mastercard", + "Naranja", + "Tarjeta Shopping", + "Union China Pay", + "Visa", + "MIR", + "Maestro", + "Rupay" + ], + "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 keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/favicon": { + "get": { + "summary": "Get favicon", + "operationId": "avatarsGetFavicon", + "consumes": [], + "produces": [ + "image\/*" + ], + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getFavicon", + "group": null, + "weight": 64, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "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": "avatarsGetFlag", + "consumes": [], + "produces": [ + "image\/png" + ], + "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. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getFlag", + "group": null, + "weight": 62, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Country Code. ISO Alpha-2 country code format.", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ao", + "al", + "ad", + "ae", + "ar", + "am", + "ag", + "au", + "at", + "az", + "bi", + "be", + "bj", + "bf", + "bd", + "bg", + "bh", + "bs", + "ba", + "by", + "bz", + "bo", + "br", + "bb", + "bn", + "bt", + "bw", + "cf", + "ca", + "ch", + "cl", + "cn", + "ci", + "cm", + "cd", + "cg", + "co", + "km", + "cv", + "cr", + "cu", + "cy", + "cz", + "de", + "dj", + "dm", + "dk", + "do", + "dz", + "ec", + "eg", + "er", + "es", + "ee", + "et", + "fi", + "fj", + "fr", + "fm", + "ga", + "gb", + "ge", + "gh", + "gn", + "gm", + "gw", + "gq", + "gr", + "gd", + "gt", + "gy", + "hn", + "hr", + "ht", + "hu", + "id", + "in", + "ie", + "ir", + "iq", + "is", + "il", + "it", + "jm", + "jo", + "jp", + "kz", + "ke", + "kg", + "kh", + "ki", + "kn", + "kr", + "kw", + "la", + "lb", + "lr", + "ly", + "lc", + "li", + "lk", + "ls", + "lt", + "lu", + "lv", + "ma", + "mc", + "md", + "mg", + "mv", + "mx", + "mh", + "mk", + "ml", + "mt", + "mm", + "me", + "mn", + "mz", + "mr", + "mu", + "mw", + "my", + "na", + "ne", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nz", + "om", + "pk", + "pa", + "pe", + "ph", + "pw", + "pg", + "pl", + "pf", + "kp", + "pt", + "py", + "qa", + "ro", + "ru", + "rw", + "sa", + "sd", + "sn", + "sg", + "sb", + "sl", + "sv", + "sm", + "so", + "rs", + "ss", + "st", + "sr", + "sk", + "si", + "se", + "sz", + "sc", + "sy", + "td", + "tg", + "th", + "tj", + "tm", + "tl", + "to", + "tt", + "tn", + "tr", + "tv", + "tz", + "ug", + "ua", + "uy", + "us", + "uz", + "va", + "vc", + "ve", + "vn", + "vu", + "ws", + "ye", + "za", + "zm", + "zw" + ], + "x-enum-name": "Flag", + "x-enum-keys": [ + "Afghanistan", + "Angola", + "Albania", + "Andorra", + "United Arab Emirates", + "Argentina", + "Armenia", + "Antigua and Barbuda", + "Australia", + "Austria", + "Azerbaijan", + "Burundi", + "Belgium", + "Benin", + "Burkina Faso", + "Bangladesh", + "Bulgaria", + "Bahrain", + "Bahamas", + "Bosnia and Herzegovina", + "Belarus", + "Belize", + "Bolivia", + "Brazil", + "Barbados", + "Brunei Darussalam", + "Bhutan", + "Botswana", + "Central African Republic", + "Canada", + "Switzerland", + "Chile", + "China", + "C\u00f4te d'Ivoire", + "Cameroon", + "Democratic Republic of the Congo", + "Republic of the Congo", + "Colombia", + "Comoros", + "Cape Verde", + "Costa Rica", + "Cuba", + "Cyprus", + "Czech Republic", + "Germany", + "Djibouti", + "Dominica", + "Denmark", + "Dominican Republic", + "Algeria", + "Ecuador", + "Egypt", + "Eritrea", + "Spain", + "Estonia", + "Ethiopia", + "Finland", + "Fiji", + "France", + "Micronesia (Federated States of)", + "Gabon", + "United Kingdom", + "Georgia", + "Ghana", + "Guinea", + "Gambia", + "Guinea-Bissau", + "Equatorial Guinea", + "Greece", + "Grenada", + "Guatemala", + "Guyana", + "Honduras", + "Croatia", + "Haiti", + "Hungary", + "Indonesia", + "India", + "Ireland", + "Iran (Islamic Republic of)", + "Iraq", + "Iceland", + "Israel", + "Italy", + "Jamaica", + "Jordan", + "Japan", + "Kazakhstan", + "Kenya", + "Kyrgyzstan", + "Cambodia", + "Kiribati", + "Saint Kitts and Nevis", + "South Korea", + "Kuwait", + "Lao People's Democratic Republic", + "Lebanon", + "Liberia", + "Libya", + "Saint Lucia", + "Liechtenstein", + "Sri Lanka", + "Lesotho", + "Lithuania", + "Luxembourg", + "Latvia", + "Morocco", + "Monaco", + "Moldova", + "Madagascar", + "Maldives", + "Mexico", + "Marshall Islands", + "North Macedonia", + "Mali", + "Malta", + "Myanmar", + "Montenegro", + "Mongolia", + "Mozambique", + "Mauritania", + "Mauritius", + "Malawi", + "Malaysia", + "Namibia", + "Niger", + "Nigeria", + "Nicaragua", + "Netherlands", + "Norway", + "Nepal", + "Nauru", + "New Zealand", + "Oman", + "Pakistan", + "Panama", + "Peru", + "Philippines", + "Palau", + "Papua New Guinea", + "Poland", + "French Polynesia", + "North Korea", + "Portugal", + "Paraguay", + "Qatar", + "Romania", + "Russia", + "Rwanda", + "Saudi Arabia", + "Sudan", + "Senegal", + "Singapore", + "Solomon Islands", + "Sierra Leone", + "El Salvador", + "San Marino", + "Somalia", + "Serbia", + "South Sudan", + "Sao Tome and Principe", + "Suriname", + "Slovakia", + "Slovenia", + "Sweden", + "Eswatini", + "Seychelles", + "Syria", + "Chad", + "Togo", + "Thailand", + "Tajikistan", + "Turkmenistan", + "Timor-Leste", + "Tonga", + "Trinidad and Tobago", + "Tunisia", + "Turkey", + "Tuvalu", + "Tanzania", + "Uganda", + "Ukraine", + "Uruguay", + "United States", + "Uzbekistan", + "Vatican City", + "Saint Vincent and the Grenadines", + "Venezuela", + "Vietnam", + "Vanuatu", + "Samoa", + "Yemen", + "South Africa", + "Zambia", + "Zimbabwe" + ], + "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 keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/image": { + "get": { + "summary": "Get image from URL", + "operationId": "avatarsGetImage", + "consumes": [], + "produces": [ + "image\/*" + ], + "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getImage", + "group": null, + "weight": 63, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "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. Defaults to 400.", + "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. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400, + "in": "query" + } + ] + } + }, + "\/avatars\/initials": { + "get": { + "summary": "Get user initials", + "operationId": "avatarsGetInitials", + "consumes": [], + "produces": [ + "image\/png" + ], + "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getInitials", + "group": null, + "weight": 66, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "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": "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": "avatarsGetQR", + "consumes": [], + "produces": [ + "image\/png" + ], + "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.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getQR", + "group": null, + "weight": 65, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "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 1 to 1000. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 1, + "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" + } + ] + } + }, + "\/console\/assistant": { + "post": { + "summary": "Create assistant query", + "operationId": "assistantChat", + "consumes": [ + "application\/json" + ], + "produces": [ + "text\/plain" + ], + "tags": [ + "assistant" + ], + "description": "Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite's AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream. ", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "chat", + "group": "console", + "weight": 310, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "assistant\/chat.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/assistant\/chat.md", + "rate-limit": 15, + "rate-time": 3600, + "rate-key": "userId:{userId}", + "scope": "assistant.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prompt": { + "type": "string", + "description": "Prompt. A string containing questions asked to the AI assistant.", + "default": null, + "x-example": "<PROMPT>" + } + }, + "required": [ + "prompt" + ] + } + } + ] + } + }, + "\/console\/resources": { + "get": { + "summary": "Check resource ID availability", + "operationId": "consoleGetResource", + "consumes": [], + "produces": [], + "tags": [ + "console" + ], + "description": "Check if a resource ID is available.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "getResource", + "group": null, + "weight": 434, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "console\/get-resource.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCheck if a resource ID is available.", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "value", + "description": "Resource value.", + "required": true, + "type": "string", + "x-example": "<VALUE>", + "in": "query" + }, + { + "name": "type", + "description": "Resource type.", + "required": true, + "type": "string", + "x-example": "rules", + "enum": [ + "rules" + ], + "x-enum-name": "ConsoleResourceType", + "x-enum-keys": [], + "in": "query" + } + ] + } + }, + "\/console\/variables": { + "get": { + "summary": "Get variables", + "operationId": "consoleVariables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "console" + ], + "description": "Get all Environment Variables that are relevant for the console.", + "responses": { + "200": { + "description": "Console Variables", + "schema": { + "$ref": "#\/definitions\/consoleVariables" + } + } + }, + "x-appwrite": { + "method": "variables", + "group": "console", + "weight": 309, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "console\/variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/console\/variables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/databases": { + "get": { + "summary": "List databases", + "operationId": "databasesList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "schema": { + "$ref": "#\/definitions\/databaseList" + } + } + }, + "x-appwrite": { + "method": "list", + "group": "databases", + "weight": 71, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "databasesCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "x-appwrite": { + "method": "create", + "group": "databases", + "weight": 70, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<DATABASE_ID>" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + ] + } + }, + "\/databases\/usage": { + "get": { + "summary": "Get databases usage stats", + "operationId": "databasesGetUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabases", + "schema": { + "$ref": "#\/definitions\/usageDatabases" + } + } + }, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 121, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "`Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "DatabaseUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "databasesGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "databases", + "weight": 72, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "databasesUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "x-appwrite": { + "method": "update", + "group": "databases", + "weight": 74, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete database", + "operationId": "databasesDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "databases", + "weight": 75, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections": { + "get": { + "summary": "List collections", + "operationId": "databasesListCollections", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Collections List", + "schema": { + "$ref": "#\/definitions\/collectionList" + } + } + }, + "x-appwrite": { + "method": "listCollections", + "group": "collections", + "weight": 77, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-collections.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create collection", + "operationId": "databasesCreateCollection", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Collection", + "schema": { + "$ref": "#\/definitions\/collection" + } + } + }, + "x-appwrite": { + "method": "createCollection", + "group": "collections", + "weight": 76, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "collectionId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<COLLECTION_ID>" + }, + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "collectionId", + "name" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}": { + "get": { + "summary": "Get collection", + "operationId": "databasesGetCollection", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.", + "responses": { + "200": { + "description": "Collection", + "schema": { + "$ref": "#\/definitions\/collection" + } + } + }, + "x-appwrite": { + "method": "getCollection", + "group": "collections", + "weight": 78, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update collection", + "operationId": "databasesUpdateCollection", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a collection by its unique ID.", + "responses": { + "200": { + "description": "Collection", + "schema": { + "$ref": "#\/definitions\/collection" + } + } + }, + "x-appwrite": { + "method": "updateCollection", + "group": "collections", + "weight": 80, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete collection", + "operationId": "databasesDeleteCollection", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteCollection", + "group": "collections", + "weight": 81, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes": { + "get": { + "summary": "List attributes", + "operationId": "databasesListAttributes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "List attributes in the collection.", + "responses": { + "200": { + "description": "Attributes List", + "schema": { + "$ref": "#\/definitions\/attributeList" + } + } + }, + "x-appwrite": { + "method": "listAttributes", + "group": "attributes", + "weight": 92, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-attributes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean": { + "post": { + "summary": "Create boolean attribute", + "operationId": "databasesCreateBooleanAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a boolean attribute.\n", + "responses": { + "202": { + "description": "AttributeBoolean", + "schema": { + "$ref": "#\/definitions\/attributeBoolean" + } + } + }, + "x-appwrite": { + "method": "createBooleanAttribute", + "group": "attributes", + "weight": 89, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean\/{key}": { + "patch": { + "summary": "Update boolean attribute", + "operationId": "databasesUpdateBooleanAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a boolean attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeBoolean", + "schema": { + "$ref": "#\/definitions\/attributeBoolean" + } + } + }, + "x-appwrite": { + "method": "updateBooleanAttribute", + "group": "attributes", + "weight": 101, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime": { + "post": { + "summary": "Create datetime attribute", + "operationId": "databasesCreateDatetimeAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a date time attribute according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "AttributeDatetime", + "schema": { + "$ref": "#\/definitions\/attributeDatetime" + } + } + }, + "x-appwrite": { + "method": "createDatetimeAttribute", + "group": "attributes", + "weight": 90, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime\/{key}": { + "patch": { + "summary": "Update dateTime attribute", + "operationId": "databasesUpdateDatetimeAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a date time attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeDatetime", + "schema": { + "$ref": "#\/definitions\/attributeDatetime" + } + } + }, + "x-appwrite": { + "method": "updateDatetimeAttribute", + "group": "attributes", + "weight": 102, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email": { + "post": { + "summary": "Create email attribute", + "operationId": "databasesCreateEmailAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create an email attribute.\n", + "responses": { + "202": { + "description": "AttributeEmail", + "schema": { + "$ref": "#\/definitions\/attributeEmail" + } + } + }, + "x-appwrite": { + "method": "createEmailAttribute", + "group": "attributes", + "weight": 83, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email\/{key}": { + "patch": { + "summary": "Update email attribute", + "operationId": "databasesUpdateEmailAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEmail", + "schema": { + "$ref": "#\/definitions\/attributeEmail" + } + } + }, + "x-appwrite": { + "method": "updateEmailAttribute", + "group": "attributes", + "weight": 95, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum": { + "post": { + "summary": "Create enum attribute", + "operationId": "databasesCreateEnumAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", + "responses": { + "202": { + "description": "AttributeEnum", + "schema": { + "$ref": "#\/definitions\/attributeEnum" + } + } + }, + "x-appwrite": { + "method": "createEnumAttribute", + "group": "attributes", + "weight": 84, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum\/{key}": { + "patch": { + "summary": "Update enum attribute", + "operationId": "databasesUpdateEnumAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEnum", + "schema": { + "$ref": "#\/definitions\/attributeEnum" + } + } + }, + "x-appwrite": { + "method": "updateEnumAttribute", + "group": "attributes", + "weight": 96, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float": { + "post": { + "summary": "Create float attribute", + "operationId": "databasesCreateFloatAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeFloat", + "schema": { + "$ref": "#\/definitions\/attributeFloat" + } + } + }, + "x-appwrite": { + "method": "createFloatAttribute", + "group": "attributes", + "weight": 88, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value to enforce on new documents", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value to enforce on new documents", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float\/{key}": { + "patch": { + "summary": "Update float attribute", + "operationId": "databasesUpdateFloatAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeFloat", + "schema": { + "$ref": "#\/definitions\/attributeFloat" + } + } + }, + "x-appwrite": { + "method": "updateFloatAttribute", + "group": "attributes", + "weight": 100, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value to enforce on new documents", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value to enforce on new documents", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer": { + "post": { + "summary": "Create integer attribute", + "operationId": "databasesCreateIntegerAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeInteger", + "schema": { + "$ref": "#\/definitions\/attributeInteger" + } + } + }, + "x-appwrite": { + "method": "createIntegerAttribute", + "group": "attributes", + "weight": 87, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce on new documents", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce on new documents", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer\/{key}": { + "patch": { + "summary": "Update integer attribute", + "operationId": "databasesUpdateIntegerAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeInteger", + "schema": { + "$ref": "#\/definitions\/attributeInteger" + } + } + }, + "x-appwrite": { + "method": "updateIntegerAttribute", + "group": "attributes", + "weight": 99, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce on new documents", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce on new documents", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip": { + "post": { + "summary": "Create IP address attribute", + "operationId": "databasesCreateIpAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create IP address attribute.\n", + "responses": { + "202": { + "description": "AttributeIP", + "schema": { + "$ref": "#\/definitions\/attributeIp" + } + } + }, + "x-appwrite": { + "method": "createIpAttribute", + "group": "attributes", + "weight": 85, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "patch": { + "summary": "Update IP address attribute", + "operationId": "databasesUpdateIpAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeIP", + "schema": { + "$ref": "#\/definitions\/attributeIp" + } + } + }, + "x-appwrite": { + "method": "updateIpAttribute", + "group": "attributes", + "weight": 97, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { + "post": { + "summary": "Create relationship attribute", + "operationId": "databasesCreateRelationshipAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "202": { + "description": "AttributeRelationship", + "schema": { + "$ref": "#\/definitions\/attributeRelationship" + } + } + }, + "x-appwrite": { + "method": "createRelationshipAttribute", + "group": "attributes", + "weight": 91, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "relatedCollectionId": { + "type": "string", + "description": "Related Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "default": null, + "x-example": "<RELATED_COLLECTION_ID>" + }, + "type": { + "type": "string", + "description": "Relation type", + "default": null, + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "default": false, + "x-example": false + }, + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Attribute Key.", + "default": null, + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": "restrict", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedCollectionId", + "type" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string": { + "post": { + "summary": "Create string attribute", + "operationId": "databasesCreateStringAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a string attribute.\n", + "responses": { + "202": { + "description": "AttributeString", + "schema": { + "$ref": "#\/definitions\/attributeString" + } + } + }, + "x-appwrite": { + "method": "createStringAttribute", + "group": "attributes", + "weight": 82, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "size": { + "type": "integer", + "description": "Attribute size for text attributes, in number of characters.", + "default": null, + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string\/{key}": { + "patch": { + "summary": "Update string attribute", + "operationId": "databasesUpdateStringAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeString", + "schema": { + "$ref": "#\/definitions\/attributeString" + } + } + }, + "x-appwrite": { + "method": "updateStringAttribute", + "group": "attributes", + "weight": 94, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string attribute.", + "default": null, + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url": { + "post": { + "summary": "Create URL attribute", + "operationId": "databasesCreateUrlAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a URL attribute.\n", + "responses": { + "202": { + "description": "AttributeURL", + "schema": { + "$ref": "#\/definitions\/attributeUrl" + } + } + }, + "x-appwrite": { + "method": "createUrlAttribute", + "group": "attributes", + "weight": 86, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url\/{key}": { + "patch": { + "summary": "Update URL attribute", + "operationId": "databasesUpdateUrlAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeURL", + "schema": { + "$ref": "#\/definitions\/attributeUrl" + } + } + }, + "x-appwrite": { + "method": "updateUrlAttribute", + "group": "attributes", + "weight": 98, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}": { + "get": { + "summary": "Get attribute", + "operationId": "databasesGetAttribute", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get attribute by ID.", + "responses": { + "200": { + "description": "AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeDatetime, or AttributeRelationship, or AttributeString", + "schema": { + "x-oneOf": [ + { + "$ref": "#\/definitions\/attributeBoolean" + }, + { + "$ref": "#\/definitions\/attributeInteger" + }, + { + "$ref": "#\/definitions\/attributeFloat" + }, + { + "$ref": "#\/definitions\/attributeEmail" + }, + { + "$ref": "#\/definitions\/attributeEnum" + }, + { + "$ref": "#\/definitions\/attributeUrl" + }, + { + "$ref": "#\/definitions\/attributeIp" + }, + { + "$ref": "#\/definitions\/attributeDatetime" + }, + { + "$ref": "#\/definitions\/attributeRelationship" + }, + { + "$ref": "#\/definitions\/attributeString" + } + ] + } + } + }, + "x-appwrite": { + "method": "getAttribute", + "group": "attributes", + "weight": 93, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete attribute", + "operationId": "databasesDeleteAttribute", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Deletes an attribute.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteAttribute", + "group": "attributes", + "weight": 104, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}\/relationship": { + "patch": { + "summary": "Update relationship attribute", + "operationId": "databasesUpdateRelationshipAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "200": { + "description": "AttributeRelationship", + "schema": { + "$ref": "#\/definitions\/attributeRelationship" + } + } + }, + "x-appwrite": { + "method": "updateRelationshipAttribute", + "group": "attributes", + "weight": 103, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": null, + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "databasesListDocuments", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "listDocuments", + "group": "documents", + "weight": 110, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "createDocument", + "group": "documents", + "weight": 109, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createDocument", + "auth": { + "Admin": [], + "Session": [], + "Key": [], + "JWT": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + }, + { + "name": "createDocuments", + "auth": { + "Admin": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + } + ], + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "<DOCUMENT_ID>" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + ] + }, + "put": { + "summary": "Create or update documents", + "operationId": "databasesUpsertDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 118, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documents": { + "type": "array", + "description": "Array of document data as JSON objects. May contain partial documents.", + "default": null, + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "documents" + ] + } + } + ] + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "updateDocuments", + "group": "documents", + "weight": 117, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "deleteDocuments", + "group": "documents", + "weight": 120, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "databasesGetDocument", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "getDocument", + "group": "documents", + "weight": 111, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert document", + "operationId": "databasesUpsertDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "upsertDocument", + "group": "documents", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include all required attributes of the document to be created or updated.", + "default": {}, + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ] + } + } + ] + }, + "patch": { + "summary": "Update document", + "operationId": "databasesUpdateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "updateDocument", + "group": "documents", + "weight": 113, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete document", + "operationId": "databasesDeleteDocument", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDocument", + "group": "documents", + "weight": 119, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/logs": { + "get": { + "summary": "List document logs", + "operationId": "databasesListDocumentLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get the document activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listDocumentLogs", + "group": "logs", + "weight": 112, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-document-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "databasesListIndexes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "List indexes in the collection.", + "responses": { + "200": { + "description": "Indexes List", + "schema": { + "$ref": "#\/definitions\/indexList" + } + } + }, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 106, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "databasesCreateIndex", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", + "responses": { + "202": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/index" + } + } + }, + "x-appwrite": { + "method": "createIndex", + "group": "collections", + "weight": 105, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "default": null, + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "default": null, + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "attributes": { + "type": "array", + "description": "Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "default": [], + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "attributes" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "databasesGetIndex", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/index" + } + } + }, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 107, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "databasesDeleteIndex", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/logs": { + "get": { + "summary": "List collection logs", + "operationId": "databasesListCollectionLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get the collection activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listCollectionLogs", + "group": "collections", + "weight": 79, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-collection-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/usage": { + "get": { + "summary": "Get collection usage stats", + "operationId": "databasesGetCollectionUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageCollection", + "schema": { + "$ref": "#\/definitions\/usageCollection" + } + } + }, + "x-appwrite": { + "method": "getCollectionUsage", + "group": null, + "weight": 123, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-collection-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "DatabaseUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/logs": { + "get": { + "summary": "List database logs", + "operationId": "databasesListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get the database activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 73, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/usage": { + "get": { + "summary": "Get database usage stats", + "operationId": "databasesGetDatabaseUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.", + "responses": { + "200": { + "description": "UsageDatabase", + "schema": { + "$ref": "#\/definitions\/usageDatabase" + } + } + }, + "x-appwrite": { + "method": "getDatabaseUsage", + "group": null, + "weight": 122, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-database-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-database-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "range", + "description": "`Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "DatabaseUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/functions": { + "get": { + "summary": "List functions", + "operationId": "functionsList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all the project's functions. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Functions List", + "schema": { + "$ref": "#\/definitions\/functionList" + } + } + }, + "x-appwrite": { + "method": "list", + "group": "functions", + "weight": 378, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's functions. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create function", + "operationId": "functionsCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "responses": { + "201": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "x-appwrite": { + "method": "create", + "group": "functions", + "weight": 375, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "functionId": { + "type": "string", + "description": "Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<FUNCTION_ID>" + }, + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "default": null, + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": [], + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "default": "", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Function maximum execution time in seconds.", + "default": 15, + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "default": true, + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "default": "", + "x-example": "<ENTRYPOINT>" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "default": "", + "x-example": "<COMMANDS>" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function.", + "default": "", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function.", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "functionId", + "name", + "runtime" + ] + } + } + ] + } + }, + "\/functions\/runtimes": { + "get": { + "summary": "List runtimes", + "operationId": "functionsListRuntimes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all runtimes that are currently active on your instance.", + "responses": { + "200": { + "description": "Runtimes List", + "schema": { + "$ref": "#\/definitions\/runtimeList" + } + } + }, + "x-appwrite": { + "method": "listRuntimes", + "group": "runtimes", + "weight": 380, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-runtimes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all runtimes that are currently active on your instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "functionsListSpecifications", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "List allowed function specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "schema": { + "$ref": "#\/definitions\/specificationList" + } + } + }, + "x-appwrite": { + "method": "listSpecifications", + "group": "runtimes", + "weight": 381, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed function specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/templates": { + "get": { + "summary": "List templates", + "operationId": "functionsListTemplates", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "List available function templates. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "responses": { + "200": { + "description": "Function Templates List", + "schema": { + "$ref": "#\/definitions\/templateFunctionList" + } + } + }, + "x-appwrite": { + "method": "listTemplates", + "group": "templates", + "weight": 404, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-templates.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList available function templates. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "runtimes", + "description": "List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "useCases", + "description": "List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "limit", + "description": "Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 25, + "in": "query" + }, + { + "name": "offset", + "description": "Offset the list of returned templates. Maximum offset is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + } + ] + } + }, + "\/functions\/templates\/{templateId}": { + "get": { + "summary": "Get function template", + "operationId": "functionsGetTemplate", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function template using ID. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "responses": { + "200": { + "description": "Template Function", + "schema": { + "$ref": "#\/definitions\/templateFunction" + } + } + }, + "x-appwrite": { + "method": "getTemplate", + "group": "templates", + "weight": 403, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function template using ID. You can use template details in [createFunction](\/docs\/references\/cloud\/server-nodejs\/functions#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "templateId", + "description": "Template ID.", + "required": true, + "type": "string", + "x-example": "<TEMPLATE_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/usage": { + "get": { + "summary": "Get functions usage", + "operationId": "functionsListUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get usage metrics and statistics for all functions in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageFunctions", + "schema": { + "$ref": "#\/definitions\/usageFunctions" + } + } + }, + "x-appwrite": { + "method": "listUsage", + "group": null, + "weight": 397, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for all functions in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "FunctionUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}": { + "get": { + "summary": "Get function", + "operationId": "functionsGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "functions", + "weight": 376, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update function", + "operationId": "functionsUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Update function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "x-appwrite": { + "method": "update", + "group": "functions", + "weight": 377, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "default": "", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": [], + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "default": "", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Maximum execution time in seconds.", + "default": 15, + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "default": true, + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "default": "", + "x-example": "<ENTRYPOINT>" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "default": "", + "x-example": "<COMMANDS>" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Controle System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function", + "default": null, + "x-example": "<PROVIDER_REPOSITORY_ID>", + "x-nullable": true + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete function", + "operationId": "functionsDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a function by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "functions", + "weight": 379, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployment": { + "patch": { + "summary": "Update function's deployment", + "operationId": "functionsUpdateFunctionDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "responses": { + "200": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "x-appwrite": { + "method": "updateFunctionDeployment", + "group": "functions", + "weight": 384, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update-function-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "functionsListDeployments", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all the function's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "schema": { + "$ref": "#\/definitions\/deploymentList" + } + } + }, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 385, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the function's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "functionsCreateDeployment", + "consumes": [ + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 382, + "cookies": false, + "type": "upload", + "deprecated": false, + "demo": "functions\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "entrypoint", + "description": "Entrypoint File.", + "required": false, + "type": "string", + "x-example": "<ENTRYPOINT>", + "in": "formData" + }, + { + "name": "commands", + "description": "Build Commands.", + "required": false, + "type": "string", + "x-example": "<COMMANDS>", + "in": "formData" + }, + { + "name": "code", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "required": true, + "type": "file", + "in": "formData" + }, + { + "name": "activate", + "description": "Automatically activate the deployment when it is finished building.", + "required": true, + "type": "boolean", + "x-example": false, + "in": "formData" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "functionsCreateDuplicateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 390, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + }, + "buildId": { + "type": "string", + "description": "Build unique ID.", + "default": "", + "x-example": "<BUILD_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "functionsCreateTemplateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 387, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "default": null, + "x-example": "<REPOSITORY>" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "default": null, + "x-example": "<OWNER>" + }, + "rootDirectory": { + "type": "string", + "description": "Path to function code in the template repo.", + "default": null, + "x-example": "<ROOT_DIRECTORY>" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the function template.", + "default": null, + "x-example": "<VERSION>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "functionsCreateVcsDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 388, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "default": null, + "x-example": "branch", + "enum": [ + "branch", + "commit" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "default": null, + "x-example": "<REFERENCE>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "functionsGetDeployment", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 383, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "functionsDeleteDeployment", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a code deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 386, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a code deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "functionsGetDeploymentDownload", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "functions" + ], + "description": "Get a function deployment 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.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 389, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "functions\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment 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.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source", + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "functionsUpdateDeploymentStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 391, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/executions": { + "get": { + "summary": "List executions", + "operationId": "functionsListExecutions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "schema": { + "$ref": "#\/definitions\/executionList" + } + } + }, + "x-appwrite": { + "method": "listExecutions", + "group": "executions", + "weight": 394, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-executions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create execution", + "operationId": "functionsCreateExecution", + "consumes": [ + "application\/json" + ], + "produces": [ + "multipart\/form-data" + ], + "tags": [ + "functions" + ], + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "responses": { + "201": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "x-appwrite": { + "method": "createExecution", + "group": "executions", + "weight": 392, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "default": "", + "x-example": "<BODY>" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "default": false, + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "default": "\/", + "x-example": "<PATH>" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is GET.", + "default": "POST", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "object", + "description": "HTTP headers of execution. Defaults to empty.", + "default": [], + "x-example": "{}" + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/functions\/{functionId}\/executions\/{executionId}": { + "get": { + "summary": "Get execution", + "operationId": "functionsGetExecution", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function execution log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "x-appwrite": { + "method": "getExecution", + "group": "executions", + "weight": 393, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "type": "string", + "x-example": "<EXECUTION_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete execution", + "operationId": "functionsDeleteExecution", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a function execution by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteExecution", + "group": "executions", + "weight": 395, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function execution by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "type": "string", + "x-example": "<EXECUTION_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/usage": { + "get": { + "summary": "Get function usage", + "operationId": "functionsGetUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageFunction", + "schema": { + "$ref": "#\/definitions\/usageFunction" + } + } + }, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 396, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "FunctionUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "functionsListVariables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all variables of a specific function.", + "responses": { + "200": { + "description": "Variables List", + "schema": { + "$ref": "#\/definitions\/variableList" + } + } + }, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 400, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "functionsCreateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "responses": { + "201": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 398, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "default": true, + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "functionsGetVariable", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 399, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "functionsUpdateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 401, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "default": null, + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + ] + }, + "delete": { + "summary": "Delete variable", + "operationId": "functionsDeleteVariable", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 402, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + } + }, + "\/graphql": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlQuery", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "schema": { + "$ref": "#\/definitions\/any" + } + } + }, + "x-appwrite": { + "method": "query", + "group": "graphql", + "weight": 308, + "cookies": false, + "type": "graphql", + "deprecated": false, + "demo": "graphql\/query.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "description": "The query or queries to execute.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "query" + ] + } + } + ] + } + }, + "\/graphql\/mutation": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlMutation", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "schema": { + "$ref": "#\/definitions\/any" + } + } + }, + "x-appwrite": { + "method": "mutation", + "group": "graphql", + "weight": 307, + "cookies": false, + "type": "graphql", + "deprecated": false, + "demo": "graphql\/mutation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "description": "The query or queries to execute.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "query" + ] + } + } + ] + } + }, + "\/health": { + "get": { + "summary": "Get HTTP", + "operationId": "healthGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite HTTP server is up and responsive.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "health", + "weight": 132, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/anti-virus": { + "get": { + "summary": "Get antivirus", + "operationId": "healthGetAntivirus", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite Antivirus server is up and connection is successful.", + "responses": { + "200": { + "description": "Health Antivirus", + "schema": { + "$ref": "#\/definitions\/healthAntivirus" + } + } + }, + "x-appwrite": { + "method": "getAntivirus", + "group": "health", + "weight": 153, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-antivirus.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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/cache": { + "get": { + "summary": "Get cache", + "operationId": "healthGetCache", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite in-memory cache servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "x-appwrite": { + "method": "getCache", + "group": "health", + "weight": 135, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/certificate": { + "get": { + "summary": "Get the SSL certificate for a domain", + "operationId": "healthGetCertificate", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the SSL certificate for a domain", + "responses": { + "200": { + "description": "Health Certificate", + "schema": { + "$ref": "#\/definitions\/healthCertificate" + } + } + }, + "x-appwrite": { + "method": "getCertificate", + "group": "health", + "weight": 140, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-certificate.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-certificate.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "domain", + "description": "string", + "required": false, + "type": "string", + "in": "query" + } + ] + } + }, + "\/health\/db": { + "get": { + "summary": "Get DB", + "operationId": "healthGetDB", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite database servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "x-appwrite": { + "method": "getDB", + "group": "health", + "weight": 134, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/pubsub": { + "get": { + "summary": "Get pubsub", + "operationId": "healthGetPubSub", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite pub-sub servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "x-appwrite": { + "method": "getPubSub", + "group": "health", + "weight": 136, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-pub-sub.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-pubsub.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/queue\/builds": { + "get": { + "summary": "Get builds queue", + "operationId": "healthGetQueueBuilds", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of builds that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueBuilds", + "group": "queue", + "weight": 142, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-builds.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-builds.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/certificates": { + "get": { + "summary": "Get certificates queue", + "operationId": "healthGetQueueCertificates", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueCertificates", + "group": "queue", + "weight": 141, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/databases": { + "get": { + "summary": "Get databases queue", + "operationId": "healthGetQueueDatabases", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueDatabases", + "group": "queue", + "weight": 143, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-databases.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-databases.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Queue name for which to check the queue size", + "required": false, + "type": "string", + "x-example": "<NAME>", + "default": "database_db_main", + "in": "query" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/deletes": { + "get": { + "summary": "Get deletes queue", + "operationId": "healthGetQueueDeletes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueDeletes", + "group": "queue", + "weight": 144, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-deletes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-deletes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/failed\/{name}": { + "get": { + "summary": "Get number of failed queue jobs", + "operationId": "healthGetFailedJobs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Returns the amount of failed jobs in a given queue.\n", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getFailedJobs", + "group": "queue", + "weight": 154, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-failed-jobs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-failed-queue-jobs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "The name of the queue", + "required": true, + "type": "string", + "x-example": "v1-database", + "enum": [ + "v1-database", + "v1-deletes", + "v1-audits", + "v1-mails", + "v1-functions", + "v1-stats-resources", + "v1-stats-usage", + "v1-webhooks", + "v1-certificates", + "v1-builds", + "v1-messaging", + "v1-migrations" + ], + "x-enum-name": null, + "x-enum-keys": [], + "in": "path" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/functions": { + "get": { + "summary": "Get functions queue", + "operationId": "healthGetQueueFunctions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueFunctions", + "group": "queue", + "weight": 148, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/logs": { + "get": { + "summary": "Get logs queue", + "operationId": "healthGetQueueLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of logs that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueLogs", + "group": "queue", + "weight": 139, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/mails": { + "get": { + "summary": "Get mails queue", + "operationId": "healthGetQueueMails", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of mails that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueMails", + "group": "queue", + "weight": 145, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-mails.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-mails.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/messaging": { + "get": { + "summary": "Get messaging queue", + "operationId": "healthGetQueueMessaging", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of messages that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueMessaging", + "group": "queue", + "weight": 146, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-messaging.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-messaging.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/migrations": { + "get": { + "summary": "Get migrations queue", + "operationId": "healthGetQueueMigrations", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueMigrations", + "group": "queue", + "weight": 147, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-migrations.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-migrations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-resources": { + "get": { + "summary": "Get stats resources queue", + "operationId": "healthGetQueueStatsResources", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueStatsResources", + "group": "queue", + "weight": 149, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-stats-resources.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-usage": { + "get": { + "summary": "Get stats usage queue", + "operationId": "healthGetQueueUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueUsage", + "group": "queue", + "weight": 150, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/webhooks": { + "get": { + "summary": "Get webhooks queue", + "operationId": "healthGetQueueWebhooks", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueWebhooks", + "group": "queue", + "weight": 138, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/storage": { + "get": { + "summary": "Get storage", + "operationId": "healthGetStorage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "x-appwrite": { + "method": "getStorage", + "group": "storage", + "weight": 152, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-storage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/storage\/local": { + "get": { + "summary": "Get local storage", + "operationId": "healthGetStorageLocal", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite local storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "x-appwrite": { + "method": "getStorageLocal", + "group": "storage", + "weight": 151, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/time": { + "get": { + "summary": "Get time", + "operationId": "healthGetTime", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Health Time", + "schema": { + "$ref": "#\/definitions\/healthTime" + } + } + }, + "x-appwrite": { + "method": "getTime", + "group": "health", + "weight": 137, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/locale": { + "get": { + "summary": "Get user locale", + "operationId": "localeGet", + "consumes": [], + "produces": [ + "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))", + "responses": { + "200": { + "description": "Locale", + "schema": { + "$ref": "#\/definitions\/locale" + } + } + }, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 124, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/codes": { + "get": { + "summary": "List locale codes", + "operationId": "localeListCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes).", + "responses": { + "200": { + "description": "Locale codes list", + "schema": { + "$ref": "#\/definitions\/localeCodeList" + } + } + }, + "x-appwrite": { + "method": "listCodes", + "group": null, + "weight": 125, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/continents": { + "get": { + "summary": "List continents", + "operationId": "localeListContinents", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all continents. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Continents List", + "schema": { + "$ref": "#\/definitions\/continentList" + } + } + }, + "x-appwrite": { + "method": "listContinents", + "group": null, + "weight": 129, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-continents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries": { + "get": { + "summary": "List countries", + "operationId": "localeListCountries", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all countries. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "schema": { + "$ref": "#\/definitions\/countryList" + } + } + }, + "x-appwrite": { + "method": "listCountries", + "group": null, + "weight": 126, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/eu": { + "get": { + "summary": "List EU countries", + "operationId": "localeListCountriesEU", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Countries List", + "schema": { + "$ref": "#\/definitions\/countryList" + } + } + }, + "x-appwrite": { + "method": "listCountriesEU", + "group": null, + "weight": 127, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries-e-u.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/phones": { + "get": { + "summary": "List countries phone codes", + "operationId": "localeListCountriesPhones", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Phones List", + "schema": { + "$ref": "#\/definitions\/phoneList" + } + } + }, + "x-appwrite": { + "method": "listCountriesPhones", + "group": null, + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries-phones.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/currencies": { + "get": { + "summary": "List currencies", + "operationId": "localeListCurrencies", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Currencies List", + "schema": { + "$ref": "#\/definitions\/currencyList" + } + } + }, + "x-appwrite": { + "method": "listCurrencies", + "group": null, + "weight": 130, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-currencies.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/languages": { + "get": { + "summary": "List languages", + "operationId": "localeListLanguages", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Languages List", + "schema": { + "$ref": "#\/definitions\/languageList" + } + } + }, + "x-appwrite": { + "method": "listLanguages", + "group": null, + "weight": 131, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-languages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/messages": { + "get": { + "summary": "List messages", + "operationId": "messagingListMessages", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all messages from the current Appwrite project.", + "responses": { + "200": { + "description": "Message list", + "schema": { + "$ref": "#\/definitions\/messageList" + } + } + }, + "x-appwrite": { + "method": "listMessages", + "group": "messages", + "weight": 362, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-messages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-messages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/email": { + "post": { + "summary": "Create email", + "operationId": "messagingCreateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new email message.", + "responses": { + "201": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "x-appwrite": { + "method": "createEmail", + "group": "messages", + "weight": 359, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<MESSAGE_ID>" + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "default": null, + "x-example": "<SUBJECT>" + }, + "content": { + "type": "string", + "description": "Email Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": false, + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "default": false, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + } + }, + "required": [ + "messageId", + "subject", + "content" + ] + } + } + ] + } + }, + "\/messaging\/messages\/email\/{messageId}": { + "patch": { + "summary": "Update email", + "operationId": "messagingUpdateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "x-appwrite": { + "method": "updateEmail", + "group": "messages", + "weight": 366, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "default": null, + "x-example": "<SUBJECT>" + }, + "content": { + "type": "string", + "description": "Email Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": null, + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "default": null, + "x-example": false + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/messaging\/messages\/push": { + "post": { + "summary": "Create push notification", + "operationId": "messagingCreatePush", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new push notification.", + "responses": { + "201": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "x-appwrite": { + "method": "createPush", + "group": "messages", + "weight": 361, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<MESSAGE_ID>" + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "default": "", + "x-example": "<TITLE>" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "default": "", + "x-example": "<BODY>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "data": { + "type": "object", + "description": "Additional key-value pair data for push notification.", + "default": {}, + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "default": "", + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": "", + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web Platform.", + "default": "", + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS Platform.", + "default": "", + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android Platform.", + "default": "", + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android Platform.", + "default": "", + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "default": -1, + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": false, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "default": "high", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + }, + "required": [ + "messageId" + ] + } + } + ] + } + }, + "\/messaging\/messages\/push\/{messageId}": { + "patch": { + "summary": "Update push notification", + "operationId": "messagingUpdatePush", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "x-appwrite": { + "method": "updatePush", + "group": "messages", + "weight": 368, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "default": null, + "x-example": "<TITLE>" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "default": null, + "x-example": "<BODY>" + }, + "data": { + "type": "object", + "description": "Additional Data for push notification.", + "default": {}, + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "default": null, + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": null, + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web platforms.", + "default": null, + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS platforms.", + "default": null, + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android platforms.", + "default": null, + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android platforms.", + "default": null, + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS platforms.", + "default": null, + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": null, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "default": null, + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + } + } + } + ] + } + }, + "\/messaging\/messages\/sms": { + "post": { + "summary": "Create SMS", + "operationId": "messagingCreateSms", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new SMS message.", + "responses": { + "201": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "x-appwrite": { + "method": "createSms", + "group": "messages", + "weight": 360, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<MESSAGE_ID>" + }, + "content": { + "type": "string", + "description": "SMS Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": false, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + } + }, + "required": [ + "messageId", + "content" + ] + } + } + ] + } + }, + "\/messaging\/messages\/sms\/{messageId}": { + "patch": { + "summary": "Update SMS", + "operationId": "messagingUpdateSms", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "x-appwrite": { + "method": "updateSms", + "group": "messages", + "weight": 367, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "content": { + "type": "string", + "description": "Email Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": null, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/messaging\/messages\/{messageId}": { + "get": { + "summary": "Get message", + "operationId": "messagingGetMessage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a message by its unique ID.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "x-appwrite": { + "method": "getMessage", + "group": "messages", + "weight": 365, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-message.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete message", + "operationId": "messagingDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "messages", + "weight": 369, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/logs": { + "get": { + "summary": "List message logs", + "operationId": "messagingListMessageLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the message activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listMessageLogs", + "group": "logs", + "weight": 363, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-message-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/targets": { + "get": { + "summary": "List message targets", + "operationId": "messagingListTargets", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of the targets associated with a message.", + "responses": { + "200": { + "description": "Target list", + "schema": { + "$ref": "#\/definitions\/targetList" + } + } + }, + "x-appwrite": { + "method": "listTargets", + "group": "messages", + "weight": 364, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/providers": { + "get": { + "summary": "List providers", + "operationId": "messagingListProviders", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all providers from the current Appwrite project.", + "responses": { + "200": { + "description": "Provider list", + "schema": { + "$ref": "#\/definitions\/providerList" + } + } + }, + "x-appwrite": { + "method": "listProviders", + "group": "providers", + "weight": 334, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-providers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-providers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/messaging\/providers\/apns": { + "post": { + "summary": "Create APNS provider", + "operationId": "messagingCreateApnsProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Apple Push Notification service provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createApnsProvider", + "group": "providers", + "weight": 333, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "default": "", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "default": "", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "default": "", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "default": "", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/apns\/{providerId}": { + "patch": { + "summary": "Update APNS provider", + "operationId": "messagingUpdateApnsProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateApnsProvider", + "group": "providers", + "weight": 346, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "default": "", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "default": "", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "default": "", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "default": "", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "default": null, + "x-example": false + } + } + } + } + ] + } + }, + "\/messaging\/providers\/fcm": { + "post": { + "summary": "Create FCM provider", + "operationId": "messagingCreateFcmProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createFcmProvider", + "group": "providers", + "weight": 332, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "default": {}, + "x-example": "{}" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/fcm\/{providerId}": { + "patch": { + "summary": "Update FCM provider", + "operationId": "messagingUpdateFcmProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateFcmProvider", + "group": "providers", + "weight": 345, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "default": {}, + "x-example": "{}" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/mailgun": { + "post": { + "summary": "Create Mailgun provider", + "operationId": "messagingCreateMailgunProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Mailgun provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createMailgunProvider", + "group": "providers", + "weight": 324, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "default": "", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "default": "", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "default": null, + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", + "default": "", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/mailgun\/{providerId}": { + "patch": { + "summary": "Update Mailgun provider", + "operationId": "messagingUpdateMailgunProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Mailgun provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateMailgunProvider", + "group": "providers", + "weight": 337, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "default": "", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "default": "", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "default": null, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "default": "", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/msg91": { + "post": { + "summary": "Create Msg91 provider", + "operationId": "messagingCreateMsg91Provider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new MSG91 provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createMsg91Provider", + "group": "providers", + "weight": 327, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-msg91provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID", + "default": "", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "default": "", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "default": "", + "x-example": "<AUTH_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/msg91\/{providerId}": { + "patch": { + "summary": "Update Msg91 provider", + "operationId": "messagingUpdateMsg91Provider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a MSG91 provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateMsg91Provider", + "group": "providers", + "weight": 340, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-msg91provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID.", + "default": "", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "default": "", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "default": "", + "x-example": "<AUTH_KEY>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/sendgrid": { + "post": { + "summary": "Create Sendgrid provider", + "operationId": "messagingCreateSendgridProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Sendgrid provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createSendgridProvider", + "group": "providers", + "weight": 325, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "default": "", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/sendgrid\/{providerId}": { + "patch": { + "summary": "Update Sendgrid provider", + "operationId": "messagingUpdateSendgridProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Sendgrid provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateSendgridProvider", + "group": "providers", + "weight": 338, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "default": "", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/smtp": { + "post": { + "summary": "Create SMTP provider", + "operationId": "messagingCreateSmtpProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new SMTP provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createSmtpProvider", + "group": "providers", + "weight": 326, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "default": null, + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "The default SMTP server port.", + "default": 587, + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "default": "", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "default": "", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be omitted, 'ssl', or 'tls'", + "default": "", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "default": true, + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "default": "", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "default": "", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name", + "host" + ] + } + } + ] + } + }, + "\/messaging\/providers\/smtp\/{providerId}": { + "patch": { + "summary": "Update SMTP provider", + "operationId": "messagingUpdateSmtpProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a SMTP provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateSmtpProvider", + "group": "providers", + "weight": 339, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "default": "", + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "SMTP port.", + "default": null, + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "default": "", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "default": "", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be 'ssl' or 'tls'", + "default": "", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "default": null, + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "default": "", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "default": "", + "x-example": "<REPLY_TO_EMAIL>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + } + } + } + ] + } + }, + "\/messaging\/providers\/telesign": { + "post": { + "summary": "Create Telesign provider", + "operationId": "messagingCreateTelesignProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Telesign provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createTelesignProvider", + "group": "providers", + "weight": 328, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "default": "", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/telesign\/{providerId}": { + "patch": { + "summary": "Update Telesign provider", + "operationId": "messagingUpdateTelesignProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Telesign provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateTelesignProvider", + "group": "providers", + "weight": 341, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "default": "", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/textmagic": { + "post": { + "summary": "Create Textmagic provider", + "operationId": "messagingCreateTextmagicProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Textmagic provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createTextmagicProvider", + "group": "providers", + "weight": 329, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "default": "", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "default": "", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/textmagic\/{providerId}": { + "patch": { + "summary": "Update Textmagic provider", + "operationId": "messagingUpdateTextmagicProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Textmagic provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateTextmagicProvider", + "group": "providers", + "weight": 342, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "default": "", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "default": "", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/twilio": { + "post": { + "summary": "Create Twilio provider", + "operationId": "messagingCreateTwilioProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Twilio provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createTwilioProvider", + "group": "providers", + "weight": 330, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "default": "", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "default": "", + "x-example": "<AUTH_TOKEN>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/twilio\/{providerId}": { + "patch": { + "summary": "Update Twilio provider", + "operationId": "messagingUpdateTwilioProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Twilio provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateTwilioProvider", + "group": "providers", + "weight": 343, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "default": "", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "default": "", + "x-example": "<AUTH_TOKEN>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/vonage": { + "post": { + "summary": "Create Vonage provider", + "operationId": "messagingCreateVonageProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Vonage provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createVonageProvider", + "group": "providers", + "weight": 331, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "default": "", + "x-example": "<API_SECRET>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/vonage\/{providerId}": { + "patch": { + "summary": "Update Vonage provider", + "operationId": "messagingUpdateVonageProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Vonage provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateVonageProvider", + "group": "providers", + "weight": 344, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "default": "", + "x-example": "<API_SECRET>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/{providerId}": { + "get": { + "summary": "Get provider", + "operationId": "messagingGetProvider", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a provider by its unique ID.\n", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "getProvider", + "group": "providers", + "weight": 336, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete provider", + "operationId": "messagingDeleteProvider", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a provider by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteProvider", + "group": "providers", + "weight": 347, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + } + ] + } + }, + "\/messaging\/providers\/{providerId}\/logs": { + "get": { + "summary": "List provider logs", + "operationId": "messagingListProviderLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the provider activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listProviderLogs", + "group": "providers", + "weight": 335, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-provider-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-provider-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/subscribers\/{subscriberId}\/logs": { + "get": { + "summary": "List subscriber logs", + "operationId": "messagingListSubscriberLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the subscriber activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listSubscriberLogs", + "group": "subscribers", + "weight": 356, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-subscriber-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscriber-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "type": "string", + "x-example": "<SUBSCRIBER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/topics": { + "get": { + "summary": "List topics", + "operationId": "messagingListTopics", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all topics from the current Appwrite project.", + "responses": { + "200": { + "description": "Topic list", + "schema": { + "$ref": "#\/definitions\/topicList" + } + } + }, + "x-appwrite": { + "method": "listTopics", + "group": "topics", + "weight": 349, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-topics.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topics.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create topic", + "operationId": "messagingCreateTopic", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new topic.", + "responses": { + "201": { + "description": "Topic", + "schema": { + "$ref": "#\/definitions\/topic" + } + } + }, + "x-appwrite": { + "method": "createTopic", + "group": "topics", + "weight": 348, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topicId": { + "type": "string", + "description": "Topic ID. Choose a custom Topic ID or a new Topic ID.", + "default": null, + "x-example": "<TOPIC_ID>" + }, + "name": { + "type": "string", + "description": "Topic Name.", + "default": null, + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": [ + "users" + ], + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "topicId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/topics\/{topicId}": { + "get": { + "summary": "Get topic", + "operationId": "messagingGetTopic", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "schema": { + "$ref": "#\/definitions\/topic" + } + } + }, + "x-appwrite": { + "method": "getTopic", + "group": "topics", + "weight": 351, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update topic", + "operationId": "messagingUpdateTopic", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "schema": { + "$ref": "#\/definitions\/topic" + } + } + }, + "x-appwrite": { + "method": "updateTopic", + "group": "topics", + "weight": 352, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Topic Name.", + "default": null, + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": null, + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete topic", + "operationId": "messagingDeleteTopic", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a topic by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteTopic", + "group": "topics", + "weight": 353, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/logs": { + "get": { + "summary": "List topic logs", + "operationId": "messagingListTopicLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the topic activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listTopicLogs", + "group": "topics", + "weight": 350, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-topic-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topic-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers": { + "get": { + "summary": "List subscribers", + "operationId": "messagingListSubscribers", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all subscribers from the current Appwrite project.", + "responses": { + "200": { + "description": "Subscriber list", + "schema": { + "$ref": "#\/definitions\/subscriberList" + } + } + }, + "x-appwrite": { + "method": "listSubscribers", + "group": "subscribers", + "weight": 355, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-subscribers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscribers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create subscriber", + "operationId": "messagingCreateSubscriber", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new subscriber.", + "responses": { + "201": { + "description": "Subscriber", + "schema": { + "$ref": "#\/definitions\/subscriber" + } + } + }, + "x-appwrite": { + "method": "createSubscriber", + "group": "subscribers", + "weight": 354, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID to subscribe to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "subscriberId": { + "type": "string", + "description": "Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.", + "default": null, + "x-example": "<SUBSCRIBER_ID>" + }, + "targetId": { + "type": "string", + "description": "Target ID. The target ID to link to the specified Topic ID.", + "default": null, + "x-example": "<TARGET_ID>" + } + }, + "required": [ + "subscriberId", + "targetId" + ] + } + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers\/{subscriberId}": { + "get": { + "summary": "Get subscriber", + "operationId": "messagingGetSubscriber", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a subscriber by its unique ID.\n", + "responses": { + "200": { + "description": "Subscriber", + "schema": { + "$ref": "#\/definitions\/subscriber" + } + } + }, + "x-appwrite": { + "method": "getSubscriber", + "group": "subscribers", + "weight": 357, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "type": "string", + "x-example": "<SUBSCRIBER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete subscriber", + "operationId": "messagingDeleteSubscriber", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a subscriber by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSubscriber", + "group": "subscribers", + "weight": 358, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "type": "string", + "x-example": "<SUBSCRIBER_ID>", + "in": "path" + } + ] + } + }, + "\/migrations": { + "get": { + "summary": "List migrations", + "operationId": "migrationsList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.", + "responses": { + "200": { + "description": "Migrations List", + "schema": { + "$ref": "#\/definitions\/migrationList" + } + } + }, + "x-appwrite": { + "method": "list", + "group": null, + "weight": 316, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/list-migrations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/migrations\/appwrite": { + "post": { + "summary": "Create Appwrite migration", + "operationId": "migrationsCreateAppwriteMigration", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Migrate data from another Appwrite project to your current project. This endpoint allows you to migrate resources like databases, collections, documents, users, and files from an existing Appwrite project. ", + "responses": { + "202": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "x-appwrite": { + "method": "createAppwriteMigration", + "group": null, + "weight": 311, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/create-appwrite-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-appwrite.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "endpoint": { + "type": "string", + "description": "Source Appwrite endpoint", + "default": null, + "x-example": "https:\/\/example.com" + }, + "projectId": { + "type": "string", + "description": "Source Project ID", + "default": null, + "x-example": "<PROJECT_ID>" + }, + "apiKey": { + "type": "string", + "description": "Source API Key", + "default": null, + "x-example": "<API_KEY>" + } + }, + "required": [ + "resources", + "endpoint", + "projectId", + "apiKey" + ] + } + } + ] + } + }, + "\/migrations\/appwrite\/report": { + "get": { + "summary": "Get Appwrite migration report", + "operationId": "migrationsGetAppwriteReport", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Generate a report of the data in an Appwrite project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", + "responses": { + "200": { + "description": "Migration Report", + "schema": { + "$ref": "#\/definitions\/migrationReport" + } + } + }, + "x-appwrite": { + "method": "getAppwriteReport", + "group": null, + "weight": 318, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/get-appwrite-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-appwrite-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate", + "required": true, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "in": "query" + }, + { + "name": "endpoint", + "description": "Source's Appwrite Endpoint", + "required": true, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "in": "query" + }, + { + "name": "projectID", + "description": "Source's Project ID", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "query" + }, + { + "name": "key", + "description": "Source's API Key", + "required": true, + "type": "string", + "x-example": "<KEY>", + "in": "query" + } + ] + } + }, + "\/migrations\/csv": { + "post": { + "summary": "Import documents from a CSV", + "operationId": "migrationsCreateCsvMigration", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Import documents from a CSV file into your Appwrite database. This endpoint allows you to import documents from a CSV file uploaded to Appwrite Storage bucket.", + "responses": { + "202": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "x-appwrite": { + "method": "createCsvMigration", + "group": null, + "weight": 315, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/create-csv-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-csv.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "default": null, + "x-example": "<BUCKET_ID>" + }, + "fileId": { + "type": "string", + "description": "File ID.", + "default": null, + "x-example": "<FILE_ID>" + }, + "resourceId": { + "type": "string", + "description": "Composite ID in the format {databaseId:collectionId}, identifying a collection within a database.", + "default": null, + "x-example": "[ID1:ID2]" + } + }, + "required": [ + "bucketId", + "fileId", + "resourceId" + ] + } + } + ] + } + }, + "\/migrations\/firebase": { + "post": { + "summary": "Create Firebase migration", + "operationId": "migrationsCreateFirebaseMigration", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Migrate data from a Firebase project to your Appwrite project. This endpoint allows you to migrate resources like authentication and other supported services from a Firebase project. ", + "responses": { + "202": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "x-appwrite": { + "method": "createFirebaseMigration", + "group": null, + "weight": 312, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/create-firebase-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "serviceAccount": { + "type": "string", + "description": "JSON of the Firebase service account credentials", + "default": null, + "x-example": "<SERVICE_ACCOUNT>" + } + }, + "required": [ + "resources", + "serviceAccount" + ] + } + } + ] + } + }, + "\/migrations\/firebase\/report": { + "get": { + "summary": "Get Firebase migration report", + "operationId": "migrationsGetFirebaseReport", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Generate a report of the data in a Firebase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated.", + "responses": { + "200": { + "description": "Migration Report", + "schema": { + "$ref": "#\/definitions\/migrationReport" + } + } + }, + "x-appwrite": { + "method": "getFirebaseReport", + "group": null, + "weight": 319, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/get-firebase-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-firebase-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate", + "required": true, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "in": "query" + }, + { + "name": "serviceAccount", + "description": "JSON of the Firebase service account credentials", + "required": true, + "type": "string", + "x-example": "<SERVICE_ACCOUNT>", + "in": "query" + } + ] + } + }, + "\/migrations\/nhost": { + "post": { + "summary": "Create NHost migration", + "operationId": "migrationsCreateNHostMigration", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Migrate data from an NHost project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from an NHost project. ", + "responses": { + "202": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "x-appwrite": { + "method": "createNHostMigration", + "group": null, + "weight": 314, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/create-n-host-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-nhost.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "subdomain": { + "type": "string", + "description": "Source's Subdomain", + "default": null, + "x-example": "<SUBDOMAIN>" + }, + "region": { + "type": "string", + "description": "Source's Region", + "default": null, + "x-example": "<REGION>" + }, + "adminSecret": { + "type": "string", + "description": "Source's Admin Secret", + "default": null, + "x-example": "<ADMIN_SECRET>" + }, + "database": { + "type": "string", + "description": "Source's Database Name", + "default": null, + "x-example": "<DATABASE>" + }, + "username": { + "type": "string", + "description": "Source's Database Username", + "default": null, + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Source's Database Password", + "default": null, + "x-example": "<PASSWORD>" + }, + "port": { + "type": "integer", + "description": "Source's Database Port", + "default": 5432, + "x-example": null + } + }, + "required": [ + "resources", + "subdomain", + "region", + "adminSecret", + "database", + "username", + "password" + ] + } + } + ] + } + }, + "\/migrations\/nhost\/report": { + "get": { + "summary": "Get NHost migration report", + "operationId": "migrationsGetNHostReport", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Generate a detailed report of the data in an NHost project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", + "responses": { + "200": { + "description": "Migration Report", + "schema": { + "$ref": "#\/definitions\/migrationReport" + } + } + }, + "x-appwrite": { + "method": "getNHostReport", + "group": null, + "weight": 321, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/get-n-host-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-nhost-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate.", + "required": true, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "in": "query" + }, + { + "name": "subdomain", + "description": "Source's Subdomain.", + "required": true, + "type": "string", + "x-example": "<SUBDOMAIN>", + "in": "query" + }, + { + "name": "region", + "description": "Source's Region.", + "required": true, + "type": "string", + "x-example": "<REGION>", + "in": "query" + }, + { + "name": "adminSecret", + "description": "Source's Admin Secret.", + "required": true, + "type": "string", + "x-example": "<ADMIN_SECRET>", + "in": "query" + }, + { + "name": "database", + "description": "Source's Database Name.", + "required": true, + "type": "string", + "x-example": "<DATABASE>", + "in": "query" + }, + { + "name": "username", + "description": "Source's Database Username.", + "required": true, + "type": "string", + "x-example": "<USERNAME>", + "in": "query" + }, + { + "name": "password", + "description": "Source's Database Password.", + "required": true, + "type": "string", + "x-example": "<PASSWORD>", + "in": "query" + }, + { + "name": "port", + "description": "Source's Database Port.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5432, + "in": "query" + } + ] + } + }, + "\/migrations\/supabase": { + "post": { + "summary": "Create Supabase migration", + "operationId": "migrationsCreateSupabaseMigration", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Migrate data from a Supabase project to your Appwrite project. This endpoint allows you to migrate resources like authentication, databases, and other supported services from a Supabase project. ", + "responses": { + "202": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "x-appwrite": { + "method": "createSupabaseMigration", + "group": null, + "weight": 313, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/create-supabase-migration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-supabase.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "List of resources to migrate", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "endpoint": { + "type": "string", + "description": "Source's Supabase Endpoint", + "default": null, + "x-example": "https:\/\/example.com" + }, + "apiKey": { + "type": "string", + "description": "Source's API Key", + "default": null, + "x-example": "<API_KEY>" + }, + "databaseHost": { + "type": "string", + "description": "Source's Database Host", + "default": null, + "x-example": "<DATABASE_HOST>" + }, + "username": { + "type": "string", + "description": "Source's Database Username", + "default": null, + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Source's Database Password", + "default": null, + "x-example": "<PASSWORD>" + }, + "port": { + "type": "integer", + "description": "Source's Database Port", + "default": 5432, + "x-example": null + } + }, + "required": [ + "resources", + "endpoint", + "apiKey", + "databaseHost", + "username", + "password" + ] + } + } + ] + } + }, + "\/migrations\/supabase\/report": { + "get": { + "summary": "Get Supabase migration report", + "operationId": "migrationsGetSupabaseReport", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Generate a report of the data in a Supabase project before migrating. This endpoint analyzes the source project and returns information about the resources that can be migrated. ", + "responses": { + "200": { + "description": "Migration Report", + "schema": { + "$ref": "#\/definitions\/migrationReport" + } + } + }, + "x-appwrite": { + "method": "getSupabaseReport", + "group": null, + "weight": 320, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/get-supabase-report.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/migration-supabase-report.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "resources", + "description": "List of resources to migrate", + "required": true, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "in": "query" + }, + { + "name": "endpoint", + "description": "Source's Supabase Endpoint.", + "required": true, + "type": "string", + "format": "url", + "x-example": "https:\/\/example.com", + "in": "query" + }, + { + "name": "apiKey", + "description": "Source's API Key.", + "required": true, + "type": "string", + "x-example": "<API_KEY>", + "in": "query" + }, + { + "name": "databaseHost", + "description": "Source's Database Host.", + "required": true, + "type": "string", + "x-example": "<DATABASE_HOST>", + "in": "query" + }, + { + "name": "username", + "description": "Source's Database Username.", + "required": true, + "type": "string", + "x-example": "<USERNAME>", + "in": "query" + }, + { + "name": "password", + "description": "Source's Database Password.", + "required": true, + "type": "string", + "x-example": "<PASSWORD>", + "in": "query" + }, + { + "name": "port", + "description": "Source's Database Port.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5432, + "in": "query" + } + ] + } + }, + "\/migrations\/{migrationId}": { + "get": { + "summary": "Get migration", + "operationId": "migrationsGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Get a migration by its unique ID. This endpoint returns detailed information about a specific migration including its current status, progress, and any errors that occurred during the migration process. ", + "responses": { + "200": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 317, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/get-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "migrationId", + "description": "Migration unique ID.", + "required": true, + "type": "string", + "x-example": "<MIGRATION_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update retry migration", + "operationId": "migrationsRetry", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "migrations" + ], + "description": "Retry a failed migration. This endpoint allows you to retry a migration that has previously failed.", + "responses": { + "202": { + "description": "Migration", + "schema": { + "$ref": "#\/definitions\/migration" + } + } + }, + "x-appwrite": { + "method": "retry", + "group": null, + "weight": 322, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/retry.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/retry-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "migrationId", + "description": "Migration unique ID.", + "required": true, + "type": "string", + "x-example": "<MIGRATION_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete migration", + "operationId": "migrationsDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "migrations" + ], + "description": "Delete a migration by its unique ID. This endpoint allows you to remove a migration from your project's migration history. ", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": null, + "weight": 323, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "migrations\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/migrations\/delete-migration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "migrations.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "migrationId", + "description": "Migration ID.", + "required": true, + "type": "string", + "x-example": "<MIGRATION_ID>", + "in": "path" + } + ] + } + }, + "\/project\/usage": { + "get": { + "summary": "Get project usage stats", + "operationId": "projectGetUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "project" + ], + "description": "Get comprehensive usage statistics for your project. View metrics including network requests, bandwidth, storage, function executions, database usage, and user activity. Specify a time range with startDate and endDate, and optionally set the data granularity with period (1h or 1d). The response includes both total counts and detailed breakdowns by resource, along with historical data over the specified period.", + "responses": { + "200": { + "description": "UsageProject", + "schema": { + "$ref": "#\/definitions\/usageProject" + } + } + }, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 202, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "project\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "startDate", + "description": "Starting date for the usage", + "required": true, + "type": "string", + "in": "query" + }, + { + "name": "endDate", + "description": "End date for the usage", + "required": true, + "type": "string", + "in": "query" + }, + { + "name": "period", + "description": "Period used", + "required": false, + "type": "string", + "x-example": "1h", + "enum": [ + "1h", + "1d" + ], + "x-enum-name": "ProjectUsageRange", + "x-enum-keys": [ + "One Hour", + "One Day" + ], + "default": "1d", + "in": "query" + } + ] + } + }, + "\/project\/variables": { + "get": { + "summary": "List variables", + "operationId": "projectListVariables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "project" + ], + "description": "Get a list of all project variables. These variables will be accessible in all Appwrite Functions at runtime.", + "responses": { + "200": { + "description": "Variables List", + "schema": { + "$ref": "#\/definitions\/variableList" + } + } + }, + "x-appwrite": { + "method": "listVariables", + "group": null, + "weight": 204, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "project\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/list-variables.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "projectCreateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "project" + ], + "description": "Create a new project variable. This variable will be accessible in all Appwrite Functions at runtime.", + "responses": { + "201": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "x-appwrite": { + "method": "createVariable", + "group": null, + "weight": 203, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "project\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/create-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only projects can read them during build and runtime.", + "default": true, + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + ] + } + }, + "\/project\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "projectGetVariable", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "project" + ], + "description": "Get a project variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "x-appwrite": { + "method": "getVariable", + "group": null, + "weight": 205, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "project\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/get-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "projectUpdateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "project" + ], + "description": "Update project variable by its unique ID. This variable will be accessible in all Appwrite Functions at runtime.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "x-appwrite": { + "method": "updateVariable", + "group": null, + "weight": 206, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "project\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/update-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only projects can read them during build and runtime.", + "default": null, + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + ] + }, + "delete": { + "summary": "Delete variable", + "operationId": "projectDeleteVariable", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "project" + ], + "description": "Delete a project variable by its unique ID. ", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteVariable", + "group": null, + "weight": 207, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "project\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/project\/delete-variable.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + } + }, + "\/projects": { + "get": { + "summary": "List projects", + "operationId": "projectsList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a list of all projects. You can use the query params to filter your results. ", + "responses": { + "200": { + "description": "Projects List", + "schema": { + "$ref": "#\/definitions\/projectList" + } + } + }, + "x-appwrite": { + "method": "list", + "group": "projects", + "weight": 157, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, teamId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create project", + "operationId": "projectsCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Create a new project. You can create a maximum of 100 projects per account. ", + "responses": { + "201": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "create", + "group": "projects", + "weight": 156, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "projectId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": null + }, + "name": { + "type": "string", + "description": "Project name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "teamId": { + "type": "string", + "description": "Team unique ID.", + "default": null, + "x-example": "<TEAM_ID>" + }, + "region": { + "type": "string", + "description": "Project Region.", + "default": "default", + "x-example": "default", + "enum": [ + "default" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "description": { + "type": "string", + "description": "Project description. Max length: 256 chars.", + "default": "", + "x-example": "<DESCRIPTION>" + }, + "logo": { + "type": "string", + "description": "Project logo.", + "default": "", + "x-example": "<LOGO>" + }, + "url": { + "type": "string", + "description": "Project URL.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "legalName": { + "type": "string", + "description": "Project legal Name. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_NAME>" + }, + "legalCountry": { + "type": "string", + "description": "Project legal Country. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_COUNTRY>" + }, + "legalState": { + "type": "string", + "description": "Project legal State. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_STATE>" + }, + "legalCity": { + "type": "string", + "description": "Project legal City. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_CITY>" + }, + "legalAddress": { + "type": "string", + "description": "Project legal Address. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_ADDRESS>" + }, + "legalTaxId": { + "type": "string", + "description": "Project legal Tax ID. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_TAX_ID>" + } + }, + "required": [ + "projectId", + "name", + "teamId" + ] + } + } + ] + } + }, + "\/projects\/{projectId}": { + "get": { + "summary": "Get project", + "operationId": "projectsGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a project by its unique ID. This endpoint allows you to retrieve the project's details, including its name, description, team, region, and other metadata. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "projects", + "weight": 158, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update project", + "operationId": "projectsUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update a project by its unique ID.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "update", + "group": "projects", + "weight": 159, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Project name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "description": { + "type": "string", + "description": "Project description. Max length: 256 chars.", + "default": "", + "x-example": "<DESCRIPTION>" + }, + "logo": { + "type": "string", + "description": "Project logo.", + "default": "", + "x-example": "<LOGO>" + }, + "url": { + "type": "string", + "description": "Project URL.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "legalName": { + "type": "string", + "description": "Project legal name. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_NAME>" + }, + "legalCountry": { + "type": "string", + "description": "Project legal country. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_COUNTRY>" + }, + "legalState": { + "type": "string", + "description": "Project legal state. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_STATE>" + }, + "legalCity": { + "type": "string", + "description": "Project legal city. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_CITY>" + }, + "legalAddress": { + "type": "string", + "description": "Project legal address. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_ADDRESS>" + }, + "legalTaxId": { + "type": "string", + "description": "Project legal tax ID. Max length: 256 chars.", + "default": "", + "x-example": "<LEGAL_TAX_ID>" + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete project", + "operationId": "projectsDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "projects" + ], + "description": "Delete a project by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "projects", + "weight": 176, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/api": { + "patch": { + "summary": "Update API status", + "operationId": "projectsUpdateApiStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateApiStatus", + "group": "projects", + "weight": 163, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-api-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "api": { + "type": "string", + "description": "API name.", + "default": null, + "x-example": "rest", + "enum": [ + "rest", + "graphql", + "realtime" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "status": { + "type": "boolean", + "description": "API status.", + "default": null, + "x-example": false + } + }, + "required": [ + "api", + "status" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/api\/all": { + "patch": { + "summary": "Update all API status", + "operationId": "projectsUpdateApiStatusAll", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateApiStatusAll", + "group": "projects", + "weight": 164, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-api-status-all.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-api-status-all.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "API status.", + "default": null, + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/duration": { + "patch": { + "summary": "Update project authentication duration", + "operationId": "projectsUpdateAuthDuration", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update how long sessions created within a project should stay active for.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateAuthDuration", + "group": "auth", + "weight": 169, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-auth-duration.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-duration.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "duration": { + "type": "integer", + "description": "Project session length in seconds. Max length: 31536000 seconds.", + "default": null, + "x-example": 0 + } + }, + "required": [ + "duration" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/limit": { + "patch": { + "summary": "Update project users limit", + "operationId": "projectsUpdateAuthLimit", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the maximum number of users allowed in this project. Set to 0 for unlimited users. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateAuthLimit", + "group": "auth", + "weight": 168, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-auth-limit.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-limit.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "description": "Set the max number of users allowed in this project. Use 0 for unlimited.", + "default": null, + "x-example": 0 + } + }, + "required": [ + "limit" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/max-sessions": { + "patch": { + "summary": "Update project user sessions limit", + "operationId": "projectsUpdateAuthSessionsLimit", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the maximum number of sessions allowed per user within the project, if the limit is hit the oldest session will be deleted to make room for new sessions.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateAuthSessionsLimit", + "group": "auth", + "weight": 174, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-auth-sessions-limit.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-sessions-limit.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "description": "Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10", + "default": null, + "x-example": 1 + } + }, + "required": [ + "limit" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/memberships-privacy": { + "patch": { + "summary": "Update project memberships privacy attributes", + "operationId": "projectsUpdateMembershipsPrivacy", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update project membership privacy settings. Use this endpoint to control what user information is visible to other team members, such as user name, email, and MFA status. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateMembershipsPrivacy", + "group": "auth", + "weight": 167, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-memberships-privacy.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-memberships-privacy.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userName": { + "type": "boolean", + "description": "Set to true to show userName to members of a team.", + "default": null, + "x-example": false + }, + "userEmail": { + "type": "boolean", + "description": "Set to true to show email to members of a team.", + "default": null, + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Set to true to show mfa to members of a team.", + "default": null, + "x-example": false + } + }, + "required": [ + "userName", + "userEmail", + "mfa" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/mock-numbers": { + "patch": { + "summary": "Update the mock numbers for the project", + "operationId": "projectsUpdateMockNumbers", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the list of mock phone numbers for testing. Use these numbers to bypass SMS verification in development. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateMockNumbers", + "group": "auth", + "weight": 175, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-mock-numbers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-mock-numbers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "numbers": { + "type": "array", + "description": "An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.", + "default": null, + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "numbers" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/password-dictionary": { + "patch": { + "summary": "Update authentication password dictionary status. Use this endpoint to enable or disable the dicitonary check for user password", + "operationId": "projectsUpdateAuthPasswordDictionary", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Enable or disable checking user passwords against common passwords dictionary. This helps ensure users don't use common and insecure passwords. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateAuthPasswordDictionary", + "group": "auth", + "weight": 172, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-auth-password-dictionary.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-dictionary.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Set whether or not to enable checking user's password against most commonly used passwords. Default is false.", + "default": null, + "x-example": false + } + }, + "required": [ + "enabled" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/password-history": { + "patch": { + "summary": "Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history.", + "operationId": "projectsUpdateAuthPasswordHistory", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the authentication password history requirement. Use this endpoint to require new passwords to be different than the last X amount of previously used ones.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateAuthPasswordHistory", + "group": "auth", + "weight": 171, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-auth-password-history.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-password-history.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "limit": { + "type": "integer", + "description": "Set the max number of passwords to store in user history. User can't choose a new password that is already stored in the password history list. Max number of passwords allowed in history is20. Default value is 0", + "default": null, + "x-example": 0 + } + }, + "required": [ + "limit" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/personal-data": { + "patch": { + "summary": "Update personal data check", + "operationId": "projectsUpdatePersonalDataCheck", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Enable or disable checking user passwords against their personal data. This helps prevent users from using personal information in their passwords. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updatePersonalDataCheck", + "group": "auth", + "weight": 173, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-personal-data-check.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-personal-data-check.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Set whether or not to check a password for similarity with personal data. Default is false.", + "default": null, + "x-example": false + } + }, + "required": [ + "enabled" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/session-alerts": { + "patch": { + "summary": "Update project sessions emails", + "operationId": "projectsUpdateSessionAlerts", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Enable or disable session email alerts. When enabled, users will receive email notifications when new sessions are created.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateSessionAlerts", + "group": "auth", + "weight": 166, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-session-alerts.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-session-alerts.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "alerts": { + "type": "boolean", + "description": "Set to true to enable session emails.", + "default": null, + "x-example": false + } + }, + "required": [ + "alerts" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/auth\/{method}": { + "patch": { + "summary": "Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.", + "operationId": "projectsUpdateAuthStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the status of a specific authentication method. Use this endpoint to enable or disable different authentication methods such as email, magic urls or sms in your project. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateAuthStatus", + "group": "auth", + "weight": 170, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-auth-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-auth-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "method", + "description": "Auth Method. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone", + "required": true, + "type": "string", + "x-example": "email-password", + "enum": [ + "email-password", + "magic-url", + "email-otp", + "anonymous", + "invites", + "jwt", + "phone" + ], + "x-enum-name": "AuthMethod", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "Set the status of this auth method.", + "default": null, + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/dev-keys": { + "get": { + "summary": "List dev keys", + "operationId": "projectsListDevKeys", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "List all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", + "responses": { + "200": { + "description": "Dev Keys List", + "schema": { + "$ref": "#\/definitions\/devKeyList" + } + } + }, + "x-appwrite": { + "method": "listDevKeys", + "group": "devKeys", + "weight": 373, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/list-dev-keys.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the project\\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: accessedAt, expire", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create dev key", + "operationId": "projectsCreateDevKey", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Create a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", + "responses": { + "201": { + "description": "DevKey", + "schema": { + "$ref": "#\/definitions\/devKey" + } + } + }, + "x-appwrite": { + "method": "createDevKey", + "group": "devKeys", + "weight": 370, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "default": null, + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/dev-keys\/{keyId}": { + "get": { + "summary": "Get dev key", + "operationId": "projectsGetDevKey", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", + "responses": { + "200": { + "description": "DevKey", + "schema": { + "$ref": "#\/definitions\/devKey" + } + } + }, + "x-appwrite": { + "method": "getDevKey", + "group": "devKeys", + "weight": 372, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a project\\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "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 dev key", + "operationId": "projectsUpdateDevKey", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", + "responses": { + "200": { + "description": "DevKey", + "schema": { + "$ref": "#\/definitions\/devKey" + } + } + }, + "x-appwrite": { + "method": "updateDevKey", + "group": "devKeys", + "weight": 371, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a project\\'s dev key by its unique ID. Use this endpoint to update a project\\'s dev key name or expiration time.'", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "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": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format.", + "default": null, + "x-example": null + } + }, + "required": [ + "name", + "expire" + ] + } + } + ] + }, + "delete": { + "summary": "Delete dev key", + "operationId": "projectsDeleteDevKey", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "projects" + ], + "description": "Delete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDevKey", + "group": "devKeys", + "weight": 374, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-dev-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a project\\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "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}\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "projectsCreateJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Create a new JWT token. This token can be used to authenticate users with custom scopes and expiration time. ", + "responses": { + "201": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "x-appwrite": { + "method": "createJWT", + "group": "auth", + "weight": 188, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-jwt.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "scopes": { + "type": "array", + "description": "List of scopes allowed for JWT key. Maximum of 100 scopes are allowed.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "duration": { + "type": "integer", + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "default": 900, + "x-example": 0 + } + }, + "required": [ + "scopes" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/keys": { + "get": { + "summary": "List keys", + "operationId": "projectsListKeys", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a list of all API keys from the current project. ", + "responses": { + "200": { + "description": "API Keys List", + "schema": { + "$ref": "#\/definitions\/keyList" + } + } + }, + "x-appwrite": { + "method": "listKeys", + "group": "keys", + "weight": 184, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/list-keys.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-keys.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create key", + "operationId": "projectsCreateKey", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.", + "responses": { + "201": { + "description": "Key", + "schema": { + "$ref": "#\/definitions\/key" + } + } + }, + "x-appwrite": { + "method": "createKey", + "group": "keys", + "weight": 183, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "scopes": { + "type": "array", + "description": "Key scopes list. Maximum of 100 scopes are allowed.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.", + "default": null, + "x-example": null + } + }, + "required": [ + "name", + "scopes" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/keys\/{keyId}": { + "get": { + "summary": "Get key", + "operationId": "projectsGetKey", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a key by its unique ID. This endpoint returns details about a specific API key in your project including it's scopes.", + "responses": { + "200": { + "description": "Key", + "schema": { + "$ref": "#\/definitions\/key" + } + } + }, + "x-appwrite": { + "method": "getKey", + "group": "keys", + "weight": 185, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "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": "projectsUpdateKey", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. ", + "responses": { + "200": { + "description": "Key", + "schema": { + "$ref": "#\/definitions\/key" + } + } + }, + "x-appwrite": { + "method": "updateKey", + "group": "keys", + "weight": 186, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "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": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Key name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "scopes": { + "type": "array", + "description": "Key scopes list. Maximum of 100 events are allowed.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "expire": { + "type": "string", + "description": "Expiration time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.", + "default": null, + "x-example": null + } + }, + "required": [ + "name", + "scopes" + ] + } + } + ] + }, + "delete": { + "summary": "Delete key", + "operationId": "projectsDeleteKey", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "projects" + ], + "description": "Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. ", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteKey", + "group": "keys", + "weight": 187, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-key.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-key.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "keys.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "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": "projectsUpdateOAuth2", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the OAuth2 provider configurations. Use this endpoint to set up or update the OAuth2 provider credentials or enable\/disable providers. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateOAuth2", + "group": "auth", + "weight": 165, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-o-auth2.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-oauth2.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "provider": { + "type": "string", + "description": "Provider Name", + "default": null, + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [] + }, + "appId": { + "type": "string", + "description": "Provider app ID. Max length: 256 chars.", + "default": null, + "x-example": "<APP_ID>" + }, + "secret": { + "type": "string", + "description": "Provider secret key. Max length: 512 chars.", + "default": null, + "x-example": "<SECRET>" + }, + "enabled": { + "type": "boolean", + "description": "Provider status. Set to 'false' to disable new session creation.", + "default": null, + "x-example": false + } + }, + "required": [ + "provider" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/platforms": { + "get": { + "summary": "List platforms", + "operationId": "projectsListPlatforms", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. ", + "responses": { + "200": { + "description": "Platforms List", + "schema": { + "$ref": "#\/definitions\/platformList" + } + } + }, + "x-appwrite": { + "method": "listPlatforms", + "group": "platforms", + "weight": 190, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/list-platforms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-platforms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create platform", + "operationId": "projectsCreatePlatform", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Create a new platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API.", + "responses": { + "201": { + "description": "Platform", + "schema": { + "$ref": "#\/definitions\/platform" + } + } + }, + "x-appwrite": { + "method": "createPlatform", + "group": "platforms", + "weight": 189, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Platform type.", + "default": null, + "x-example": "web", + "enum": [ + "web", + "flutter-web", + "flutter-ios", + "flutter-android", + "flutter-linux", + "flutter-macos", + "flutter-windows", + "apple-ios", + "apple-macos", + "apple-watchos", + "apple-tvos", + "android", + "unity", + "react-native-ios", + "react-native-android" + ], + "x-enum-name": "PlatformType", + "x-enum-keys": [] + }, + "name": { + "type": "string", + "description": "Platform name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "key": { + "type": "string", + "description": "Package name for Android or bundle ID for iOS or macOS. Max length: 256 chars.", + "default": "", + "x-example": "<KEY>" + }, + "store": { + "type": "string", + "description": "App store or Google Play store ID. Max length: 256 chars.", + "default": "", + "x-example": "<STORE>" + }, + "hostname": { + "type": "string", + "description": "Platform client hostname. Max length: 256 chars.", + "default": "", + "x-example": null + } + }, + "required": [ + "type", + "name" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/platforms\/{platformId}": { + "get": { + "summary": "Get platform", + "operationId": "projectsGetPlatform", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. ", + "responses": { + "200": { + "description": "Platform", + "schema": { + "$ref": "#\/definitions\/platform" + } + } + }, + "x-appwrite": { + "method": "getPlatform", + "group": "platforms", + "weight": 191, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "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": "projectsUpdatePlatform", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update a platform by its unique ID. Use this endpoint to update the platform's name, key, platform store ID, or hostname. ", + "responses": { + "200": { + "description": "Platform", + "schema": { + "$ref": "#\/definitions\/platform" + } + } + }, + "x-appwrite": { + "method": "updatePlatform", + "group": "platforms", + "weight": 192, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "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": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Platform name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "key": { + "type": "string", + "description": "Package name for android or bundle ID for iOS. Max length: 256 chars.", + "default": "", + "x-example": "<KEY>" + }, + "store": { + "type": "string", + "description": "App store or Google Play store ID. Max length: 256 chars.", + "default": "", + "x-example": "<STORE>" + }, + "hostname": { + "type": "string", + "description": "Platform client URL. Max length: 256 chars.", + "default": "", + "x-example": null + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete platform", + "operationId": "projectsDeletePlatform", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "projects" + ], + "description": "Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. ", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deletePlatform", + "group": "platforms", + "weight": 193, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-platform.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-platform.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "platforms.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "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}\/service": { + "patch": { + "summary": "Update service status", + "operationId": "projectsUpdateServiceStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the status of a specific service. Use this endpoint to enable or disable a service in your project. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateServiceStatus", + "group": "projects", + "weight": 161, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-service-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "service": { + "type": "string", + "description": "Service name.", + "default": null, + "x-example": "account", + "enum": [ + "account", + "avatars", + "databases", + "locale", + "health", + "storage", + "teams", + "users", + "sites", + "functions", + "graphql", + "messaging" + ], + "x-enum-name": "ApiService", + "x-enum-keys": [] + }, + "status": { + "type": "boolean", + "description": "Service status.", + "default": null, + "x-example": false + } + }, + "required": [ + "service", + "status" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/service\/all": { + "patch": { + "summary": "Update all service status", + "operationId": "projectsUpdateServiceStatusAll", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the status of all services. Use this endpoint to enable or disable all optional services at once. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateServiceStatusAll", + "group": "projects", + "weight": 162, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-service-status-all.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-service-status-all.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "Service status.", + "default": null, + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/smtp": { + "patch": { + "summary": "Update SMTP", + "operationId": "projectsUpdateSmtp", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. ", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateSmtp", + "group": "templates", + "weight": 194, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-smtp.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-smtp.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable custom SMTP service", + "default": null, + "x-example": false + }, + "senderName": { + "type": "string", + "description": "Name of the email sender", + "default": "", + "x-example": "<SENDER_NAME>" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "default": "", + "x-example": "email@example.com" + }, + "replyTo": { + "type": "string", + "description": "Reply to email", + "default": "", + "x-example": "email@example.com" + }, + "host": { + "type": "string", + "description": "SMTP server host name", + "default": "", + "x-example": null + }, + "port": { + "type": "integer", + "description": "SMTP server port", + "default": 587, + "x-example": null + }, + "username": { + "type": "string", + "description": "SMTP server username", + "default": "", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "SMTP server password", + "default": "", + "x-example": "<PASSWORD>" + }, + "secure": { + "type": "string", + "description": "Does SMTP server use secure connection", + "default": "", + "x-example": "tls", + "enum": [ + "tls", + "ssl" + ], + "x-enum-name": "SMTPSecure", + "x-enum-keys": [] + } + }, + "required": [ + "enabled" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/smtp\/tests": { + "post": { + "summary": "Create SMTP test", + "operationId": "projectsCreateSmtpTest", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Send a test email to verify SMTP configuration. ", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "createSmtpTest", + "group": "templates", + "weight": 195, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-smtp-test.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-smtp-test.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "emails": { + "type": "array", + "description": "Array of emails to send test email to. Maximum of 10 emails are allowed.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "senderName": { + "type": "string", + "description": "Name of the email sender", + "default": null, + "x-example": "<SENDER_NAME>" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "default": null, + "x-example": "email@example.com" + }, + "replyTo": { + "type": "string", + "description": "Reply to email", + "default": "", + "x-example": "email@example.com" + }, + "host": { + "type": "string", + "description": "SMTP server host name", + "default": null, + "x-example": null + }, + "port": { + "type": "integer", + "description": "SMTP server port", + "default": 587, + "x-example": null + }, + "username": { + "type": "string", + "description": "SMTP server username", + "default": "", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "SMTP server password", + "default": "", + "x-example": "<PASSWORD>" + }, + "secure": { + "type": "string", + "description": "Does SMTP server use secure connection", + "default": "", + "x-example": "tls", + "enum": [ + "tls", + "ssl" + ], + "x-enum-name": "SMTPSecure", + "x-enum-keys": [] + } + }, + "required": [ + "emails", + "senderName", + "senderEmail", + "host" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/team": { + "patch": { + "summary": "Update project team", + "operationId": "projectsUpdateTeam", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the team ID of a project allowing for it to be transferred to another team.", + "responses": { + "200": { + "description": "Project", + "schema": { + "$ref": "#\/definitions\/project" + } + } + }, + "x-appwrite": { + "method": "updateTeam", + "group": "projects", + "weight": 160, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-team.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-team.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID of the team to transfer project to.", + "default": null, + "x-example": "<TEAM_ID>" + } + }, + "required": [ + "teamId" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/templates\/email\/{type}\/{locale}": { + "get": { + "summary": "Get custom email template", + "operationId": "projectsGetEmailTemplate", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. ", + "responses": { + "200": { + "description": "EmailTemplate", + "schema": { + "$ref": "#\/definitions\/emailTemplate" + } + } + }, + "x-appwrite": { + "method": "getEmailTemplate", + "group": "templates", + "weight": 197, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-email-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "magicsession", + "recovery", + "invitation", + "mfachallenge", + "sessionalert", + "otpsession" + ], + "x-enum-name": "EmailTemplateType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "EmailTemplateLocale", + "x-enum-keys": [], + "in": "path" + } + ] + }, + "patch": { + "summary": "Update custom email templates", + "operationId": "projectsUpdateEmailTemplate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.", + "responses": { + "200": { + "description": "EmailTemplate", + "schema": { + "$ref": "#\/definitions\/emailTemplate" + } + } + }, + "x-appwrite": { + "method": "updateEmailTemplate", + "group": "templates", + "weight": 199, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-email-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "magicsession", + "recovery", + "invitation", + "mfachallenge", + "sessionalert", + "otpsession" + ], + "x-enum-name": "EmailTemplateType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "EmailTemplateLocale", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "subject": { + "type": "string", + "description": "Email Subject", + "default": null, + "x-example": "<SUBJECT>" + }, + "message": { + "type": "string", + "description": "Template message", + "default": null, + "x-example": "<MESSAGE>" + }, + "senderName": { + "type": "string", + "description": "Name of the email sender", + "default": "", + "x-example": "<SENDER_NAME>" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "default": "", + "x-example": "email@example.com" + }, + "replyTo": { + "type": "string", + "description": "Reply to email", + "default": "", + "x-example": "email@example.com" + } + }, + "required": [ + "subject", + "message" + ] + } + } + ] + }, + "delete": { + "summary": "Delete custom email template", + "operationId": "projectsDeleteEmailTemplate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Reset a custom email template to its default value. This endpoint removes any custom content and restores the template to its original state. ", + "responses": { + "200": { + "description": "EmailTemplate", + "schema": { + "$ref": "#\/definitions\/emailTemplate" + } + } + }, + "x-appwrite": { + "method": "deleteEmailTemplate", + "group": "templates", + "weight": 201, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-email-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-email-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "magicsession", + "recovery", + "invitation", + "mfachallenge", + "sessionalert", + "otpsession" + ], + "x-enum-name": "EmailTemplateType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "EmailTemplateLocale", + "x-enum-keys": [], + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/templates\/sms\/{type}\/{locale}": { + "get": { + "summary": "Get custom SMS template", + "operationId": "projectsGetSmsTemplate", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a custom SMS template for the specified locale and type returning it's contents.", + "responses": { + "200": { + "description": "SmsTemplate", + "schema": { + "$ref": "#\/definitions\/smsTemplate" + } + } + }, + "x-appwrite": { + "method": "getSmsTemplate", + "group": "templates", + "weight": 196, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-sms-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-sms-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "login", + "invitation", + "mfachallenge" + ], + "x-enum-name": "SmsTemplateType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "SmsTemplateLocale", + "x-enum-keys": [], + "in": "path" + } + ] + }, + "patch": { + "summary": "Update custom SMS template", + "operationId": "projectsUpdateSmsTemplate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. ", + "responses": { + "200": { + "description": "SmsTemplate", + "schema": { + "$ref": "#\/definitions\/smsTemplate" + } + } + }, + "x-appwrite": { + "method": "updateSmsTemplate", + "group": "templates", + "weight": 198, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-sms-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-sms-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "login", + "invitation", + "mfachallenge" + ], + "x-enum-name": "SmsTemplateType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "SmsTemplateLocale", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Template message", + "default": null, + "x-example": "<MESSAGE>" + } + }, + "required": [ + "message" + ] + } + } + ] + }, + "delete": { + "summary": "Reset custom SMS template", + "operationId": "projectsDeleteSmsTemplate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. ", + "responses": { + "200": { + "description": "SmsTemplate", + "schema": { + "$ref": "#\/definitions\/smsTemplate" + } + } + }, + "x-appwrite": { + "method": "deleteSmsTemplate", + "group": "templates", + "weight": 200, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-sms-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-sms-template.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Template type", + "required": true, + "type": "string", + "x-example": "verification", + "enum": [ + "verification", + "login", + "invitation", + "mfachallenge" + ], + "x-enum-name": "SmsTemplateType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "locale", + "description": "Template locale", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ar-ae", + "ar-bh", + "ar-dz", + "ar-eg", + "ar-iq", + "ar-jo", + "ar-kw", + "ar-lb", + "ar-ly", + "ar-ma", + "ar-om", + "ar-qa", + "ar-sa", + "ar-sy", + "ar-tn", + "ar-ye", + "as", + "az", + "be", + "bg", + "bh", + "bn", + "bs", + "ca", + "cs", + "cy", + "da", + "de", + "de-at", + "de-ch", + "de-li", + "de-lu", + "el", + "en", + "en-au", + "en-bz", + "en-ca", + "en-gb", + "en-ie", + "en-jm", + "en-nz", + "en-tt", + "en-us", + "en-za", + "eo", + "es", + "es-ar", + "es-bo", + "es-cl", + "es-co", + "es-cr", + "es-do", + "es-ec", + "es-gt", + "es-hn", + "es-mx", + "es-ni", + "es-pa", + "es-pe", + "es-pr", + "es-py", + "es-sv", + "es-uy", + "es-ve", + "et", + "eu", + "fa", + "fi", + "fo", + "fr", + "fr-be", + "fr-ca", + "fr-ch", + "fr-lu", + "ga", + "gd", + "he", + "hi", + "hr", + "hu", + "id", + "is", + "it", + "it-ch", + "ja", + "ji", + "ko", + "ku", + "lt", + "lv", + "mk", + "ml", + "ms", + "mt", + "nb", + "ne", + "nl", + "nl-be", + "nn", + "no", + "pa", + "pl", + "pt", + "pt-br", + "rm", + "ro", + "ro-md", + "ru", + "ru-md", + "sb", + "sk", + "sl", + "sq", + "sr", + "sv", + "sv-fi", + "th", + "tn", + "tr", + "ts", + "ua", + "ur", + "ve", + "vi", + "xh", + "zh-cn", + "zh-hk", + "zh-sg", + "zh-tw", + "zu" + ], + "x-enum-name": "SmsTemplateLocale", + "x-enum-keys": [], + "in": "path" + } + ] + } + }, + "\/projects\/{projectId}\/webhooks": { + "get": { + "summary": "List webhooks", + "operationId": "projectsListWebhooks", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a list of all webhooks belonging to the project. You can use the query params to filter your results. ", + "responses": { + "200": { + "description": "Webhooks List", + "schema": { + "$ref": "#\/definitions\/webhookList" + } + } + }, + "x-appwrite": { + "method": "listWebhooks", + "group": "webhooks", + "weight": 178, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/list-webhooks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/list-webhooks.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create webhook", + "operationId": "projectsCreateWebhook", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. ", + "responses": { + "201": { + "description": "Webhook", + "schema": { + "$ref": "#\/definitions\/webhook" + } + } + }, + "x-appwrite": { + "method": "createWebhook", + "group": "webhooks", + "weight": 177, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/create-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/create-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "projectId", + "description": "Project unique ID.", + "required": true, + "type": "string", + "x-example": "<PROJECT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Webhook name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Enable or disable a webhook.", + "default": true, + "x-example": false + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "Webhook URL.", + "default": null, + "x-example": null + }, + "security": { + "type": "boolean", + "description": "Certificate verification, false for disabled or true for enabled.", + "default": null, + "x-example": false + }, + "httpUser": { + "type": "string", + "description": "Webhook HTTP user. Max length: 256 chars.", + "default": "", + "x-example": "<HTTP_USER>" + }, + "httpPass": { + "type": "string", + "description": "Webhook HTTP password. Max length: 256 chars.", + "default": "", + "x-example": "<HTTP_PASS>" + } + }, + "required": [ + "name", + "events", + "url", + "security" + ] + } + } + ] + } + }, + "\/projects\/{projectId}\/webhooks\/{webhookId}": { + "get": { + "summary": "Get webhook", + "operationId": "projectsGetWebhook", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. ", + "responses": { + "200": { + "description": "Webhook", + "schema": { + "$ref": "#\/definitions\/webhook" + } + } + }, + "x-appwrite": { + "method": "getWebhook", + "group": "webhooks", + "weight": 179, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/get-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/get-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "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": "projectsUpdateWebhook", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. ", + "responses": { + "200": { + "description": "Webhook", + "schema": { + "$ref": "#\/definitions\/webhook" + } + } + }, + "x-appwrite": { + "method": "updateWebhook", + "group": "webhooks", + "weight": 180, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "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": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Webhook name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Enable or disable a webhook.", + "default": true, + "x-example": false + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "Webhook URL.", + "default": null, + "x-example": null + }, + "security": { + "type": "boolean", + "description": "Certificate verification, false for disabled or true for enabled.", + "default": null, + "x-example": false + }, + "httpUser": { + "type": "string", + "description": "Webhook HTTP user. Max length: 256 chars.", + "default": "", + "x-example": "<HTTP_USER>" + }, + "httpPass": { + "type": "string", + "description": "Webhook HTTP password. Max length: 256 chars.", + "default": "", + "x-example": "<HTTP_PASS>" + } + }, + "required": [ + "name", + "events", + "url", + "security" + ] + } + } + ] + }, + "delete": { + "summary": "Delete webhook", + "operationId": "projectsDeleteWebhook", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "projects" + ], + "description": "Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. ", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteWebhook", + "group": "webhooks", + "weight": 182, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/delete-webhook.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/delete-webhook.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "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" + } + ] + } + }, + "\/projects\/{projectId}\/webhooks\/{webhookId}\/signature": { + "patch": { + "summary": "Update webhook signature key", + "operationId": "projectsUpdateWebhookSignature", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "projects" + ], + "description": "Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. ", + "responses": { + "200": { + "description": "Webhook", + "schema": { + "$ref": "#\/definitions\/webhook" + } + } + }, + "x-appwrite": { + "method": "updateWebhookSignature", + "group": "webhooks", + "weight": 181, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "projects\/update-webhook-signature.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/projects\/update-webhook-signature.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "projects.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "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" + } + ] + } + }, + "\/proxy\/rules": { + "get": { + "summary": "List rules", + "operationId": "proxyListRules", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "proxy" + ], + "description": "Get a list of all the proxy rules. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Rule List", + "schema": { + "$ref": "#\/definitions\/proxyRuleList" + } + } + }, + "x-appwrite": { + "method": "listRules", + "group": null, + "weight": 294, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/list-rules.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/list-rules.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: domain, type, trigger, deploymentResourceType, deploymentResourceId, deploymentId, deploymentVcsProviderBranch", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/proxy\/rules\/api": { + "post": { + "summary": "Create API rule", + "operationId": "proxyCreateAPIRule", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for serving Appwrite's API on custom domain.", + "responses": { + "201": { + "description": "Rule", + "schema": { + "$ref": "#\/definitions\/proxyRule" + } + } + }, + "x-appwrite": { + "method": "createAPIRule", + "group": null, + "weight": 435, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/create-a-p-i-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for serving Appwrite's API on custom domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "default": null, + "x-example": null + } + }, + "required": [ + "domain" + ] + } + } + ] + } + }, + "\/proxy\/rules\/function": { + "post": { + "summary": "Create function rule", + "operationId": "proxyCreateFunctionRule", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for executing Appwrite Function on custom domain.", + "responses": { + "201": { + "description": "Rule", + "schema": { + "$ref": "#\/definitions\/proxyRule" + } + } + }, + "x-appwrite": { + "method": "createFunctionRule", + "group": null, + "weight": 437, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/create-function-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for executing Appwrite Function on custom domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "default": null, + "x-example": null + }, + "functionId": { + "type": "string", + "description": "ID of function to be executed.", + "default": null, + "x-example": "<FUNCTION_ID>" + }, + "branch": { + "type": "string", + "description": "Name of VCS branch to deploy changes automatically", + "default": "", + "x-example": "<BRANCH>" + } + }, + "required": [ + "domain", + "functionId" + ] + } + } + ] + } + }, + "\/proxy\/rules\/redirect": { + "post": { + "summary": "Create Redirect rule", + "operationId": "proxyCreateRedirectRule", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for to redirect from custom domain to another domain.", + "responses": { + "201": { + "description": "Rule", + "schema": { + "$ref": "#\/definitions\/proxyRule" + } + } + }, + "x-appwrite": { + "method": "createRedirectRule", + "group": null, + "weight": 438, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/create-redirect-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for to redirect from custom domain to another domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "default": null, + "x-example": null + }, + "url": { + "type": "string", + "description": "Target URL of redirection", + "default": null, + "x-example": "https:\/\/example.com" + }, + "statusCode": { + "type": "string", + "description": "Status code of redirection", + "default": null, + "x-example": "301", + "enum": [ + "301", + "302", + "307", + "308" + ], + "x-enum-name": null, + "x-enum-keys": [ + "Moved Permanently 301", + "Found 302", + "Temporary Redirect 307", + "Permanent Redirect 308" + ] + }, + "resourceId": { + "type": "string", + "description": "ID of parent resource.", + "default": null, + "x-example": "<RESOURCE_ID>" + }, + "resourceType": { + "type": "string", + "description": "Type of parent resource.", + "default": null, + "x-example": "site", + "enum": [ + "site", + "function" + ], + "x-enum-name": "ProxyResourceType", + "x-enum-keys": [ + "Site", + "Function" + ] + } + }, + "required": [ + "domain", + "url", + "statusCode", + "resourceId", + "resourceType" + ] + } + } + ] + } + }, + "\/proxy\/rules\/site": { + "post": { + "summary": "Create site rule", + "operationId": "proxyCreateSiteRule", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "proxy" + ], + "description": "Create a new proxy rule for serving Appwrite Site on custom domain.", + "responses": { + "201": { + "description": "Rule", + "schema": { + "$ref": "#\/definitions\/proxyRule" + } + } + }, + "x-appwrite": { + "method": "createSiteRule", + "group": null, + "weight": 436, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/create-site-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new proxy rule for serving Appwrite Site on custom domain.", + "rate-limit": 10, + "rate-time": 60, + "rate-key": "userId:{userId}, url:{url}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "description": "Domain name.", + "default": null, + "x-example": null + }, + "siteId": { + "type": "string", + "description": "ID of site to be executed.", + "default": null, + "x-example": "<SITE_ID>" + }, + "branch": { + "type": "string", + "description": "Name of VCS branch to deploy changes automatically", + "default": "", + "x-example": "<BRANCH>" + } + }, + "required": [ + "domain", + "siteId" + ] + } + } + ] + } + }, + "\/proxy\/rules\/{ruleId}": { + "get": { + "summary": "Get rule", + "operationId": "proxyGetRule", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "proxy" + ], + "description": "Get a proxy rule by its unique ID.", + "responses": { + "200": { + "description": "Rule", + "schema": { + "$ref": "#\/definitions\/proxyRule" + } + } + }, + "x-appwrite": { + "method": "getRule", + "group": null, + "weight": 295, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/get-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/get-rule.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "type": "string", + "x-example": "<RULE_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete rule", + "operationId": "proxyDeleteRule", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "proxy" + ], + "description": "Delete a proxy rule by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteRule", + "group": null, + "weight": 296, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/delete-rule.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/delete-rule.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "type": "string", + "x-example": "<RULE_ID>", + "in": "path" + } + ] + } + }, + "\/proxy\/rules\/{ruleId}\/verification": { + "patch": { + "summary": "Update rule verification status", + "operationId": "proxyUpdateRuleVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "proxy" + ], + "description": "Retry getting verification process of a proxy rule. This endpoint triggers domain verification by checking DNS records (CNAME) against the configured target domain. If verification is successful, a TLS certificate will be automatically provisioned for the domain.", + "responses": { + "200": { + "description": "Rule", + "schema": { + "$ref": "#\/definitions\/proxyRule" + } + } + }, + "x-appwrite": { + "method": "updateRuleVerification", + "group": null, + "weight": 297, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "proxy\/update-rule-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/proxy\/update-rule-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "rules.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "ruleId", + "description": "Rule ID.", + "required": true, + "type": "string", + "x-example": "<RULE_ID>", + "in": "path" + } + ] + } + }, + "\/sites": { + "get": { + "summary": "List sites", + "operationId": "sitesList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all the project's sites. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Sites List", + "schema": { + "$ref": "#\/definitions\/siteList" + } + } + }, + "x-appwrite": { + "method": "list", + "group": "sites", + "weight": 407, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's sites. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create site", + "operationId": "sitesCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new site.", + "responses": { + "201": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "x-appwrite": { + "method": "create", + "group": "sites", + "weight": 405, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "siteId": { + "type": "string", + "description": "Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<SITE_ID>" + }, + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "default": null, + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "default": true, + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "default": 30, + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "default": "", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "default": "", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "default": "", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "default": null, + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "default": "", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "default": "", + "x-example": "<FALLBACK_FILE>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "siteId", + "name", + "framework", + "buildRuntime" + ] + } + } + ] + } + }, + "\/sites\/frameworks": { + "get": { + "summary": "List frameworks", + "operationId": "sitesListFrameworks", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all frameworks that are currently available on the server instance.", + "responses": { + "200": { + "description": "Frameworks List", + "schema": { + "$ref": "#\/definitions\/frameworkList" + } + } + }, + "x-appwrite": { + "method": "listFrameworks", + "group": "frameworks", + "weight": 410, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-frameworks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all frameworks that are currently available on the server instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "sitesListSpecifications", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "List allowed site specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "schema": { + "$ref": "#\/definitions\/specificationList" + } + } + }, + "x-appwrite": { + "method": "listSpecifications", + "group": "frameworks", + "weight": 433, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed site specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/templates": { + "get": { + "summary": "List templates", + "operationId": "sitesListTemplates", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "List available site templates. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "responses": { + "200": { + "description": "Site Templates List", + "schema": { + "$ref": "#\/definitions\/templateSiteList" + } + } + }, + "x-appwrite": { + "method": "listTemplates", + "group": "templates", + "weight": 429, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-templates.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList available site templates. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "frameworks", + "description": "List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "useCases", + "description": "List of use cases allowed for filtering site templates. Maximum of 100 use cases are allowed.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "limit", + "description": "Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 1, + "default": 25, + "in": "query" + }, + { + "name": "offset", + "description": "Offset the list of returned templates. Maximum offset is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + } + ] + } + }, + "\/sites\/templates\/{templateId}": { + "get": { + "summary": "Get site template", + "operationId": "sitesGetTemplate", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a site template using ID. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "responses": { + "200": { + "description": "Template Site", + "schema": { + "$ref": "#\/definitions\/templateSite" + } + } + }, + "x-appwrite": { + "method": "getTemplate", + "group": "templates", + "weight": 430, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-template.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site template using ID. You can use template details in [createSite](\/docs\/references\/cloud\/server-nodejs\/sites#create) method.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "templateId", + "description": "Template ID.", + "required": true, + "type": "string", + "x-example": "<TEMPLATE_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/usage": { + "get": { + "summary": "Get sites usage", + "operationId": "sitesListUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get usage metrics and statistics for all sites in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageSites", + "schema": { + "$ref": "#\/definitions\/usageSites" + } + } + }, + "x-appwrite": { + "method": "listUsage", + "group": null, + "weight": 431, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for all sites in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "SiteUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}": { + "get": { + "summary": "Get site", + "operationId": "sitesGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "sites", + "weight": 406, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update site", + "operationId": "sitesUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Update site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "x-appwrite": { + "method": "update", + "group": "sites", + "weight": 408, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "default": null, + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "default": true, + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "default": 30, + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "default": "", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "default": "", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "default": "", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "default": "", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "default": "", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "default": "", + "x-example": "<FALLBACK_FILE>" + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "name", + "framework" + ] + } + } + ] + }, + "delete": { + "summary": "Delete site", + "operationId": "sitesDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "sites" + ], + "description": "Delete a site by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "sites", + "weight": 409, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployment": { + "patch": { + "summary": "Update site's deployment", + "operationId": "sitesUpdateSiteDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "responses": { + "200": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "x-appwrite": { + "method": "updateSiteDeployment", + "group": "sites", + "weight": 416, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update-site-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "sitesListDeployments", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all the site's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "schema": { + "$ref": "#\/definitions\/deploymentList" + } + } + }, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 415, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the site's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "sitesCreateDeployment", + "consumes": [ + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 411, + "cookies": false, + "type": "upload", + "deprecated": false, + "demo": "sites\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "installCommand", + "description": "Install Commands.", + "required": false, + "type": "string", + "x-example": "<INSTALL_COMMAND>", + "in": "formData" + }, + { + "name": "buildCommand", + "description": "Build Commands.", + "required": false, + "type": "string", + "x-example": "<BUILD_COMMAND>", + "in": "formData" + }, + { + "name": "outputDirectory", + "description": "Output Directory.", + "required": false, + "type": "string", + "x-example": "<OUTPUT_DIRECTORY>", + "in": "formData" + }, + { + "name": "code", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "required": true, + "type": "file", + "in": "formData" + }, + { + "name": "activate", + "description": "Automatically activate the deployment when it is finished building.", + "required": true, + "type": "boolean", + "x-example": false, + "in": "formData" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "sitesCreateDuplicateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 419, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "sitesCreateTemplateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 412, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "default": null, + "x-example": "<REPOSITORY>" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "default": null, + "x-example": "<OWNER>" + }, + "rootDirectory": { + "type": "string", + "description": "Path to site code in the template repo.", + "default": null, + "x-example": "<ROOT_DIRECTORY>" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the site template.", + "default": null, + "x-example": "<VERSION>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "sitesCreateVcsDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 413, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "default": null, + "x-example": "branch", + "enum": [ + "branch", + "commit", + "tag" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "default": null, + "x-example": "<REFERENCE>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "sitesGetDeployment", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a site deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 414, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "sitesDeleteDeployment", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "sites" + ], + "description": "Delete a site deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 417, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "sitesGetDeploymentDownload", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "sites" + ], + "description": "Get a site deployment 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.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 418, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "sites\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment 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.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source", + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "sitesUpdateDeploymentStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 420, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/logs": { + "get": { + "summary": "List logs", + "operationId": "sitesListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all site logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "schema": { + "$ref": "#\/definitions\/executionList" + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 422, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all site logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/logs\/{logId}": { + "get": { + "summary": "Get log", + "operationId": "sitesGetLog", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a site request log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "x-appwrite": { + "method": "getLog", + "group": "logs", + "weight": 421, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site request log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "type": "string", + "x-example": "<LOG_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete log", + "operationId": "sitesDeleteLog", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Delete a site log by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteLog", + "group": "logs", + "weight": 423, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "type": "string", + "x-example": "<LOG_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/usage": { + "get": { + "summary": "Get site usage", + "operationId": "sitesGetUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get usage metrics and statistics for a for a specific site. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "responses": { + "200": { + "description": "UsageSite", + "schema": { + "$ref": "#\/definitions\/usageSite" + } + } + }, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 432, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet usage metrics and statistics for a for a specific site. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "SiteUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "sitesListVariables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all variables of a specific site.", + "responses": { + "200": { + "description": "Variables List", + "schema": { + "$ref": "#\/definitions\/variableList" + } + } + }, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 426, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "sitesCreateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "responses": { + "201": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 424, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "default": true, + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "sitesGetVariable", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 425, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "sitesUpdateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 427, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "default": null, + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + ] + }, + "delete": { + "summary": "Delete variable", + "operationId": "sitesDeleteVariable", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "sites" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 428, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets": { + "get": { + "summary": "List buckets", + "operationId": "storageListBuckets", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a list of all the storage buckets. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Buckets List", + "schema": { + "$ref": "#\/definitions\/bucketList" + } + } + }, + "x-appwrite": { + "method": "listBuckets", + "group": "buckets", + "weight": 209, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/list-buckets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create bucket", + "operationId": "storageCreateBucket", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Create a new storage bucket.", + "responses": { + "201": { + "description": "Bucket", + "schema": { + "$ref": "#\/definitions\/bucket" + } + } + }, + "x-appwrite": { + "method": "createBucket", + "group": "buckets", + "weight": 208, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/create-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<BUCKET_ID>" + }, + "name": { + "type": "string", + "description": "Bucket name", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "default": true, + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "default": {}, + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "default": "none", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "default": true, + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "default": true, + "x-example": false + } + }, + "required": [ + "bucketId", + "name" + ] + } + } + ] + } + }, + "\/storage\/buckets\/{bucketId}": { + "get": { + "summary": "Get bucket", + "operationId": "storageGetBucket", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.", + "responses": { + "200": { + "description": "Bucket", + "schema": { + "$ref": "#\/definitions\/bucket" + } + } + }, + "x-appwrite": { + "method": "getBucket", + "group": "buckets", + "weight": 210, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/get-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update bucket", + "operationId": "storageUpdateBucket", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Update a storage bucket by its unique ID.", + "responses": { + "200": { + "description": "Bucket", + "schema": { + "$ref": "#\/definitions\/bucket" + } + } + }, + "x-appwrite": { + "method": "updateBucket", + "group": "buckets", + "weight": 211, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/update-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Bucket name", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "default": true, + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "default": {}, + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "default": "none", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "default": true, + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete bucket", + "operationId": "storageDeleteBucket", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "storage" + ], + "description": "Delete a storage bucket by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteBucket", + "group": "buckets", + "weight": 212, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/delete-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files": { + "get": { + "summary": "List files", + "operationId": "storageListFiles", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a list of all the user files. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Files List", + "schema": { + "$ref": "#\/definitions\/fileList" + } + } + }, + "x-appwrite": { + "method": "listFiles", + "group": "files", + "weight": 214, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create file", + "operationId": "storageCreateFile", + "consumes": [ + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "x-appwrite": { + "method": "createFile", + "group": "files", + "weight": 213, + "cookies": false, + "type": "upload", + "deprecated": false, + "demo": "storage\/create-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "x-upload-id": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "formData" + }, + { + "name": "file", + "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", + "required": true, + "type": "file", + "in": "formData" + }, + { + "name": "permissions", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "x-example": "[\"read(\"any\")\"]", + "in": "formData" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "Get file", + "operationId": "storageGetFile", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.", + "responses": { + "200": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "x-appwrite": { + "method": "getFile", + "group": "files", + "weight": 215, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update file", + "operationId": "storageUpdateFile", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "x-appwrite": { + "method": "updateFile", + "group": "files", + "weight": 220, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/update-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the file", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete file", + "operationId": "storageDeleteFile", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "storage" + ], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteFile", + "group": "files", + "weight": 221, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/delete-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download": { + "get": { + "summary": "Get file for download", + "operationId": "storageGetFileDownload", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "storage" + ], + "description": "Get a 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.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getFileDownload", + "group": "files", + "weight": 217, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/preview": { + "get": { + "summary": "Get file preview", + "operationId": "storageGetFilePreview", + "consumes": [], + "produces": [ + "image\/*" + ], + "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. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getFilePreview", + "group": "files", + "weight": 216, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File 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": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "type": "string", + "x-example": "center", + "enum": [ + "center", + "top-left", + "top", + "top-right", + "left", + "right", + "bottom-left", + "bottom", + "bottom-right" + ], + "x-enum-name": "ImageGravity", + "x-enum-keys": [], + "default": "center", + "in": "query" + }, + { + "name": "quality", + "description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + }, + { + "name": "borderWidth", + "description": "Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "borderColor", + "description": "Preview image border color. Use a valid HEX color, no # is needed for prefix.", + "required": false, + "type": "string", + "default": "", + "in": "query" + }, + { + "name": "borderRadius", + "description": "Preview image border radius in pixels. Pass an integer between 0 to 4000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "opacity", + "description": "Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.", + "required": false, + "type": "number", + "format": "float", + "x-example": 0, + "default": 1, + "in": "query" + }, + { + "name": "rotation", + "description": "Preview image rotation in degrees. Pass an integer between -360 and 360.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -360, + "default": 0, + "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", + "enum": [ + "jpg", + "jpeg", + "png", + "webp", + "heic", + "avif", + "gif" + ], + "x-enum-name": "ImageFormat", + "x-enum-keys": [], + "default": "", + "in": "query" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/view": { + "get": { + "summary": "Get file for view", + "operationId": "storageGetFileView", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getFileView", + "group": "files", + "weight": 218, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/storage\/usage": { + "get": { + "summary": "Get storage usage stats", + "operationId": "storageGetUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get usage metrics and statistics for all buckets in the project. You can view the total number of buckets, files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", + "responses": { + "200": { + "description": "StorageUsage", + "schema": { + "$ref": "#\/definitions\/usageStorage" + } + } + }, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 222, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "StorageUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/storage\/{bucketId}\/usage": { + "get": { + "summary": "Get bucket usage stats", + "operationId": "storageGetBucketUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get usage metrics and statistics a specific bucket in the project. You can view the total number of files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", + "responses": { + "200": { + "description": "UsageBuckets", + "schema": { + "$ref": "#\/definitions\/usageBuckets" + } + } + }, + "x-appwrite": { + "method": "getBucketUsage", + "group": null, + "weight": 223, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/get-bucket-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "files.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket ID.", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "StorageUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/teams": { + "get": { + "summary": "List teams", + "operationId": "teamsList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.", + "responses": { + "200": { + "description": "Teams List", + "schema": { + "$ref": "#\/definitions\/teamList" + } + } + }, + "x-appwrite": { + "method": "list", + "group": "teams", + "weight": 225, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create team", + "operationId": "teamsCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "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. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "x-appwrite": { + "method": "create", + "group": "teams", + "weight": 224, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TEAM_ID>" + }, + "name": { + "type": "string", + "description": "Team name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "roles": { + "type": "array", + "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](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": [ + "owner" + ], + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "teamId", + "name" + ] + } + } + ] + } + }, + "\/teams\/{teamId}": { + "get": { + "summary": "Get team", + "operationId": "teamsGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "teams", + "weight": 226, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update name", + "operationId": "teamsUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Update the team's name by its unique ID.", + "responses": { + "200": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "teams", + "weight": 228, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "New team name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete team", + "operationId": "teamsDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "teams" + ], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "teams", + "weight": 230, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/logs": { + "get": { + "summary": "List team logs", + "operationId": "teamsListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get the team activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 237, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/teams\/{teamId}\/memberships": { + "get": { + "summary": "List team memberships", + "operationId": "teamsListMemberships", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Memberships List", + "schema": { + "$ref": "#\/definitions\/membershipList" + } + } + }, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 232, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create team membership", + "operationId": "teamsCreateMembership", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", + "responses": { + "201": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "x-appwrite": { + "method": "createMembership", + "group": "memberships", + "weight": 231, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/create-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the new team member.", + "default": "", + "x-example": "email@example.com" + }, + "userId": { + "type": "string", + "description": "ID of the user to be added to a team.", + "default": "", + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "roles": { + "type": "array", + "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](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "name": { + "type": "string", + "description": "Name of the new team member. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "roles" + ] + } + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}": { + "get": { + "summary": "Get team membership", + "operationId": "teamsGetMembership", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "x-appwrite": { + "method": "getMembership", + "group": "memberships", + "weight": 233, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/get-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update membership", + "operationId": "teamsUpdateMembership", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "x-appwrite": { + "method": "updateMembership", + "group": "memberships", + "weight": 234, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "roles": { + "type": "array", + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "roles" + ] + } + } + ] + }, + "delete": { + "summary": "Delete team membership", + "operationId": "teamsDeleteMembership", + "consumes": [ + "application\/json" + ], + "produces": [], + "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 it is not accepted.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMembership", + "group": "memberships", + "weight": 236, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}\/status": { + "patch": { + "summary": "Update team membership status", + "operationId": "teamsUpdateMembershipStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "x-appwrite": { + "method": "updateMembershipStatus", + "group": "memberships", + "weight": 235, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/teams\/{teamId}\/prefs": { + "get": { + "summary": "Get team preferences", + "operationId": "teamsGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getPrefs).", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "teams", + "weight": 227, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update preferences", + "operationId": "teamsUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "teams", + "weight": 229, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "schema": { + "$ref": "#\/definitions\/resourceTokenList" + } + } + }, + "x-appwrite": { + "method": "list", + "group": "files", + "weight": 441, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "group": "files", + "weight": 439, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + } + } + } + } + ] + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "tokens", + "weight": 440, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date.", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "update", + "group": "tokens", + "weight": 442, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + } + } + } + } + ] + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "tokens", + "weight": 443, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } + }, + "\/users": { + "get": { + "summary": "List users", + "operationId": "usersList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get a list of all the project's users. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Users List", + "schema": { + "$ref": "#\/definitions\/userList" + } + } + }, + "x-appwrite": { + "method": "list", + "group": "users", + "weight": 247, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create user", + "operationId": "usersCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "create", + "group": "users", + "weight": 238, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "Plain text user password. Must be at least 8 chars.", + "default": "", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId" + ] + } + } + ] + } + }, + "\/users\/argon2": { + "post": { + "summary": "Create user with Argon2 password", + "operationId": "usersCreateArgon2User", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Argon2](https:\/\/en.wikipedia.org\/wiki\/Argon2) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "createArgon2User", + "group": "users", + "weight": 241, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-argon2user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-argon2-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Argon2.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/bcrypt": { + "post": { + "summary": "Create user with bcrypt password", + "operationId": "usersCreateBcryptUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Bcrypt](https:\/\/en.wikipedia.org\/wiki\/Bcrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "createBcryptUser", + "group": "users", + "weight": 239, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-bcrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-bcrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Bcrypt.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/identities": { + "get": { + "summary": "List identities", + "operationId": "usersListIdentities", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get identities for all users.", + "responses": { + "200": { + "description": "Identities List", + "schema": { + "$ref": "#\/definitions\/identityList" + } + } + }, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 255, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/users\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "usersDeleteIdentity", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 278, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "type": "string", + "x-example": "<IDENTITY_ID>", + "in": "path" + } + ] + } + }, + "\/users\/md5": { + "post": { + "summary": "Create user with MD5 password", + "operationId": "usersCreateMD5User", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [MD5](https:\/\/en.wikipedia.org\/wiki\/MD5) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "createMD5User", + "group": "users", + "weight": 240, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-m-d5user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-md5-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using MD5.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/phpass": { + "post": { + "summary": "Create user with PHPass password", + "operationId": "usersCreatePHPassUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [PHPass](https:\/\/www.openwall.com\/phpass\/) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "createPHPassUser", + "group": "users", + "weight": 243, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-p-h-pass-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-phpass-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using PHPass.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/scrypt": { + "post": { + "summary": "Create user with Scrypt password", + "operationId": "usersCreateScryptUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt](https:\/\/github.com\/Tarsnap\/scrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "createScryptUser", + "group": "users", + "weight": 244, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-scrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt.", + "default": null, + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Optional salt used to hash password.", + "default": null, + "x-example": "<PASSWORD_SALT>" + }, + "passwordCpu": { + "type": "integer", + "description": "Optional CPU cost used to hash password.", + "default": null, + "x-example": null + }, + "passwordMemory": { + "type": "integer", + "description": "Optional memory cost used to hash password.", + "default": null, + "x-example": null + }, + "passwordParallel": { + "type": "integer", + "description": "Optional parallelization cost used to hash password.", + "default": null, + "x-example": null + }, + "passwordLength": { + "type": "integer", + "description": "Optional hash length used to hash password.", + "default": null, + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordCpu", + "passwordMemory", + "passwordParallel", + "passwordLength" + ] + } + } + ] + } + }, + "\/users\/scrypt-modified": { + "post": { + "summary": "Create user with Scrypt modified password", + "operationId": "usersCreateScryptModifiedUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt Modified](https:\/\/gist.github.com\/Meldiron\/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "createScryptModifiedUser", + "group": "users", + "weight": 245, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-scrypt-modified-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-modified-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt Modified.", + "default": null, + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Salt used to hash password.", + "default": null, + "x-example": "<PASSWORD_SALT>" + }, + "passwordSaltSeparator": { + "type": "string", + "description": "Salt separator used to hash password.", + "default": null, + "x-example": "<PASSWORD_SALT_SEPARATOR>" + }, + "passwordSignerKey": { + "type": "string", + "description": "Signer key used to hash password.", + "default": null, + "x-example": "<PASSWORD_SIGNER_KEY>" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordSaltSeparator", + "passwordSignerKey" + ] + } + } + ] + } + }, + "\/users\/sha": { + "post": { + "summary": "Create user with SHA password", + "operationId": "usersCreateSHAUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [SHA](https:\/\/en.wikipedia.org\/wiki\/Secure_Hash_Algorithm) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "createSHAUser", + "group": "users", + "weight": 242, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-s-h-a-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-sha-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using SHA.", + "default": null, + "x-example": "password" + }, + "passwordVersion": { + "type": "string", + "description": "Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512\/224', 'sha512\/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'", + "default": "", + "x-example": "sha1", + "enum": [ + "sha1", + "sha224", + "sha256", + "sha384", + "sha512\/224", + "sha512\/256", + "sha512", + "sha3-224", + "sha3-256", + "sha3-384", + "sha3-512" + ], + "x-enum-name": "PasswordHash", + "x-enum-keys": [] + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/usage": { + "get": { + "summary": "Get users usage stats", + "operationId": "usersGetUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get usage metrics and statistics for all users in the project. You can view the total number of users and sessions. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.\n", + "responses": { + "200": { + "description": "UsageUsers", + "schema": { + "$ref": "#\/definitions\/usageUsers" + } + } + }, + "x-appwrite": { + "method": "getUsage", + "group": null, + "weight": 280, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/get-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "range", + "description": "Date range.", + "required": false, + "type": "string", + "x-example": "24h", + "enum": [ + "24h", + "30d", + "90d" + ], + "x-enum-name": "UserUsageRange", + "x-enum-keys": [ + "Twenty Four Hours", + "Thirty Days", + "Ninety Days" + ], + "default": "30d", + "in": "query" + } + ] + } + }, + "\/users\/{userId}": { + "get": { + "summary": "Get user", + "operationId": "usersGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get a user by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "users", + "weight": 248, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user", + "operationId": "usersDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https:\/\/appwrite.io\/docs\/server\/users#usersUpdateStatus) endpoint instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "users", + "weight": 276, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/email": { + "patch": { + "summary": "Update email", + "operationId": "usersUpdateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user email by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateEmail", + "group": "users", + "weight": 261, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + } + }, + "required": [ + "email" + ] + } + } + ] + } + }, + "\/users\/{userId}\/jwts": { + "post": { + "summary": "Create user JWT", + "operationId": "usersCreateJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.", + "responses": { + "201": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "x-appwrite": { + "method": "createJWT", + "group": "sessions", + "weight": 279, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user-jwt.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "sessionId": { + "type": "string", + "description": "Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.", + "default": "", + "x-example": "<SESSION_ID>" + }, + "duration": { + "type": "integer", + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "default": 900, + "x-example": 0 + } + } + } + } + ] + } + }, + "\/users\/{userId}\/labels": { + "put": { + "summary": "Update user labels", + "operationId": "usersUpdateLabels", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateLabels", + "group": "users", + "weight": 257, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-labels.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-labels.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "labels": { + "type": "array", + "description": "Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "labels" + ] + } + } + ] + } + }, + "\/users\/{userId}\/logs": { + "get": { + "summary": "List user logs", + "operationId": "usersListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 253, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/memberships": { + "get": { + "summary": "List user memberships", + "operationId": "usersListMemberships", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user membership list by its unique ID.", + "responses": { + "200": { + "description": "Memberships List", + "schema": { + "$ref": "#\/definitions\/membershipList" + } + } + }, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 252, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-memberships.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "usersUpdateMfa", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Enable or disable MFA on a user account.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateMfa", + "group": "users", + "weight": 266, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-mfa.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "default": null, + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + ] + } + }, + "\/users\/{userId}\/mfa\/authenticators\/{type}": { + "delete": { + "summary": "Delete authenticator", + "operationId": "usersDeleteMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete an authenticator app.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 271, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "usersListMfaFactors", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "schema": { + "$ref": "#\/definitions\/mfaFactors" + } + } + }, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 267, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/recovery-codes": { + "get": { + "summary": "Get MFA recovery codes", + "operationId": "usersGetMfaRecoveryCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 268, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "usersUpdateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 270, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Create MFA recovery codes", + "operationId": "usersCreateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 269, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/name": { + "patch": { + "summary": "Update name", + "operationId": "usersUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user name by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "users", + "weight": 259, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + } + }, + "\/users\/{userId}\/password": { + "patch": { + "summary": "Update password", + "operationId": "usersUpdatePassword", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user password by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updatePassword", + "group": "users", + "weight": 260, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "default": null, + "x-example": null + } + }, + "required": [ + "password" + ] + } + } + ] + } + }, + "\/users\/{userId}\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "usersUpdatePhone", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user phone by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updatePhone", + "group": "users", + "weight": 262, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "User phone number.", + "default": null, + "x-example": "+12065550100" + } + }, + "required": [ + "number" + ] + } + } + ] + } + }, + "\/users\/{userId}\/prefs": { + "get": { + "summary": "Get user preferences", + "operationId": "usersGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user preferences by its unique ID.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "users", + "weight": 249, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user preferences", + "operationId": "usersUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "users", + "weight": 264, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + }, + "\/users\/{userId}\/sessions": { + "get": { + "summary": "List user sessions", + "operationId": "usersListSessions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user sessions list by its unique ID.", + "responses": { + "200": { + "description": "Sessions List", + "schema": { + "$ref": "#\/definitions\/sessionList" + } + } + }, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 251, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create session", + "operationId": "usersCreateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 272, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user sessions", + "operationId": "usersDeleteSessions", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete all user's sessions by using the user's unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 275, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/sessions\/{sessionId}": { + "delete": { + "summary": "Delete user session", + "operationId": "usersDeleteSession", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete a user sessions by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 274, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "sessionId", + "description": "Session ID.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/status": { + "patch": { + "summary": "Update user status", + "operationId": "usersUpdateStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateStatus", + "group": "users", + "weight": 256, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "User Status. To activate the user pass `true` and to block the user pass `false`.", + "default": null, + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + ] + } + }, + "\/users\/{userId}\/targets": { + "get": { + "summary": "List user targets", + "operationId": "usersListTargets", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "List the messaging targets that are associated with a user.", + "responses": { + "200": { + "description": "Target list", + "schema": { + "$ref": "#\/definitions\/targetList" + } + } + }, + "x-appwrite": { + "method": "listTargets", + "group": "targets", + "weight": 254, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create user target", + "operationId": "usersCreateTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a messaging target.", + "responses": { + "201": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "x-appwrite": { + "method": "createTarget", + "group": "targets", + "weight": 246, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TARGET_ID>" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "default": null, + "x-example": "email", + "enum": [ + "email", + "sms", + "push" + ], + "x-enum-name": "MessagingProviderType", + "x-enum-keys": [] + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": null, + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "default": "", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "targetId", + "providerType", + "identifier" + ] + } + } + ] + } + }, + "\/users\/{userId}\/targets\/{targetId}": { + "get": { + "summary": "Get user target", + "operationId": "usersGetTarget", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get a user's push notification target by ID.", + "responses": { + "200": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "x-appwrite": { + "method": "getTarget", + "group": "targets", + "weight": 250, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/get-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user target", + "operationId": "usersUpdateTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update a messaging target.", + "responses": { + "200": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "x-appwrite": { + "method": "updateTarget", + "group": "targets", + "weight": 265, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": "", + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "default": "", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "default": "", + "x-example": "<NAME>" + } + } + } + } + ] + }, + "delete": { + "summary": "Delete user target", + "operationId": "usersDeleteTarget", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete a messaging target.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteTarget", + "group": "targets", + "weight": 277, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/tokens": { + "post": { + "summary": "Create token", + "operationId": "usersCreateToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createToken", + "group": "sessions", + "weight": 273, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-token.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "length": { + "type": "integer", + "description": "Token length in characters. The default length is 6 characters", + "default": 6, + "x-example": 4 + }, + "expire": { + "type": "integer", + "description": "Token expiration period in seconds. The default expiration is 15 minutes.", + "default": 900, + "x-example": 60 + } + } + } + } + ] + } + }, + "\/users\/{userId}\/verification": { + "patch": { + "summary": "Update email verification", + "operationId": "usersUpdateEmailVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user email verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateEmailVerification", + "group": "users", + "weight": 263, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-email-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "emailVerification": { + "type": "boolean", + "description": "User email verification status.", + "default": null, + "x-example": false + } + }, + "required": [ + "emailVerification" + ] + } + } + ] + } + }, + "\/users\/{userId}\/verification\/phone": { + "patch": { + "summary": "Update phone verification", + "operationId": "usersUpdatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user phone verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "users", + "weight": 258, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "phoneVerification": { + "type": "boolean", + "description": "User phone verification status.", + "default": null, + "x-example": false + } + }, + "required": [ + "phoneVerification" + ] + } + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/detections": { + "post": { + "summary": "Create repository detection", + "operationId": "vcsCreateRepositoryDetection", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Analyze a GitHub repository to automatically detect the programming language and runtime environment. This endpoint scans the repository's files and language statistics to determine the appropriate runtime settings for your function. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", + "responses": { + "200": { + "description": "DetectionFramework", + "schema": { + "$ref": "#\/definitions\/detectionFramework" + } + } + }, + "x-appwrite": { + "method": "createRepositoryDetection", + "group": "repositories", + "weight": 284, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/create-repository-detection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository-detection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerRepositoryId": { + "type": "string", + "description": "Repository Id", + "default": null, + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "type": { + "type": "string", + "description": "Detector type. Must be one of the following: runtime, framework", + "default": null, + "x-example": "runtime", + "enum": [ + "runtime", + "framework" + ], + "x-enum-name": "VCSDetectionType", + "x-enum-keys": [] + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to Root Directory", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + } + }, + "required": [ + "providerRepositoryId", + "type" + ] + } + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories": { + "get": { + "summary": "List repositories", + "operationId": "vcsListRepositories", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Get a list of GitHub repositories available through your installation. This endpoint returns repositories with their basic information, detected runtime environments, and latest push dates. You can optionally filter repositories using a search term. Each repository's runtime is automatically detected based on its contents and language statistics. The GitHub installation must be properly configured for this endpoint to work.", + "responses": { + "200": { + "description": "Framework Provider Repositories List", + "schema": { + "$ref": "#\/definitions\/providerRepositoryFrameworkList" + } + } + }, + "x-appwrite": { + "method": "listRepositories", + "group": "repositories", + "weight": 285, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/list-repositories.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repositories.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Detector type. Must be one of the following: runtime, framework", + "required": true, + "type": "string", + "x-example": "runtime", + "enum": [ + "runtime", + "framework" + ], + "x-enum-name": "VCSDetectionType", + "x-enum-keys": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create repository", + "operationId": "vcsCreateRepository", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Create a new GitHub repository through your installation. This endpoint allows you to create either a public or private repository by specifying a name and visibility setting. The repository will be created under your GitHub user account or organization, depending on your installation type. The GitHub installation must be properly configured and have the necessary permissions for repository creation.", + "responses": { + "200": { + "description": "ProviderRepository", + "schema": { + "$ref": "#\/definitions\/providerRepository" + } + } + }, + "x-appwrite": { + "method": "createRepository", + "group": "repositories", + "weight": 286, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/create-repository.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/create-repository.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Repository name (slug)", + "default": null, + "x-example": "<NAME>" + }, + "private": { + "type": "boolean", + "description": "Mark repository public or private", + "default": null, + "x-example": false + } + }, + "required": [ + "name", + "private" + ] + } + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories\/{providerRepositoryId}": { + "get": { + "summary": "Get repository", + "operationId": "vcsGetRepository", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Get detailed information about a specific GitHub repository from your installation. This endpoint returns repository details including its ID, name, visibility status, organization, and latest push date. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.", + "responses": { + "200": { + "description": "ProviderRepository", + "schema": { + "$ref": "#\/definitions\/providerRepository" + } + } + }, + "x-appwrite": { + "method": "getRepository", + "group": "repositories", + "weight": 287, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/get-repository.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + }, + { + "name": "providerRepositoryId", + "description": "Repository Id", + "required": true, + "type": "string", + "x-example": "<PROVIDER_REPOSITORY_ID>", + "in": "path" + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories\/{providerRepositoryId}\/branches": { + "get": { + "summary": "List repository branches", + "operationId": "vcsListRepositoryBranches", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Get a list of all branches from a GitHub repository in your installation. This endpoint returns the names of all branches in the repository and their total count. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.\n", + "responses": { + "200": { + "description": "Branches List", + "schema": { + "$ref": "#\/definitions\/branchList" + } + } + }, + "x-appwrite": { + "method": "listRepositoryBranches", + "group": "repositories", + "weight": 288, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/list-repository-branches.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-repository-branches.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + }, + { + "name": "providerRepositoryId", + "description": "Repository Id", + "required": true, + "type": "string", + "x-example": "<PROVIDER_REPOSITORY_ID>", + "in": "path" + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/providerRepositories\/{providerRepositoryId}\/contents": { + "get": { + "summary": "Get files and directories of a VCS repository", + "operationId": "vcsGetRepositoryContents", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.\n", + "responses": { + "200": { + "description": "VCS Content List", + "schema": { + "$ref": "#\/definitions\/vcsContentList" + } + } + }, + "x-appwrite": { + "method": "getRepositoryContents", + "group": "repositories", + "weight": 283, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/get-repository-contents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-repository-contents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + }, + { + "name": "providerRepositoryId", + "description": "Repository Id", + "required": true, + "type": "string", + "x-example": "<PROVIDER_REPOSITORY_ID>", + "in": "path" + }, + { + "name": "providerRootDirectory", + "description": "Path to get contents of nested directory", + "required": false, + "type": "string", + "x-example": "<PROVIDER_ROOT_DIRECTORY>", + "default": "", + "in": "query" + } + ] + } + }, + "\/vcs\/github\/installations\/{installationId}\/repositories\/{repositoryId}": { + "patch": { + "summary": "Update external deployment (authorize)", + "operationId": "vcsUpdateExternalDeployments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Authorize and create deployments for a GitHub pull request in your project. This endpoint allows external contributions by creating deployments from pull requests, enabling preview environments for code review. The pull request must be open and not previously authorized. The GitHub installation must be properly configured and have access to both the repository and pull request for this endpoint to work.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "updateExternalDeployments", + "group": "repositories", + "weight": 293, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/update-external-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/update-external-deployments.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + }, + { + "name": "repositoryId", + "description": "VCS Repository Id", + "required": true, + "type": "string", + "x-example": "<REPOSITORY_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerPullRequestId": { + "type": "string", + "description": "GitHub Pull Request Id", + "default": null, + "x-example": "<PROVIDER_PULL_REQUEST_ID>" + } + }, + "required": [ + "providerPullRequestId" + ] + } + } + ] + } + }, + "\/vcs\/installations": { + "get": { + "summary": "List installations", + "operationId": "vcsListInstallations", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "List all VCS installations configured for the current project. This endpoint returns a list of installations including their provider, organization, and other configuration details.\n", + "responses": { + "200": { + "description": "Installations List", + "schema": { + "$ref": "#\/definitions\/installationList" + } + } + }, + "x-appwrite": { + "method": "listInstallations", + "group": "installations", + "weight": 290, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/list-installations.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/list-installations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: provider, organization", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/vcs\/installations\/{installationId}": { + "get": { + "summary": "Get installation", + "operationId": "vcsGetInstallation", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "vcs" + ], + "description": "Get a VCS installation by its unique ID. This endpoint returns the installation's details including its provider, organization, and configuration. ", + "responses": { + "200": { + "description": "Installation", + "schema": { + "$ref": "#\/definitions\/installation" + } + } + }, + "x-appwrite": { + "method": "getInstallation", + "group": "installations", + "weight": 291, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/get-installation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/get-installation.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.read", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete installation", + "operationId": "vcsDeleteInstallation", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "vcs" + ], + "description": "Delete a VCS installation by its unique ID. This endpoint removes the installation and all its associated repositories from the project.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteInstallation", + "group": "installations", + "weight": 292, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "vcs\/delete-installation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/vcs\/delete-installation.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "vcs.write", + "platforms": [ + "console" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "installationId", + "description": "Installation Id", + "required": true, + "type": "string", + "x-example": "<INSTALLATION_ID>", + "in": "path" + } + ] + } + } + }, + "tags": [ + { + "name": "account", + "description": "The Account service allows you to authenticate and manage a user account." + }, + { + "name": "avatars", + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + }, + { + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" + }, + { + "name": "locale", + "description": "The Locale service allows you to customize your app based on your users' location." + }, + { + "name": "health", + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." + }, + { + "name": "projects", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "project", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "storage", + "description": "The Storage service allows you to manage your project files." + }, + { + "name": "teams", + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" + }, + { + "name": "users", + "description": "The Users service allows you to manage your project users." + }, + { + "name": "sites", + "description": "The Sites Service allows you view, create and manage your web applications." + }, + { + "name": "functions", + "description": "The Functions Service allows you view, create and manage your Cloud Functions." + }, + { + "name": "proxy", + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." + }, + { + "name": "graphql", + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." + }, + { + "name": "console", + "description": "The Console service allows you to interact with console relevant informations." + }, + { + "name": "migrations", + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." + }, + { + "name": "messaging", + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." + } + ], + "definitions": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true + }, + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { + "type": "object", + "$ref": "#\/definitions\/document" + }, + "x-example": "" + } + }, + "required": [ + "total", + "documents" + ] + }, + "collectionList": { + "description": "Collections List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of collections documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "collections": { + "type": "array", + "description": "List of collections.", + "items": { + "type": "object", + "$ref": "#\/definitions\/collection" + }, + "x-example": "" + } + }, + "required": [ + "total", + "collections" + ] + }, + "databaseList": { + "description": "Databases List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of databases documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "databases": { + "type": "array", + "description": "List of databases.", + "items": { + "type": "object", + "$ref": "#\/definitions\/database" + }, + "x-example": "" + } + }, + "required": [ + "total", + "databases" + ] + }, + "indexList": { + "description": "Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/index" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ] + }, + "userList": { + "description": "Users List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of users documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "users": { + "type": "array", + "description": "List of users.", + "items": { + "type": "object", + "$ref": "#\/definitions\/user" + }, + "x-example": "" + } + }, + "required": [ + "total", + "users" + ] + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/session" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sessions" + ] + }, + "identityList": { + "description": "Identities List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of identities documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "identities": { + "type": "array", + "description": "List of identities.", + "items": { + "type": "object", + "$ref": "#\/definitions\/identity" + }, + "x-example": "" + } + }, + "required": [ + "total", + "identities" + ] + }, + "logList": { + "description": "Logs List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of logs documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "logs": { + "type": "array", + "description": "List of logs.", + "items": { + "type": "object", + "$ref": "#\/definitions\/log" + }, + "x-example": "" + } + }, + "required": [ + "total", + "logs" + ] + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { + "type": "object", + "$ref": "#\/definitions\/file" + }, + "x-example": "" + } + }, + "required": [ + "total", + "files" + ] + }, + "bucketList": { + "description": "Buckets List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of buckets documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "buckets": { + "type": "array", + "description": "List of buckets.", + "items": { + "type": "object", + "$ref": "#\/definitions\/bucket" + }, + "x-example": "" + } + }, + "required": [ + "total", + "buckets" + ] + }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "type": "object", + "$ref": "#\/definitions\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { + "type": "object", + "$ref": "#\/definitions\/team" + }, + "x-example": "" + } + }, + "required": [ + "total", + "teams" + ] + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { + "type": "object", + "$ref": "#\/definitions\/membership" + }, + "x-example": "" + } + }, + "required": [ + "total", + "memberships" + ] + }, + "siteList": { + "description": "Sites List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sites documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sites": { + "type": "array", + "description": "List of sites.", + "items": { + "type": "object", + "$ref": "#\/definitions\/site" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sites" + ] + }, + "templateSiteList": { + "description": "Site Templates List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of templates documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "templates": { + "type": "array", + "description": "List of templates.", + "items": { + "type": "object", + "$ref": "#\/definitions\/templateSite" + }, + "x-example": "" + } + }, + "required": [ + "total", + "templates" + ] + }, + "functionList": { + "description": "Functions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of functions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "functions": { + "type": "array", + "description": "List of functions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/function" + }, + "x-example": "" + } + }, + "required": [ + "total", + "functions" + ] + }, + "templateFunctionList": { + "description": "Function Templates List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of templates documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "templates": { + "type": "array", + "description": "List of templates.", + "items": { + "type": "object", + "$ref": "#\/definitions\/templateFunction" + }, + "x-example": "" + } + }, + "required": [ + "total", + "templates" + ] + }, + "installationList": { + "description": "Installations List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of installations documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "installations": { + "type": "array", + "description": "List of installations.", + "items": { + "type": "object", + "$ref": "#\/definitions\/installation" + }, + "x-example": "" + } + }, + "required": [ + "total", + "installations" + ] + }, + "providerRepositoryFrameworkList": { + "description": "Framework Provider Repositories List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of frameworkProviderRepositories documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "frameworkProviderRepositories": { + "type": "array", + "description": "List of frameworkProviderRepositories.", + "items": { + "type": "object", + "$ref": "#\/definitions\/providerRepositoryFramework" + }, + "x-example": "" + } + }, + "required": [ + "total", + "frameworkProviderRepositories" + ] + }, + "providerRepositoryRuntimeList": { + "description": "Runtime Provider Repositories List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimeProviderRepositories documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "runtimeProviderRepositories": { + "type": "array", + "description": "List of runtimeProviderRepositories.", + "items": { + "type": "object", + "$ref": "#\/definitions\/providerRepositoryRuntime" + }, + "x-example": "" + } + }, + "required": [ + "total", + "runtimeProviderRepositories" + ] + }, + "branchList": { + "description": "Branches List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of branches documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "branches": { + "type": "array", + "description": "List of branches.", + "items": { + "type": "object", + "$ref": "#\/definitions\/branch" + }, + "x-example": "" + } + }, + "required": [ + "total", + "branches" + ] + }, + "frameworkList": { + "description": "Frameworks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of frameworks documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "frameworks": { + "type": "array", + "description": "List of frameworks.", + "items": { + "type": "object", + "$ref": "#\/definitions\/framework" + }, + "x-example": "" + } + }, + "required": [ + "total", + "frameworks" + ] + }, + "runtimeList": { + "description": "Runtimes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "runtimes": { + "type": "array", + "description": "List of runtimes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/runtime" + }, + "x-example": "" + } + }, + "required": [ + "total", + "runtimes" + ] + }, + "deploymentList": { + "description": "Deployments List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of deployments documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "List of deployments.", + "items": { + "type": "object", + "$ref": "#\/definitions\/deployment" + }, + "x-example": "" + } + }, + "required": [ + "total", + "deployments" + ] + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/execution" + }, + "x-example": "" + } + }, + "required": [ + "total", + "executions" + ] + }, + "projectList": { + "description": "Projects List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of projects documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "projects": { + "type": "array", + "description": "List of projects.", + "items": { + "type": "object", + "$ref": "#\/definitions\/project" + }, + "x-example": "" + } + }, + "required": [ + "total", + "projects" + ] + }, + "webhookList": { + "description": "Webhooks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of webhooks documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "webhooks": { + "type": "array", + "description": "List of webhooks.", + "items": { + "type": "object", + "$ref": "#\/definitions\/webhook" + }, + "x-example": "" + } + }, + "required": [ + "total", + "webhooks" + ] + }, + "keyList": { + "description": "API Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of keys documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "keys": { + "type": "array", + "description": "List of keys.", + "items": { + "type": "object", + "$ref": "#\/definitions\/key" + }, + "x-example": "" + } + }, + "required": [ + "total", + "keys" + ] + }, + "devKeyList": { + "description": "Dev Keys List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of devKeys documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "devKeys": { + "type": "array", + "description": "List of devKeys.", + "items": { + "type": "object", + "$ref": "#\/definitions\/devKey" + }, + "x-example": "" + } + }, + "required": [ + "total", + "devKeys" + ] + }, + "platformList": { + "description": "Platforms List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of platforms documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "platforms": { + "type": "array", + "description": "List of platforms.", + "items": { + "type": "object", + "$ref": "#\/definitions\/platform" + }, + "x-example": "" + } + }, + "required": [ + "total", + "platforms" + ] + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { + "type": "object", + "$ref": "#\/definitions\/country" + }, + "x-example": "" + } + }, + "required": [ + "total", + "countries" + ] + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { + "type": "object", + "$ref": "#\/definitions\/continent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "continents" + ] + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { + "type": "object", + "$ref": "#\/definitions\/language" + }, + "x-example": "" + } + }, + "required": [ + "total", + "languages" + ] + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { + "type": "object", + "$ref": "#\/definitions\/currency" + }, + "x-example": "" + } + }, + "required": [ + "total", + "currencies" + ] + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { + "type": "object", + "$ref": "#\/definitions\/phone" + }, + "x-example": "" + } + }, + "required": [ + "total", + "phones" + ] + }, + "variableList": { + "description": "Variables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of variables documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "variables": { + "type": "array", + "description": "List of variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/variable" + }, + "x-example": "" + } + }, + "required": [ + "total", + "variables" + ] + }, + "proxyRuleList": { + "description": "Rule List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of rules documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "rules": { + "type": "array", + "description": "List of rules.", + "items": { + "type": "object", + "$ref": "#\/definitions\/proxyRule" + }, + "x-example": "" + } + }, + "required": [ + "total", + "rules" + ] + }, + "localeCodeList": { + "description": "Locale codes list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of localeCodes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "localeCodes": { + "type": "array", + "description": "List of localeCodes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/localeCode" + }, + "x-example": "" + } + }, + "required": [ + "total", + "localeCodes" + ] + }, + "providerList": { + "description": "Provider list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of providers documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "providers": { + "type": "array", + "description": "List of providers.", + "items": { + "type": "object", + "$ref": "#\/definitions\/provider" + }, + "x-example": "" + } + }, + "required": [ + "total", + "providers" + ] + }, + "messageList": { + "description": "Message list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of messages documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "messages": { + "type": "array", + "description": "List of messages.", + "items": { + "type": "object", + "$ref": "#\/definitions\/message" + }, + "x-example": "" + } + }, + "required": [ + "total", + "messages" + ] + }, + "topicList": { + "description": "Topic list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of topics documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "topics": { + "type": "array", + "description": "List of topics.", + "items": { + "type": "object", + "$ref": "#\/definitions\/topic" + }, + "x-example": "" + } + }, + "required": [ + "total", + "topics" + ] + }, + "subscriberList": { + "description": "Subscriber list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of subscribers documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "subscribers": { + "type": "array", + "description": "List of subscribers.", + "items": { + "type": "object", + "$ref": "#\/definitions\/subscriber" + }, + "x-example": "" + } + }, + "required": [ + "total", + "subscribers" + ] + }, + "targetList": { + "description": "Target list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of targets documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "targets": { + "type": "array", + "description": "List of targets.", + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + }, + "x-example": "" + } + }, + "required": [ + "total", + "targets" + ] + }, + "migrationList": { + "description": "Migrations List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of migrations documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "migrations": { + "type": "array", + "description": "List of migrations.", + "items": { + "type": "object", + "$ref": "#\/definitions\/migration" + }, + "x-example": "" + } + }, + "required": [ + "total", + "migrations" + ] + }, + "specificationList": { + "description": "Specifications List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of specifications documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "specifications": { + "type": "array", + "description": "List of specifications.", + "items": { + "type": "object", + "$ref": "#\/definitions\/specification" + }, + "x-example": "" + } + }, + "required": [ + "total", + "specifications" + ] + }, + "vcsContentList": { + "description": "VCS Content List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of contents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "contents": { + "type": "array", + "description": "List of contents.", + "items": { + "type": "object", + "$ref": "#\/definitions\/vcsContent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "contents" + ] + }, + "database": { + "description": "Database", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Database name.", + "x-example": "My Database" + }, + "$createdAt": { + "type": "string", + "description": "Database creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Database update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "enabled": { + "type": "boolean", + "description": "If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + } + }, + "required": [ + "$id", + "name", + "$createdAt", + "$updatedAt", + "enabled" + ] + }, + "collection": { + "description": "Collection", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Collection creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Collection update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Collection permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Collection name.", + "x-example": "My Collection" + }, + "enabled": { + "type": "boolean", + "description": "Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "documentSecurity": { + "type": "boolean", + "description": "Whether document-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "attributes": { + "type": "array", + "description": "Collection attributes.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/attributeBoolean" + }, + { + "$ref": "#\/definitions\/attributeInteger" + }, + { + "$ref": "#\/definitions\/attributeFloat" + }, + { + "$ref": "#\/definitions\/attributeEmail" + }, + { + "$ref": "#\/definitions\/attributeEnum" + }, + { + "$ref": "#\/definitions\/attributeUrl" + }, + { + "$ref": "#\/definitions\/attributeIp" + }, + { + "$ref": "#\/definitions\/attributeDatetime" + }, + { + "$ref": "#\/definitions\/attributeRelationship" + }, + { + "$ref": "#\/definitions\/attributeString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Collection indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/index" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "documentSecurity", + "attributes", + "indexes" + ] + }, + "attributeList": { + "description": "Attributes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of attributes in the given collection.", + "x-example": 5, + "format": "int32" + }, + "attributes": { + "type": "array", + "description": "List of attributes.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/attributeBoolean" + }, + { + "$ref": "#\/definitions\/attributeInteger" + }, + { + "$ref": "#\/definitions\/attributeFloat" + }, + { + "$ref": "#\/definitions\/attributeEmail" + }, + { + "$ref": "#\/definitions\/attributeEnum" + }, + { + "$ref": "#\/definitions\/attributeUrl" + }, + { + "$ref": "#\/definitions\/attributeIp" + }, + { + "$ref": "#\/definitions\/attributeDatetime" + }, + { + "$ref": "#\/definitions\/attributeRelationship" + }, + { + "$ref": "#\/definitions\/attributeString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "attributes" + ] + }, + "attributeString": { + "description": "AttributeString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Attribute size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default", + "x-nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ] + }, + "attributeInteger": { + "description": "AttributeInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "x-nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "x-nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 10, + "format": "int32", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ] + }, + "attributeFloat": { + "description": "AttributeFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "x-nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "x-nullable": true + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 2.5, + "format": "double", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ] + }, + "attributeBoolean": { + "description": "AttributeBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ] + }, + "attributeEmail": { + "description": "AttributeEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default@example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeEnum": { + "description": "AttributeEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "element", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ] + }, + "attributeIp": { + "description": "AttributeIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "192.0.2.0", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeUrl": { + "description": "AttributeURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "http:\/\/example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeDatetime": { + "description": "AttributeDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeRelationship": { + "description": "AttributeRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedCollection": { + "type": "string", + "description": "The ID of the related collection.", + "x-example": "collection" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedCollection", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ] + }, + "index": { + "description": "Index", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "attributes": { + "type": "array", + "description": "Index attributes.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index attributes length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "attributes", + "lengths", + "$createdAt", + "$updatedAt" + ] + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, + "$collectionId": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c15117e" + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e" + }, + "$createdAt": { + "type": "string", + "description": "Document creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Document update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Document permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$collectionId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ] + }, + "log": { + "description": "Log", + "type": "object", + "properties": { + "event": { + "type": "string", + "description": "Event name.", + "x-example": "account.sessions.create" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "610fc2f985ee0" + }, + "userEmail": { + "type": "string", + "description": "User Email.", + "x-example": "john@appwrite.io" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "John Doe" + }, + "mode": { + "type": "string", + "description": "API mode when event triggered.", + "x-example": "admin" + }, + "ip": { + "type": "string", + "description": "IP session in use when the session was created.", + "x-example": "127.0.0.1" + }, + "time": { + "type": "string", + "description": "Log creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "event", + "userId", + "userEmail", + "userName", + "mode", + "ip", + "time", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName" + ] + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "User creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "User update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "User name.", + "x-example": "John Doe" + }, + "password": { + "type": "string", + "description": "Hashed user password.", + "x-example": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "x-nullable": true + }, + "hash": { + "type": "string", + "description": "Password hashing algorithm.", + "x-example": "argon2", + "x-nullable": true + }, + "hashOptions": { + "type": "object", + "description": "Password hashing algorithm configuration.", + "x-example": {}, + "items": { + "x-oneOf": [ + { + "$ref": "#\/definitions\/algoArgon2" + }, + { + "$ref": "#\/definitions\/algoScrypt" + }, + { + "$ref": "#\/definitions\/algoScryptModified" + }, + { + "$ref": "#\/definitions\/algoBcrypt" + }, + { + "$ref": "#\/definitions\/algoPhpass" + }, + { + "$ref": "#\/definitions\/algoSha" + }, + { + "$ref": "#\/definitions\/algoMd5" + } + ] + }, + "x-nullable": true + }, + "registration": { + "type": "string", + "description": "User registration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "x-example": true + }, + "labels": { + "type": "array", + "description": "Labels for the user.", + "items": { + "type": "string" + }, + "x-example": [ + "vip" + ] + }, + "passwordUpdate": { + "type": "string", + "description": "Password update time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "email": { + "type": "string", + "description": "User email address.", + "x-example": "john@appwrite.io" + }, + "phone": { + "type": "string", + "description": "User phone number in E.164 format.", + "x-example": "+4930901820" + }, + "emailVerification": { + "type": "boolean", + "description": "Email verification status.", + "x-example": true + }, + "phoneVerification": { + "type": "boolean", + "description": "Phone verification status.", + "x-example": true + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status.", + "x-example": true + }, + "prefs": { + "type": "object", + "description": "User preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/preferences" + } + }, + "targets": { + "type": "array", + "description": "A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.", + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + }, + "x-example": [] + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "registration", + "status", + "labels", + "passwordUpdate", + "email", + "phone", + "emailVerification", + "phoneVerification", + "mfa", + "prefs", + "targets", + "accessedAt" + ] + }, + "algoMd5": { + "description": "AlgoMD5", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "md5" + } + }, + "required": [ + "type" + ] + }, + "algoSha": { + "description": "AlgoSHA", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "sha" + } + }, + "required": [ + "type" + ] + }, + "algoPhpass": { + "description": "AlgoPHPass", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "phpass" + } + }, + "required": [ + "type" + ] + }, + "algoBcrypt": { + "description": "AlgoBcrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "bcrypt" + } + }, + "required": [ + "type" + ] + }, + "algoScrypt": { + "description": "AlgoScrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scrypt" + }, + "costCpu": { + "type": "integer", + "description": "CPU complexity of computed hash.", + "x-example": 8, + "format": "int32" + }, + "costMemory": { + "type": "integer", + "description": "Memory complexity of computed hash.", + "x-example": 14, + "format": "int32" + }, + "costParallel": { + "type": "integer", + "description": "Parallelization of computed hash.", + "x-example": 1, + "format": "int32" + }, + "length": { + "type": "integer", + "description": "Length used to compute hash.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "type", + "costCpu", + "costMemory", + "costParallel", + "length" + ] + }, + "algoScryptModified": { + "description": "AlgoScryptModified", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scryptMod" + }, + "salt": { + "type": "string", + "description": "Salt used to compute hash.", + "x-example": "UxLMreBr6tYyjQ==" + }, + "saltSeparator": { + "type": "string", + "description": "Separator used to compute hash.", + "x-example": "Bw==" + }, + "signerKey": { + "type": "string", + "description": "Key used to compute hash.", + "x-example": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "required": [ + "type", + "salt", + "saltSeparator", + "signerKey" + ] + }, + "algoArgon2": { + "description": "AlgoArgon2", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "argon2" + }, + "memoryCost": { + "type": "integer", + "description": "Memory used to compute hash.", + "x-example": 65536, + "format": "int32" + }, + "timeCost": { + "type": "integer", + "description": "Amount of time consumed to compute hash", + "x-example": 4, + "format": "int32" + }, + "threads": { + "type": "integer", + "description": "Number of threads used to compute hash.", + "x-example": 3, + "format": "int32" + } + }, + "required": [ + "type", + "memoryCost", + "timeCost", + "threads" + ] + }, + "preferences": { + "description": "Preferences", + "type": "object", + "additionalProperties": true + }, + "session": { + "description": "Session", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Session ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Session creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Session update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "expire": { + "type": "string", + "description": "Session expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "Session Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "Session Provider User ID.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "x-example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "x-example": true + }, + "factors": { + "type": "array", + "description": "Returns a list of active session factors.", + "items": { + "type": "string" + }, + "x-example": [ + "email" + ] + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate the user. Only included if the request was made with an API key", + "x-example": "5e5bb8c16897e" + }, + "mfaUpdatedAt": { + "type": "string", + "description": "Most recent date in ISO 8601 format when the session successfully passed MFA challenge.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "ip", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName", + "current", + "factors", + "secret", + "mfaUpdatedAt" + ] + }, + "identity": { + "description": "Identity", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Identity ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Identity creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Identity update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "provider": { + "type": "string", + "description": "Identity Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "ID of the User in the Identity Provider.", + "x-example": "5e5bb8c16897e" + }, + "providerEmail": { + "type": "string", + "description": "Email of the User in the Identity Provider.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Identity Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Identity Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "provider", + "providerUid", + "providerEmail", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken" + ] + }, + "token": { + "description": "Token", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "secret": { + "type": "string", + "description": "Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "phrase": { + "type": "string", + "description": "Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.", + "x-example": "Golden Fox" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "secret", + "expire", + "phrase" + ] + }, + "jwt": { + "description": "JWT", + "type": "object", + "properties": { + "jwt": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "required": [ + "jwt" + ] + }, + "locale": { + "description": "Locale", + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "User IP address.", + "x-example": "127.0.0.1" + }, + "countryCode": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format", + "x-example": "US" + }, + "country": { + "type": "string", + "description": "Country name. This field support localization.", + "x-example": "United States" + }, + "continentCode": { + "type": "string", + "description": "Continent code. A two character continent code \"AF\" for Africa, \"AN\" for Antarctica, \"AS\" for Asia, \"EU\" for Europe, \"NA\" for North America, \"OC\" for Oceania, and \"SA\" for South America.", + "x-example": "NA" + }, + "continent": { + "type": "string", + "description": "Continent name. This field support localization.", + "x-example": "North America" + }, + "eu": { + "type": "boolean", + "description": "True if country is part of the European Union.", + "x-example": false + }, + "currency": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format", + "x-example": "USD" + } + }, + "required": [ + "ip", + "countryCode", + "country", + "continentCode", + "continent", + "eu", + "currency" + ] + }, + "localeCode": { + "description": "LocaleCode", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes)", + "x-example": "en-us" + }, + "name": { + "type": "string", + "description": "Locale name", + "x-example": "US" + } + }, + "required": [ + "code", + "name" + ] + }, + "file": { + "description": "File", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "File ID.", + "x-example": "5e5ea5c16897e" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "File creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "File update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "File permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "name": { + "type": "string", + "description": "File name.", + "x-example": "Pink.png" + }, + "signature": { + "type": "string", + "description": "File MD5 signature.", + "x-example": "5d529fd02b544198ae075bd57c1762bb" + }, + "mimeType": { + "type": "string", + "description": "File mime type.", + "x-example": "image\/png" + }, + "sizeOriginal": { + "type": "integer", + "description": "File original size in bytes.", + "x-example": 17890, + "format": "int32" + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "x-example": 17890, + "format": "int32" + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "x-example": 17890, + "format": "int32" + } + }, + "required": [ + "$id", + "bucketId", + "$createdAt", + "$updatedAt", + "$permissions", + "name", + "signature", + "mimeType", + "sizeOriginal", + "chunksTotal", + "chunksUploaded" + ] + }, + "bucket": { + "description": "Bucket", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Bucket creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Bucket update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Bucket permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "fileSecurity": { + "type": "boolean", + "description": "Whether file-level security is enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "name": { + "type": "string", + "description": "Bucket name.", + "x-example": "Documents" + }, + "enabled": { + "type": "boolean", + "description": "Bucket enabled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size supported.", + "x-example": 100, + "format": "int32" + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions.", + "items": { + "type": "string" + }, + "x-example": [ + "jpg", + "png" + ] + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "x-example": "gzip" + }, + "encryption": { + "type": "boolean", + "description": "Bucket is encrypted.", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Virus scanning is enabled.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "fileSecurity", + "name", + "enabled", + "maximumFileSize", + "allowedFileExtensions", + "compression", + "encryption", + "antivirus" + ] + }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "files" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceType", + "expire", + "secret", + "accessedAt" + ] + }, + "team": { + "description": "Team", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Team creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Team update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "x-example": 7, + "format": "int32" + }, + "prefs": { + "type": "object", + "description": "Team preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/preferences" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "total", + "prefs" + ] + }, + "membership": { + "description": "Membership", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Membership ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Membership creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Membership update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "John Doe" + }, + "userEmail": { + "type": "string", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "john@appwrite.io" + }, + "teamId": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "teamName": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "invited": { + "type": "string", + "description": "Date, the user has been invited to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "joined": { + "type": "string", + "description": "Date, the user has accepted the invitation to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "confirm": { + "type": "boolean", + "description": "User confirmation status, true if the user has joined the team or false otherwise.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", + "x-example": false + }, + "roles": { + "type": "array", + "description": "User list of roles", + "items": { + "type": "string" + }, + "x-example": [ + "owner" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "userName", + "userEmail", + "teamId", + "teamName", + "invited", + "joined", + "confirm", + "mfa", + "roles" + ] + }, + "site": { + "description": "Site", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Site ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Site creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Site update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Site name.", + "x-example": "My Site" + }, + "enabled": { + "type": "boolean", + "description": "Site enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "framework": { + "type": "string", + "description": "Site framework.", + "x-example": "react" + }, + "deploymentId": { + "type": "string", + "description": "Site's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "deploymentScreenshotLight": { + "type": "string", + "description": "Screenshot of active deployment with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentScreenshotDark": { + "type": "string", + "description": "Screenshot of active deployment with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentId": { + "type": "string", + "description": "Site's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "vars": { + "type": "array", + "description": "Site variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/variable" + }, + "x-example": [] + }, + "timeout": { + "type": "integer", + "description": "Site request timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "installCommand": { + "type": "string", + "description": "The install command used to install the site dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "The build command used to build the site.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "The directory where the site build output is located.", + "x-example": "build" + }, + "installationId": { + "type": "string", + "description": "Site VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site in VCS (Version Control System) repository", + "x-example": "sites\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + }, + "buildRuntime": { + "type": "string", + "description": "Site build runtime.", + "x-example": "node-22" + }, + "adapter": { + "type": "string", + "description": "Site framework adapter.", + "x-example": "static" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "enabled", + "live", + "logging", + "framework", + "deploymentId", + "deploymentCreatedAt", + "deploymentScreenshotLight", + "deploymentScreenshotDark", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "vars", + "timeout", + "installCommand", + "buildCommand", + "outputDirectory", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification", + "buildRuntime", + "adapter", + "fallbackFile" + ] + }, + "templateSite": { + "description": "Template Site", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Site Template ID.", + "x-example": "starter" + }, + "name": { + "type": "string", + "description": "Site Template Name.", + "x-example": "Starter site" + }, + "tagline": { + "type": "string", + "description": "Short description of template", + "x-example": "Minimal web app integrating with Appwrite." + }, + "demoUrl": { + "type": "string", + "description": "URL hosting a template demo.", + "x-example": "https:\/\/nextjs-starter.appwrite.network\/" + }, + "screenshotDark": { + "type": "string", + "description": "File URL with preview screenshot in dark theme preference.", + "x-example": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-dark.png" + }, + "screenshotLight": { + "type": "string", + "description": "File URL with preview screenshot in light theme preference.", + "x-example": "https:\/\/cloud.appwrite.io\/images\/sites\/templates\/template-for-blog-light.png" + }, + "useCases": { + "type": "array", + "description": "Site use cases.", + "items": { + "type": "string" + }, + "x-example": "Starter" + }, + "frameworks": { + "type": "array", + "description": "List of frameworks that can be used with this template.", + "items": { + "type": "object", + "$ref": "#\/definitions\/templateFramework" + }, + "x-example": [] + }, + "vcsProvider": { + "type": "string", + "description": "VCS (Version Control System) Provider.", + "x-example": "github" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "templates" + }, + "providerOwner": { + "type": "string", + "description": "VCS (Version Control System) Owner.", + "x-example": "appwrite" + }, + "providerVersion": { + "type": "string", + "description": "VCS (Version Control System) branch version (tag).", + "x-example": "main" + }, + "variables": { + "type": "array", + "description": "Site variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/templateVariable" + }, + "x-example": [] + } + }, + "required": [ + "key", + "name", + "tagline", + "demoUrl", + "screenshotDark", + "screenshotLight", + "useCases", + "frameworks", + "vcsProvider", + "providerRepositoryId", + "providerOwner", + "providerVersion", + "variables" + ] + }, + "templateFramework": { + "description": "Template Framework", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Parent framework key.", + "x-example": "sveltekit" + }, + "name": { + "type": "string", + "description": "Framework Name.", + "x-example": "SvelteKit" + }, + "installCommand": { + "type": "string", + "description": "The install command used to install the dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "The output directory to store the build output.", + "x-example": ".\/build" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site in VCS (Version Control System) repository", + "x-example": ".\/svelte-kit\/starter" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime used during build step of template.", + "x-example": "node-22" + }, + "adapter": { + "type": "string", + "description": "Site framework runtime", + "x-example": "ssr" + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for SPA. Only relevant for static serve runtime.", + "x-example": "index.html" + } + }, + "required": [ + "key", + "name", + "installCommand", + "buildCommand", + "outputDirectory", + "providerRootDirectory", + "buildRuntime", + "adapter", + "fallbackFile" + ] + }, + "function": { + "description": "Function", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Function creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Function update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "execute": { + "type": "array", + "description": "Execution permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + }, + "name": { + "type": "string", + "description": "Function name.", + "x-example": "My Function" + }, + "enabled": { + "type": "boolean", + "description": "Function enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "runtime": { + "type": "string", + "description": "Function execution and build runtime.", + "x-example": "python-3.8" + }, + "deploymentId": { + "type": "string", + "description": "Function's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentId": { + "type": "string", + "description": "Function's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + }, + "vars": { + "type": "array", + "description": "Function variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/variable" + }, + "x-example": [] + }, + "events": { + "type": "array", + "description": "Function trigger events.", + "items": { + "type": "string" + }, + "x-example": "account.create" + }, + "schedule": { + "type": "string", + "description": "Function execution schedule in CRON format.", + "x-example": "5 4 * * *" + }, + "timeout": { + "type": "integer", + "description": "Function execution timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file used to execute the deployment.", + "x-example": "index.js" + }, + "commands": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm install" + }, + "version": { + "type": "string", + "description": "Version of Open Runtimes used for the function.", + "x-example": "v2" + }, + "installationId": { + "type": "string", + "description": "Function VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function in VCS (Version Control System) repository", + "x-example": "functions\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "execute", + "name", + "enabled", + "live", + "logging", + "runtime", + "deploymentId", + "deploymentCreatedAt", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "scopes", + "vars", + "events", + "schedule", + "timeout", + "entrypoint", + "commands", + "version", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification" + ] + }, + "templateFunction": { + "description": "Template Function", + "type": "object", + "properties": { + "icon": { + "type": "string", + "description": "Function Template Icon.", + "x-example": "icon-lightning-bolt" + }, + "id": { + "type": "string", + "description": "Function Template ID.", + "x-example": "starter" + }, + "name": { + "type": "string", + "description": "Function Template Name.", + "x-example": "Starter function" + }, + "tagline": { + "type": "string", + "description": "Function Template Tagline.", + "x-example": "A simple function to get started." + }, + "permissions": { + "type": "array", + "description": "Execution permissions.", + "items": { + "type": "string" + }, + "x-example": "any" + }, + "events": { + "type": "array", + "description": "Function trigger events.", + "items": { + "type": "string" + }, + "x-example": "account.create" + }, + "cron": { + "type": "string", + "description": "Function execution schedult in CRON format.", + "x-example": "0 0 * * *" + }, + "timeout": { + "type": "integer", + "description": "Function execution timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "useCases": { + "type": "array", + "description": "Function use cases.", + "items": { + "type": "string" + }, + "x-example": "Starter" + }, + "runtimes": { + "type": "array", + "description": "List of runtimes that can be used with this template.", + "items": { + "type": "object", + "$ref": "#\/definitions\/templateRuntime" + }, + "x-example": [] + }, + "instructions": { + "type": "string", + "description": "Function Template Instructions.", + "x-example": "For documentation and instructions check out <link>." + }, + "vcsProvider": { + "type": "string", + "description": "VCS (Version Control System) Provider.", + "x-example": "github" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "templates" + }, + "providerOwner": { + "type": "string", + "description": "VCS (Version Control System) Owner.", + "x-example": "appwrite" + }, + "providerVersion": { + "type": "string", + "description": "VCS (Version Control System) branch version (tag).", + "x-example": "main" + }, + "variables": { + "type": "array", + "description": "Function variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/templateVariable" + }, + "x-example": [] + }, + "scopes": { + "type": "array", + "description": "Function scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + } + }, + "required": [ + "icon", + "id", + "name", + "tagline", + "permissions", + "events", + "cron", + "timeout", + "useCases", + "runtimes", + "instructions", + "vcsProvider", + "providerRepositoryId", + "providerOwner", + "providerVersion", + "variables", + "scopes" + ] + }, + "templateRuntime": { + "description": "Template Runtime", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Runtime Name.", + "x-example": "node-19.0" + }, + "commands": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm install" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file used to execute the deployment.", + "x-example": "index.js" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function in VCS (Version Control System) repository", + "x-example": "node\/starter" + } + }, + "required": [ + "name", + "commands", + "entrypoint", + "providerRootDirectory" + ] + }, + "templateVariable": { + "description": "Template Variable", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Variable Name.", + "x-example": "APPWRITE_DATABASE_ID" + }, + "description": { + "type": "string", + "description": "Variable Description.", + "x-example": "The ID of the Appwrite database that contains the collection to sync." + }, + "value": { + "type": "string", + "description": "Variable Value.", + "x-example": "512" + }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, + "placeholder": { + "type": "string", + "description": "Variable Placeholder.", + "x-example": "64a55...7b912" + }, + "required": { + "type": "boolean", + "description": "Is the variable required?", + "x-example": false + }, + "type": { + "type": "string", + "description": "Variable Type.", + "x-example": "password" + } + }, + "required": [ + "name", + "description", + "value", + "secret", + "placeholder", + "required", + "type" + ] + }, + "installation": { + "description": "Installation", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Function creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Function update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name.", + "x-example": "appwrite" + }, + "providerInstallationId": { + "type": "string", + "description": "VCS (Version Control System) installation ID.", + "x-example": "5322" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "provider", + "organization", + "providerInstallationId" + ] + }, + "providerRepository": { + "description": "ProviderRepository", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VCS (Version Control System) repository ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) repository name.", + "x-example": "appwrite" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name", + "x-example": "appwrite" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "private": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository private?", + "x-example": true + }, + "pushedAt": { + "type": "string", + "description": "Last commit date in ISO 8601 format.", + "x-example": "datetime" + } + }, + "required": [ + "id", + "name", + "organization", + "provider", + "private", + "pushedAt" + ] + }, + "providerRepositoryFramework": { + "description": "ProviderRepositoryFramework", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VCS (Version Control System) repository ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) repository name.", + "x-example": "appwrite" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name", + "x-example": "appwrite" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "private": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository private?", + "x-example": true + }, + "pushedAt": { + "type": "string", + "description": "Last commit date in ISO 8601 format.", + "x-example": "datetime" + }, + "framework": { + "type": "string", + "description": "Auto-detected framework. Empty if type is not \"framework\".", + "x-example": "nextjs" + } + }, + "required": [ + "id", + "name", + "organization", + "provider", + "private", + "pushedAt", + "framework" + ] + }, + "providerRepositoryRuntime": { + "description": "ProviderRepositoryRuntime", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VCS (Version Control System) repository ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "VCS (Version Control System) repository name.", + "x-example": "appwrite" + }, + "organization": { + "type": "string", + "description": "VCS (Version Control System) organization name", + "x-example": "appwrite" + }, + "provider": { + "type": "string", + "description": "VCS (Version Control System) provider name.", + "x-example": "github" + }, + "private": { + "type": "boolean", + "description": "Is VCS (Version Control System) repository private?", + "x-example": true + }, + "pushedAt": { + "type": "string", + "description": "Last commit date in ISO 8601 format.", + "x-example": "datetime" + }, + "runtime": { + "type": "string", + "description": "Auto-detected runtime. Empty if type is not \"runtime\".", + "x-example": "node-22" + } + }, + "required": [ + "id", + "name", + "organization", + "provider", + "private", + "pushedAt", + "runtime" + ] + }, + "detectionFramework": { + "description": "DetectionFramework", + "type": "object", + "properties": { + "framework": { + "type": "string", + "description": "Framework", + "x-example": "nuxt" + }, + "installCommand": { + "type": "string", + "description": "Site Install Command", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "Site Build Command", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "Site Output Directory", + "x-example": "dist" + } + }, + "required": [ + "framework", + "installCommand", + "buildCommand", + "outputDirectory" + ] + }, + "detectionRuntime": { + "description": "DetectionRuntime", + "type": "object", + "properties": { + "runtime": { + "type": "string", + "description": "Runtime", + "x-example": "node" + }, + "entrypoint": { + "type": "string", + "description": "Function Entrypoint", + "x-example": "index.js" + }, + "commands": { + "type": "string", + "description": "Function install and build commands", + "x-example": "npm install && npm run build" + } + }, + "required": [ + "runtime", + "entrypoint", + "commands" + ] + }, + "vcsContent": { + "description": "VcsContents", + "type": "object", + "properties": { + "size": { + "type": "integer", + "description": "Content size in bytes. Only files have size, and for directories, 0 is returned.", + "x-example": 1523, + "format": "int32", + "x-nullable": true + }, + "isDirectory": { + "type": "boolean", + "description": "If a content is a directory. Directories can be used to check nested contents.", + "x-example": true, + "x-nullable": true + }, + "name": { + "type": "string", + "description": "Name of directory or file.", + "x-example": "Main.java" + } + }, + "required": [ + "name" + ] + }, + "branch": { + "description": "Branch", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Branch Name.", + "x-example": "main" + } + }, + "required": [ + "name" + ] + }, + "runtime": { + "description": "Runtime", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Runtime ID.", + "x-example": "python-3.8" + }, + "key": { + "type": "string", + "description": "Parent runtime key.", + "x-example": "python" + }, + "name": { + "type": "string", + "description": "Runtime Name.", + "x-example": "Python" + }, + "version": { + "type": "string", + "description": "Runtime version.", + "x-example": "3.8" + }, + "base": { + "type": "string", + "description": "Base Docker image used to build the runtime.", + "x-example": "python:3.8-alpine" + }, + "image": { + "type": "string", + "description": "Image name of Docker Hub.", + "x-example": "appwrite\\\/runtime-for-python:3.8" + }, + "logo": { + "type": "string", + "description": "Name of the logo image.", + "x-example": "python.png" + }, + "supports": { + "type": "array", + "description": "List of supported architectures.", + "items": { + "type": "string" + }, + "x-example": "amd64" + } + }, + "required": [ + "$id", + "key", + "name", + "version", + "base", + "image", + "logo", + "supports" + ] + }, + "framework": { + "description": "Framework", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Framework key.", + "x-example": "sveltekit" + }, + "name": { + "type": "string", + "description": "Framework Name.", + "x-example": "SvelteKit" + }, + "buildRuntime": { + "type": "string", + "description": "Default runtime version.", + "x-example": "node-22" + }, + "runtimes": { + "type": "array", + "description": "List of supported runtime versions.", + "items": { + "type": "string" + }, + "x-example": [ + "static-1", + "node-22" + ] + }, + "adapters": { + "type": "array", + "description": "List of supported adapters.", + "items": { + "type": "object", + "$ref": "#\/definitions\/frameworkAdapter" + }, + "x-example": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "required": [ + "key", + "name", + "buildRuntime", + "runtimes", + "adapters" + ] + }, + "frameworkAdapter": { + "description": "Framework Adapter", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Adapter key.", + "x-example": "static" + }, + "installCommand": { + "type": "string", + "description": "Default command to download dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "Default command to build site into output directory.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "Default output directory of build.", + "x-example": ".\/dist" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "key", + "installCommand", + "buildCommand", + "outputDirectory", + "fallbackFile" + ] + }, + "deployment": { + "description": "Deployment", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Deployment update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "type": { + "type": "string", + "description": "Type of deployment.", + "x-example": "vcs" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea6g16897e" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "functions" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file to use to execute the deployment code.", + "x-example": "index.js" + }, + "sourceSize": { + "type": "integer", + "description": "The code size in bytes.", + "x-example": 128, + "format": "int32" + }, + "buildSize": { + "type": "integer", + "description": "The build output size in bytes.", + "x-example": 128, + "format": "int32" + }, + "totalSize": { + "type": "integer", + "description": "The total size in bytes (source and build output).", + "x-example": 128, + "format": "int32" + }, + "buildId": { + "type": "string", + "description": "The current build ID.", + "x-example": "5e5ea5c16897e" + }, + "activate": { + "type": "boolean", + "description": "Whether the deployment should be automatically activated.", + "x-example": true + }, + "screenshotLight": { + "type": "string", + "description": "Screenshot with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "screenshotDark": { + "type": "string", + "description": "Screenshot with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "status": { + "type": "string", + "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "buildLogs": { + "type": "string", + "description": "The build logs.", + "x-example": "Compiling source files..." + }, + "buildDuration": { + "type": "integer", + "description": "The current build time in seconds.", + "x-example": 128, + "format": "int32" + }, + "providerRepositoryName": { + "type": "string", + "description": "The name of the vcs provider repository", + "x-example": "database" + }, + "providerRepositoryOwner": { + "type": "string", + "description": "The name of the vcs provider repository owner", + "x-example": "utopia" + }, + "providerRepositoryUrl": { + "type": "string", + "description": "The url of the vcs provider repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" + }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, + "providerCommitHash": { + "type": "string", + "description": "The commit hash of the vcs commit", + "x-example": "7c3f25d" + }, + "providerCommitAuthorUrl": { + "type": "string", + "description": "The url of vcs commit author", + "x-example": "https:\/\/github.com\/vermakhushboo" + }, + "providerCommitAuthor": { + "type": "string", + "description": "The name of vcs commit author", + "x-example": "Khushboo Verma" + }, + "providerCommitMessage": { + "type": "string", + "description": "The commit message", + "x-example": "Update index.js" + }, + "providerCommitUrl": { + "type": "string", + "description": "The url of the vcs commit", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" + }, + "providerBranchUrl": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "type", + "resourceId", + "resourceType", + "entrypoint", + "sourceSize", + "buildSize", + "totalSize", + "buildId", + "activate", + "screenshotLight", + "screenshotDark", + "status", + "buildLogs", + "buildDuration", + "providerRepositoryName", + "providerRepositoryOwner", + "providerRepositoryUrl", + "providerBranch", + "providerCommitHash", + "providerCommitAuthorUrl", + "providerCommitAuthor", + "providerCommitMessage", + "providerCommitUrl", + "providerBranchUrl" + ] + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Execution creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Execution upate date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Execution roles.", + "items": { + "type": "string" + }, + "x-example": [ + "any" + ] + }, + "functionId": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea6g16897e" + }, + "trigger": { + "type": "string", + "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", + "x-example": "http" + }, + "status": { + "type": "string", + "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", + "x-example": "processing" + }, + "requestMethod": { + "type": "string", + "description": "HTTP request method type.", + "x-example": "GET" + }, + "requestPath": { + "type": "string", + "description": "HTTP request path and query.", + "x-example": "\/articles?id=5" + }, + "requestHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "type": "object", + "$ref": "#\/definitions\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "responseStatusCode": { + "type": "integer", + "description": "HTTP response status code.", + "x-example": 200, + "format": "int32" + }, + "responseBody": { + "type": "string", + "description": "HTTP response body. This will return empty unless execution is created as synchronous.", + "x-example": "" + }, + "responseHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "type": "object", + "$ref": "#\/definitions\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "logs": { + "type": "string", + "description": "Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "errors": { + "type": "string", + "description": "Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "duration": { + "type": "number", + "description": "Resource(function\/site) execution duration in seconds.", + "x-example": 0.4, + "format": "double" + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for execution. If left empty, execution will be queued immediately.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "functionId", + "trigger", + "status", + "requestMethod", + "requestPath", + "requestHeaders", + "responseStatusCode", + "responseBody", + "responseHeaders", + "logs", + "errors", + "duration" + ] + }, + "project": { + "description": "Project", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Project ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Project creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Project update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Project name.", + "x-example": "New Project" + }, + "description": { + "type": "string", + "description": "Project description.", + "x-example": "This is a new project." + }, + "teamId": { + "type": "string", + "description": "Project team ID.", + "x-example": "1592981250" + }, + "logo": { + "type": "string", + "description": "Project logo file ID.", + "x-example": "5f5c451b403cb" + }, + "url": { + "type": "string", + "description": "Project website URL.", + "x-example": "5f5c451b403cb" + }, + "legalName": { + "type": "string", + "description": "Company legal name.", + "x-example": "Company LTD." + }, + "legalCountry": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format.", + "x-example": "US" + }, + "legalState": { + "type": "string", + "description": "State name.", + "x-example": "New York" + }, + "legalCity": { + "type": "string", + "description": "City name.", + "x-example": "New York City." + }, + "legalAddress": { + "type": "string", + "description": "Company Address.", + "x-example": "620 Eighth Avenue, New York, NY 10018" + }, + "legalTaxId": { + "type": "string", + "description": "Company Tax ID.", + "x-example": "131102020" + }, + "authDuration": { + "type": "integer", + "description": "Session duration in seconds.", + "x-example": 60, + "format": "int32" + }, + "authLimit": { + "type": "integer", + "description": "Max users allowed. 0 is unlimited.", + "x-example": 100, + "format": "int32" + }, + "authSessionsLimit": { + "type": "integer", + "description": "Max sessions allowed per user. 100 maximum.", + "x-example": 10, + "format": "int32" + }, + "authPasswordHistory": { + "type": "integer", + "description": "Max allowed passwords in the history list per user. Max passwords limit allowed in history is 20. Use 0 for disabling password history.", + "x-example": 5, + "format": "int32" + }, + "authPasswordDictionary": { + "type": "boolean", + "description": "Whether or not to check user's password against most commonly used passwords.", + "x-example": true + }, + "authPersonalDataCheck": { + "type": "boolean", + "description": "Whether or not to check the user password for similarity with their personal data.", + "x-example": true + }, + "authMockNumbers": { + "type": "array", + "description": "An array of mock numbers and their corresponding verification codes (OTPs).", + "items": { + "type": "object", + "$ref": "#\/definitions\/mockNumber" + }, + "x-example": [ + {} + ] + }, + "authSessionAlerts": { + "type": "boolean", + "description": "Whether or not to send session alert emails to users.", + "x-example": true + }, + "authMembershipsUserName": { + "type": "boolean", + "description": "Whether or not to show user names in the teams membership response.", + "x-example": true + }, + "authMembershipsUserEmail": { + "type": "boolean", + "description": "Whether or not to show user emails in the teams membership response.", + "x-example": true + }, + "authMembershipsMfa": { + "type": "boolean", + "description": "Whether or not to show user MFA status in the teams membership response.", + "x-example": true + }, + "oAuthProviders": { + "type": "array", + "description": "List of Auth Providers.", + "items": { + "type": "object", + "$ref": "#\/definitions\/authProvider" + }, + "x-example": [ + {} + ] + }, + "platforms": { + "type": "array", + "description": "List of Platforms.", + "items": { + "type": "object", + "$ref": "#\/definitions\/platform" + }, + "x-example": {} + }, + "webhooks": { + "type": "array", + "description": "List of Webhooks.", + "items": { + "type": "object", + "$ref": "#\/definitions\/webhook" + }, + "x-example": {} + }, + "keys": { + "type": "array", + "description": "List of API Keys.", + "items": { + "type": "object", + "$ref": "#\/definitions\/key" + }, + "x-example": {} + }, + "devKeys": { + "type": "array", + "description": "List of dev keys.", + "items": { + "type": "object", + "$ref": "#\/definitions\/devKey" + }, + "x-example": {} + }, + "smtpEnabled": { + "type": "boolean", + "description": "Status for custom SMTP", + "x-example": false + }, + "smtpSenderName": { + "type": "string", + "description": "SMTP sender name", + "x-example": "John Appwrite" + }, + "smtpSenderEmail": { + "type": "string", + "description": "SMTP sender email", + "x-example": "john@appwrite.io" + }, + "smtpReplyTo": { + "type": "string", + "description": "SMTP reply to email", + "x-example": "support@appwrite.io" + }, + "smtpHost": { + "type": "string", + "description": "SMTP server host name", + "x-example": "mail.appwrite.io" + }, + "smtpPort": { + "type": "integer", + "description": "SMTP server port", + "x-example": 25, + "format": "int32" + }, + "smtpUsername": { + "type": "string", + "description": "SMTP server username", + "x-example": "emailuser" + }, + "smtpPassword": { + "type": "string", + "description": "SMTP server password", + "x-example": "securepassword" + }, + "smtpSecure": { + "type": "string", + "description": "SMTP server secure protocol", + "x-example": "tls" + }, + "pingCount": { + "type": "integer", + "description": "Number of times the ping was received for this project.", + "x-example": 1, + "format": "int32" + }, + "pingedAt": { + "type": "string", + "description": "Last ping datetime in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "authEmailPassword": { + "type": "boolean", + "description": "Email\/Password auth method status", + "x-example": true + }, + "authUsersAuthMagicURL": { + "type": "boolean", + "description": "Magic URL auth method status", + "x-example": true + }, + "authEmailOtp": { + "type": "boolean", + "description": "Email (OTP) auth method status", + "x-example": true + }, + "authAnonymous": { + "type": "boolean", + "description": "Anonymous auth method status", + "x-example": true + }, + "authInvites": { + "type": "boolean", + "description": "Invites auth method status", + "x-example": true + }, + "authJWT": { + "type": "boolean", + "description": "JWT auth method status", + "x-example": true + }, + "authPhone": { + "type": "boolean", + "description": "Phone auth method status", + "x-example": true + }, + "serviceStatusForAccount": { + "type": "boolean", + "description": "Account service status", + "x-example": true + }, + "serviceStatusForAvatars": { + "type": "boolean", + "description": "Avatars service status", + "x-example": true + }, + "serviceStatusForDatabases": { + "type": "boolean", + "description": "Databases service status", + "x-example": true + }, + "serviceStatusForLocale": { + "type": "boolean", + "description": "Locale service status", + "x-example": true + }, + "serviceStatusForHealth": { + "type": "boolean", + "description": "Health service status", + "x-example": true + }, + "serviceStatusForStorage": { + "type": "boolean", + "description": "Storage service status", + "x-example": true + }, + "serviceStatusForTeams": { + "type": "boolean", + "description": "Teams service status", + "x-example": true + }, + "serviceStatusForUsers": { + "type": "boolean", + "description": "Users service status", + "x-example": true + }, + "serviceStatusForSites": { + "type": "boolean", + "description": "Sites service status", + "x-example": true + }, + "serviceStatusForFunctions": { + "type": "boolean", + "description": "Functions service status", + "x-example": true + }, + "serviceStatusForGraphql": { + "type": "boolean", + "description": "GraphQL service status", + "x-example": true + }, + "serviceStatusForMessaging": { + "type": "boolean", + "description": "Messaging service status", + "x-example": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "description", + "teamId", + "logo", + "url", + "legalName", + "legalCountry", + "legalState", + "legalCity", + "legalAddress", + "legalTaxId", + "authDuration", + "authLimit", + "authSessionsLimit", + "authPasswordHistory", + "authPasswordDictionary", + "authPersonalDataCheck", + "authMockNumbers", + "authSessionAlerts", + "authMembershipsUserName", + "authMembershipsUserEmail", + "authMembershipsMfa", + "oAuthProviders", + "platforms", + "webhooks", + "keys", + "devKeys", + "smtpEnabled", + "smtpSenderName", + "smtpSenderEmail", + "smtpReplyTo", + "smtpHost", + "smtpPort", + "smtpUsername", + "smtpPassword", + "smtpSecure", + "pingCount", + "pingedAt", + "authEmailPassword", + "authUsersAuthMagicURL", + "authEmailOtp", + "authAnonymous", + "authInvites", + "authJWT", + "authPhone", + "serviceStatusForAccount", + "serviceStatusForAvatars", + "serviceStatusForDatabases", + "serviceStatusForLocale", + "serviceStatusForHealth", + "serviceStatusForStorage", + "serviceStatusForTeams", + "serviceStatusForUsers", + "serviceStatusForSites", + "serviceStatusForFunctions", + "serviceStatusForGraphql", + "serviceStatusForMessaging" + ] + }, + "webhook": { + "description": "Webhook", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Webhook ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Webhook creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Webhook update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Webhook name.", + "x-example": "My Webhook" + }, + "url": { + "type": "string", + "description": "Webhook URL endpoint.", + "x-example": "https:\/\/example.com\/webhook" + }, + "events": { + "type": "array", + "description": "Webhook trigger events.", + "items": { + "type": "string" + }, + "x-example": "database.collections.update" + }, + "security": { + "type": "boolean", + "description": "Indicated if SSL \/ TLS Certificate verification is enabled.", + "x-example": true + }, + "httpUser": { + "type": "string", + "description": "HTTP basic authentication username.", + "x-example": "username" + }, + "httpPass": { + "type": "string", + "description": "HTTP basic authentication password.", + "x-example": "password" + }, + "signatureKey": { + "type": "string", + "description": "Signature key which can be used to validated incoming", + "x-example": "ad3d581ca230e2b7059c545e5a" + }, + "enabled": { + "type": "boolean", + "description": "Indicates if this webhook is enabled.", + "x-example": true + }, + "logs": { + "type": "string", + "description": "Webhook error logs from the most recent failure.", + "x-example": "Failed to connect to remote server." + }, + "attempts": { + "type": "integer", + "description": "Number of consecutive failed webhook attempts.", + "x-example": 10, + "format": "int32" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "url", + "events", + "security", + "httpUser", + "httpPass", + "signatureKey", + "enabled", + "logs", + "attempts" + ] + }, + "key": { + "description": "Key", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "x-example": "My API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "x-example": "appwrite:flutter" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "scopes", + "secret", + "accessedAt", + "sdks" + ] + }, + "devKey": { + "description": "DevKey", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Key ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Key creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Key update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Key name.", + "x-example": "Dev API Key" + }, + "expire": { + "type": "string", + "description": "Key expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "x-example": "919c2d18fb5d4...a2ae413da83346ad2" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "sdks": { + "type": "array", + "description": "List of SDK user agents that used this key.", + "items": { + "type": "string" + }, + "x-example": "appwrite:flutter" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "expire", + "secret", + "accessedAt", + "sdks" + ] + }, + "mockNumber": { + "description": "Mock Number", + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS.", + "x-example": "+1612842323" + }, + "otp": { + "type": "string", + "description": "Mock OTP for the number. ", + "x-example": "123456" + } + }, + "required": [ + "phone", + "otp" + ] + }, + "authProvider": { + "description": "AuthProvider", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Auth Provider.", + "x-example": "github" + }, + "name": { + "type": "string", + "description": "Auth Provider name.", + "x-example": "GitHub" + }, + "appId": { + "type": "string", + "description": "OAuth 2.0 application ID.", + "x-example": "259125845563242502" + }, + "secret": { + "type": "string", + "description": "OAuth 2.0 application secret. Might be JSON string if provider requires extra configuration.", + "x-example": "Bpw_g9c2TGXxfgLshDbSaL8tsCcqgczQ" + }, + "enabled": { + "type": "boolean", + "description": "Auth Provider is active and can be used to create session.", + "x-example": "" + } + }, + "required": [ + "key", + "name", + "appId", + "secret", + "enabled" + ] + }, + "platform": { + "description": "Platform", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Platform ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Platform creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Platform update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Platform name.", + "x-example": "My Web App" + }, + "type": { + "type": "string", + "description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.", + "x-example": "web" + }, + "key": { + "type": "string", + "description": "Platform Key. iOS bundle ID or Android package name. Empty string for other platforms.", + "x-example": "com.company.appname" + }, + "store": { + "type": "string", + "description": "App store or Google Play store ID.", + "x-example": "" + }, + "hostname": { + "type": "string", + "description": "Web app hostname. Empty string for other platforms.", + "x-example": true + }, + "httpUser": { + "type": "string", + "description": "HTTP basic authentication username.", + "x-example": "username" + }, + "httpPass": { + "type": "string", + "description": "HTTP basic authentication password.", + "x-example": "password" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "type", + "key", + "store", + "hostname", + "httpUser", + "httpPass" + ] + }, + "variable": { + "description": "Variable", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Variable ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Variable key.", + "x-example": "API_KEY" + }, + "value": { + "type": "string", + "description": "Variable value.", + "x-example": "myPa$$word1" + }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, + "resourceType": { + "type": "string", + "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", + "x-example": "function" + }, + "resourceId": { + "type": "string", + "description": "ID of resource to which the variable belongs. If resourceType is \"project\", it is empty. If resourceType is \"function\", it is ID of the function.", + "x-example": "myAwesomeFunction" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "value", + "secret", + "resourceType", + "resourceId" + ] + }, + "country": { + "description": "Country", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "code": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + } + }, + "required": [ + "name", + "code" + ] + }, + "continent": { + "description": "Continent", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Continent name.", + "x-example": "Europe" + }, + "code": { + "type": "string", + "description": "Continent two letter code.", + "x-example": "EU" + } + }, + "required": [ + "name", + "code" + ] + }, + "language": { + "description": "Language", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Language name.", + "x-example": "Italian" + }, + "code": { + "type": "string", + "description": "Language two-character ISO 639-1 codes.", + "x-example": "it" + }, + "nativeName": { + "type": "string", + "description": "Language native name.", + "x-example": "Italiano" + } + }, + "required": [ + "name", + "code", + "nativeName" + ] + }, + "currency": { + "description": "Currency", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Currency symbol.", + "x-example": "$" + }, + "name": { + "type": "string", + "description": "Currency name.", + "x-example": "US dollar" + }, + "symbolNative": { + "type": "string", + "description": "Currency native symbol.", + "x-example": "$" + }, + "decimalDigits": { + "type": "integer", + "description": "Number of decimal digits.", + "x-example": 2, + "format": "int32" + }, + "rounding": { + "type": "number", + "description": "Currency digit rounding.", + "x-example": 0, + "format": "double" + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.", + "x-example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "x-example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ] + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "x-example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "code", + "countryCode", + "countryName" + ] + }, + "healthAntivirus": { + "description": "Health Antivirus", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Antivirus version.", + "x-example": "1.0.0" + }, + "status": { + "type": "string", + "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", + "x-example": "online" + } + }, + "required": [ + "version", + "status" + ] + }, + "healthQueue": { + "description": "Health Queue", + "type": "object", + "properties": { + "size": { + "type": "integer", + "description": "Amount of actions in the queue.", + "x-example": 8, + "format": "int32" + } + }, + "required": [ + "size" + ] + }, + "healthStatus": { + "description": "Health Status", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the service.", + "x-example": "database" + }, + "ping": { + "type": "integer", + "description": "Duration in milliseconds how long the health check took.", + "x-example": 128, + "format": "int32" + }, + "status": { + "type": "string", + "description": "Service status. Possible values can are: `pass`, `fail`", + "x-example": "pass" + } + }, + "required": [ + "name", + "ping", + "status" + ] + }, + "healthCertificate": { + "description": "Health Certificate", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Certificate name", + "x-example": "\/CN=www.google.com" + }, + "subjectSN": { + "type": "string", + "description": "Subject SN", + "x-example": "" + }, + "issuerOrganisation": { + "type": "string", + "description": "Issuer organisation", + "x-example": "" + }, + "validFrom": { + "type": "string", + "description": "Valid from", + "x-example": "1704200998" + }, + "validTo": { + "type": "string", + "description": "Valid to", + "x-example": "1711458597" + }, + "signatureTypeSN": { + "type": "string", + "description": "Signature type SN", + "x-example": "RSA-SHA256" + } + }, + "required": [ + "name", + "subjectSN", + "issuerOrganisation", + "validFrom", + "validTo", + "signatureTypeSN" + ] + }, + "healthTime": { + "description": "Health Time", + "type": "object", + "properties": { + "remoteTime": { + "type": "integer", + "description": "Current unix timestamp on trustful remote server.", + "x-example": 1639490751, + "format": "int32" + }, + "localTime": { + "type": "integer", + "description": "Current unix timestamp of local server where Appwrite runs.", + "x-example": 1639490844, + "format": "int32" + }, + "diff": { + "type": "integer", + "description": "Difference of unix remote and local timestamps in milliseconds.", + "x-example": 93, + "format": "int32" + } + }, + "required": [ + "remoteTime", + "localTime", + "diff" + ] + }, + "metric": { + "description": "Metric", + "type": "object", + "properties": { + "value": { + "type": "integer", + "description": "The value of this metric at the timestamp.", + "x-example": 1, + "format": "int32" + }, + "date": { + "type": "string", + "description": "The date at which this metric was aggregated in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "value", + "date" + ] + }, + "metricBreakdown": { + "description": "Metric Breakdown", + "type": "object", + "properties": { + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c16897e", + "x-nullable": true + }, + "name": { + "type": "string", + "description": "Resource name.", + "x-example": "Documents" + }, + "value": { + "type": "integer", + "description": "The value of this metric at the timestamp.", + "x-example": 1, + "format": "int32" + }, + "estimate": { + "type": "number", + "description": "The estimated value of this metric at the end of the period.", + "x-example": 1, + "format": "double", + "x-nullable": true + } + }, + "required": [ + "name", + "value" + ] + }, + "usageDatabases": { + "description": "UsageDatabases", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "databasesTotal": { + "type": "integer", + "description": "Total aggregated number of databases.", + "x-example": 0, + "format": "int32" + }, + "collectionsTotal": { + "type": "integer", + "description": "Total aggregated number of collections.", + "x-example": 0, + "format": "int32" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of documents.", + "x-example": 0, + "format": "int32" + }, + "storageTotal": { + "type": "integer", + "description": "Total aggregated number of total databases storage in bytes.", + "x-example": 0, + "format": "int32" + }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, + "databases": { + "type": "array", + "description": "Aggregated number of databases per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "collections": { + "type": "array", + "description": "Aggregated number of collections per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "documents": { + "type": "array", + "description": "Aggregated number of documents per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "An array of the aggregated number of databases storage in bytes per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "databasesTotal", + "collectionsTotal", + "documentsTotal", + "storageTotal", + "databasesReadsTotal", + "databasesWritesTotal", + "databases", + "collections", + "documents", + "storage", + "databasesReads", + "databasesWrites" + ] + }, + "usageDatabase": { + "description": "UsageDatabase", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "collectionsTotal": { + "type": "integer", + "description": "Total aggregated number of collections.", + "x-example": 0, + "format": "int32" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of documents.", + "x-example": 0, + "format": "int32" + }, + "storageTotal": { + "type": "integer", + "description": "Total aggregated number of total storage used in bytes.", + "x-example": 0, + "format": "int32" + }, + "databaseReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databaseWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, + "collections": { + "type": "array", + "description": "Aggregated number of collections per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "documents": { + "type": "array", + "description": "Aggregated number of documents per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "Aggregated storage used in bytes per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databaseReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databaseWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "collectionsTotal", + "documentsTotal", + "storageTotal", + "databaseReadsTotal", + "databaseWritesTotal", + "collections", + "documents", + "storage", + "databaseReads", + "databaseWrites" + ] + }, + "usageCollection": { + "description": "UsageCollection", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of of documents.", + "x-example": 0, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "Aggregated number of documents per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "documentsTotal", + "documents" + ] + }, + "usageUsers": { + "description": "UsageUsers", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "usersTotal": { + "type": "integer", + "description": "Total aggregated number of statistics of users.", + "x-example": 0, + "format": "int32" + }, + "sessionsTotal": { + "type": "integer", + "description": "Total aggregated number of active sessions.", + "x-example": 0, + "format": "int32" + }, + "users": { + "type": "array", + "description": "Aggregated number of users per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "sessions": { + "type": "array", + "description": "Aggregated number of active sessions per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "usersTotal", + "sessionsTotal", + "users", + "sessions" + ] + }, + "usageStorage": { + "description": "StorageUsage", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "bucketsTotal": { + "type": "integer", + "description": "Total aggregated number of buckets", + "x-example": 0, + "format": "int32" + }, + "filesTotal": { + "type": "integer", + "description": "Total aggregated number of files.", + "x-example": 0, + "format": "int32" + }, + "filesStorageTotal": { + "type": "integer", + "description": "Total aggregated number of files storage (in bytes).", + "x-example": 0, + "format": "int32" + }, + "buckets": { + "type": "array", + "description": "Aggregated number of buckets per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "files": { + "type": "array", + "description": "Aggregated number of files per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "Aggregated number of files storage (in bytes) per period .", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "bucketsTotal", + "filesTotal", + "filesStorageTotal", + "buckets", + "files", + "storage" + ] + }, + "usageBuckets": { + "description": "UsageBuckets", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "filesTotal": { + "type": "integer", + "description": "Total aggregated number of bucket files.", + "x-example": 0, + "format": "int32" + }, + "filesStorageTotal": { + "type": "integer", + "description": "Total aggregated number of bucket files storage (in bytes).", + "x-example": 0, + "format": "int32" + }, + "files": { + "type": "array", + "description": "Aggregated number of bucket files per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "storage": { + "type": "array", + "description": "Aggregated number of bucket storage files (in bytes) per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "imageTransformations": { + "type": "array", + "description": "Aggregated number of files transformations per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "imageTransformationsTotal": { + "type": "integer", + "description": "Total aggregated number of files transformations.", + "x-example": 0, + "format": "int32" + } + }, + "required": [ + "range", + "filesTotal", + "filesStorageTotal", + "files", + "storage", + "imageTransformations", + "imageTransformationsTotal" + ] + }, + "usageFunctions": { + "description": "UsageFunctions", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "functionsTotal": { + "type": "integer", + "description": "Total aggregated number of functions.", + "x-example": 0, + "format": "int32" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of functions deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of functions deployment storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of functions build.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of functions build storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of functions execution.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "functions": { + "type": "array", + "description": "Aggregated number of functions per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": 0 + }, + "deployments": { + "type": "array", + "description": "Aggregated number of functions deployment per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of functions deployment storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "builds": { + "type": "array", + "description": "Aggregated number of functions build per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of functions build storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of functions build compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated sum of functions build mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of functions execution per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of functions execution compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of functions mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful function builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed function builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "functionsTotal", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "functions", + "deployments", + "deploymentsStorage", + "buildsSuccessTotal", + "buildsFailedTotal", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed" + ] + }, + "usageFunction": { + "description": "UsageFunction", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of function deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of function deployments storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of function builds storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeAverage": { + "type": "integer", + "description": "Average builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "Aggregated number of function deployments per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of function deployments storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "builds": { + "type": "array", + "description": "Aggregated number of function builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of function builds storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of function builds compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated number of function builds mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of function executions per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of function executions compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of function mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsSuccessTotal", + "buildsFailedTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsTimeAverage", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed" + ] + }, + "usageSites": { + "description": "UsageSites", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "Time range of the usage stats.", + "x-example": "30d" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of functions deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of functions deployment storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of functions build.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of functions build storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions build mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of functions execution.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of functions execution mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "Aggregated number of functions deployment per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of functions deployment storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "builds": { + "type": "array", + "description": "Aggregated number of functions build per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of functions build storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of functions build compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated sum of functions build mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of functions execution per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of functions execution compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of functions mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful function builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed function builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "sitesTotal": { + "type": "integer", + "description": "Total aggregated number of sites.", + "x-example": 0, + "format": "int32" + }, + "sites": { + "type": "array", + "description": "Aggregated number of sites per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "requestsTotal": { + "type": "integer", + "description": "Total aggregated number of requests.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "inboundTotal": { + "type": "integer", + "description": "Total aggregated inbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "inbound": { + "type": "array", + "description": "Aggregated number of inbound bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "outboundTotal": { + "type": "integer", + "description": "Total aggregated outbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "outbound": { + "type": "array", + "description": "Aggregated number of outbound bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "buildsSuccessTotal", + "buildsFailedTotal", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed", + "sitesTotal", + "sites", + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound" + ] + }, + "usageSite": { + "description": "UsageSite", + "type": "object", + "properties": { + "range": { + "type": "string", + "description": "The time range of the usage stats.", + "x-example": "30d" + }, + "deploymentsTotal": { + "type": "integer", + "description": "Total aggregated number of function deployments.", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of function deployments storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTotal": { + "type": "integer", + "description": "Total aggregated number of function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsSuccessTotal": { + "type": "integer", + "description": "Total aggregated number of successful function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsFailedTotal": { + "type": "integer", + "description": "Total aggregated number of failed function builds.", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "total aggregated sum of function builds storage.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsTimeAverage": { + "type": "integer", + "description": "Average builds compute time.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "executionsTimeTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions compute time.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated sum of function executions mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "Aggregated number of function deployments per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "deploymentsStorage": { + "type": "array", + "description": "Aggregated number of function deployments storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "builds": { + "type": "array", + "description": "Aggregated number of function builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsStorage": { + "type": "array", + "description": "Aggregated sum of function builds storage per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsTime": { + "type": "array", + "description": "Aggregated sum of function builds compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsMbSeconds": { + "type": "array", + "description": "Aggregated number of function builds mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of function executions per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsTime": { + "type": "array", + "description": "Aggregated number of function executions compute time per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsMbSeconds": { + "type": "array", + "description": "Aggregated number of function mbSeconds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsSuccess": { + "type": "array", + "description": "Aggregated number of successful builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "buildsFailed": { + "type": "array", + "description": "Aggregated number of failed builds per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "requestsTotal": { + "type": "integer", + "description": "Total aggregated number of requests.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "inboundTotal": { + "type": "integer", + "description": "Total aggregated inbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "inbound": { + "type": "array", + "description": "Aggregated number of inbound bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "outboundTotal": { + "type": "integer", + "description": "Total aggregated outbound bandwidth.", + "x-example": 0, + "format": "int32" + }, + "outbound": { + "type": "array", + "description": "Aggregated number of outbound bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + } + }, + "required": [ + "range", + "deploymentsTotal", + "deploymentsStorageTotal", + "buildsTotal", + "buildsSuccessTotal", + "buildsFailedTotal", + "buildsStorageTotal", + "buildsTimeTotal", + "buildsTimeAverage", + "buildsMbSecondsTotal", + "executionsTotal", + "executionsTimeTotal", + "executionsMbSecondsTotal", + "deployments", + "deploymentsStorage", + "builds", + "buildsStorage", + "buildsTime", + "buildsMbSeconds", + "executions", + "executionsTime", + "executionsMbSeconds", + "buildsSuccess", + "buildsFailed", + "requestsTotal", + "requests", + "inboundTotal", + "inbound", + "outboundTotal", + "outbound" + ] + }, + "usageProject": { + "description": "UsageProject", + "type": "object", + "properties": { + "executionsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions.", + "x-example": 0, + "format": "int32" + }, + "documentsTotal": { + "type": "integer", + "description": "Total aggregated number of documents.", + "x-example": 0, + "format": "int32" + }, + "databasesTotal": { + "type": "integer", + "description": "Total aggregated number of databases.", + "x-example": 0, + "format": "int32" + }, + "databasesStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of databases storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "usersTotal": { + "type": "integer", + "description": "Total aggregated number of users.", + "x-example": 0, + "format": "int32" + }, + "filesStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of files storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "functionsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of functions storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "buildsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of builds storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "deploymentsStorageTotal": { + "type": "integer", + "description": "Total aggregated sum of deployments storage size (in bytes).", + "x-example": 0, + "format": "int32" + }, + "bucketsTotal": { + "type": "integer", + "description": "Total aggregated number of buckets.", + "x-example": 0, + "format": "int32" + }, + "executionsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated number of function executions mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "buildsMbSecondsTotal": { + "type": "integer", + "description": "Total aggregated number of function builds mbSeconds.", + "x-example": 0, + "format": "int32" + }, + "databasesReadsTotal": { + "type": "integer", + "description": "Total number of databases reads.", + "x-example": 0, + "format": "int32" + }, + "databasesWritesTotal": { + "type": "integer", + "description": "Total number of databases writes.", + "x-example": 0, + "format": "int32" + }, + "requests": { + "type": "array", + "description": "Aggregated number of requests per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "network": { + "type": "array", + "description": "Aggregated number of consumed bandwidth per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "users": { + "type": "array", + "description": "Aggregated number of users per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executions": { + "type": "array", + "description": "Aggregated number of executions per period.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "executionsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of executions by functions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "bucketsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of usage by buckets.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "databasesStorageBreakdown": { + "type": "array", + "description": "An array of the aggregated breakdown of storage usage by databases.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "executionsMbSecondsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of execution mbSeconds by functions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "buildsMbSecondsBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of build mbSeconds by functions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "functionsStorageBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of functions storage size (in bytes).", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "authPhoneTotal": { + "type": "integer", + "description": "Total aggregated number of phone auth.", + "x-example": 0, + "format": "int32" + }, + "authPhoneEstimate": { + "type": "number", + "description": "Estimated total aggregated cost of phone auth.", + "x-example": 0, + "format": "double" + }, + "authPhoneCountryBreakdown": { + "type": "array", + "description": "Aggregated breakdown in totals of phone auth by country.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metricBreakdown" + }, + "x-example": [] + }, + "databasesReads": { + "type": "array", + "description": "An array of aggregated number of database reads.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "databasesWrites": { + "type": "array", + "description": "An array of aggregated number of database writes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "imageTransformations": { + "type": "array", + "description": "An array of aggregated number of image transformations.", + "items": { + "type": "object", + "$ref": "#\/definitions\/metric" + }, + "x-example": [] + }, + "imageTransformationsTotal": { + "type": "integer", + "description": "Total aggregated number of image transformations.", + "x-example": 0, + "format": "int32" + } + }, + "required": [ + "executionsTotal", + "documentsTotal", + "databasesTotal", + "databasesStorageTotal", + "usersTotal", + "filesStorageTotal", + "functionsStorageTotal", + "buildsStorageTotal", + "deploymentsStorageTotal", + "bucketsTotal", + "executionsMbSecondsTotal", + "buildsMbSecondsTotal", + "databasesReadsTotal", + "databasesWritesTotal", + "requests", + "network", + "users", + "executions", + "executionsBreakdown", + "bucketsBreakdown", + "databasesStorageBreakdown", + "executionsMbSecondsBreakdown", + "buildsMbSecondsBreakdown", + "functionsStorageBreakdown", + "authPhoneTotal", + "authPhoneEstimate", + "authPhoneCountryBreakdown", + "databasesReads", + "databasesWrites", + "imageTransformations", + "imageTransformationsTotal" + ] + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "x-example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "x-example": "application\/json" + } + }, + "required": [ + "name", + "value" + ] + }, + "specification": { + "description": "Specification", + "type": "object", + "properties": { + "memory": { + "type": "integer", + "description": "Memory size in MB.", + "x-example": 512, + "format": "int32" + }, + "cpus": { + "type": "number", + "description": "Number of CPUs.", + "x-example": 1, + "format": "double" + }, + "enabled": { + "type": "boolean", + "description": "Is size enabled.", + "x-example": true + }, + "slug": { + "type": "string", + "description": "Size slug.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "memory", + "cpus", + "enabled", + "slug" + ] + }, + "proxyRule": { + "description": "Rule", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Rule ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Rule creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Rule update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "domain": { + "type": "string", + "description": "Domain name.", + "x-example": "appwrite.company.com" + }, + "type": { + "type": "string", + "description": "Action definition for the rule. Possible values are \"api\", \"deployment\", or \"redirect\"", + "x-example": "deployment" + }, + "trigger": { + "type": "string", + "description": "Defines how the rule was created. Possible values are \"manual\" or \"deployment\"", + "x-example": "manual" + }, + "redirectUrl": { + "type": "string", + "description": "URL to redirect to. Used if type is \"redirect\"", + "x-example": "https:\/\/appwrite.io\/docs" + }, + "redirectStatusCode": { + "type": "integer", + "description": "Status code to apply during redirect. Used if type is \"redirect\"", + "x-example": 301, + "format": "int32" + }, + "deploymentId": { + "type": "string", + "description": "ID of deployment. Used if type is \"deployment\"", + "x-example": "n3u9feiwmf" + }, + "deploymentResourceType": { + "type": "string", + "description": "Type of deployment. Possible values are \"function\", \"site\". Used if rule's type is \"deployment\".", + "x-example": "function" + }, + "deploymentResourceId": { + "type": "string", + "description": "ID deployment's resource. Used if type is \"deployment\"", + "x-example": "n3u9feiwmf" + }, + "deploymentVcsProviderBranch": { + "type": "string", + "description": "Name of Git branch that updates rule. Used if type is \"deployment\"", + "x-example": "function" + }, + "status": { + "type": "string", + "description": "Domain verification status. Possible values are \"created\", \"verifying\", \"verified\" and \"unverified\"", + "x-example": "verified" + }, + "logs": { + "type": "string", + "description": "Certificate generation logs. This will return an empty string if generation did not run, or succeeded.", + "x-example": "HTTP challegne failed." + }, + "renewAt": { + "type": "string", + "description": "Certificate auto-renewal date in ISO 8601 format.", + "x-example": "datetime" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "domain", + "type", + "trigger", + "redirectUrl", + "redirectStatusCode", + "deploymentId", + "deploymentResourceType", + "deploymentResourceId", + "deploymentVcsProviderBranch", + "status", + "logs", + "renewAt" + ] + }, + "smsTemplate": { + "description": "SmsTemplate", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Template type", + "x-example": "verification" + }, + "locale": { + "type": "string", + "description": "Template locale", + "x-example": "en_us" + }, + "message": { + "type": "string", + "description": "Template message", + "x-example": "Click on the link to verify your account." + } + }, + "required": [ + "type", + "locale", + "message" + ] + }, + "emailTemplate": { + "description": "EmailTemplate", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Template type", + "x-example": "verification" + }, + "locale": { + "type": "string", + "description": "Template locale", + "x-example": "en_us" + }, + "message": { + "type": "string", + "description": "Template message", + "x-example": "Click on the link to verify your account." + }, + "senderName": { + "type": "string", + "description": "Name of the sender", + "x-example": "My User" + }, + "senderEmail": { + "type": "string", + "description": "Email of the sender", + "x-example": "mail@appwrite.io" + }, + "replyTo": { + "type": "string", + "description": "Reply to email address", + "x-example": "emails@appwrite.io" + }, + "subject": { + "type": "string", + "description": "Email subject", + "x-example": "Please verify your email address" + } + }, + "required": [ + "type", + "locale", + "message", + "senderName", + "senderEmail", + "replyTo", + "subject" + ] + }, + "consoleVariables": { + "description": "Console Variables", + "type": "object", + "properties": { + "_APP_DOMAIN_TARGET_CNAME": { + "type": "string", + "description": "CNAME target for your Appwrite custom domains.", + "x-example": "appwrite.io" + }, + "_APP_DOMAIN_TARGET_A": { + "type": "string", + "description": "A target for your Appwrite custom domains.", + "x-example": "127.0.0.1" + }, + "_APP_DOMAIN_TARGET_AAAA": { + "type": "string", + "description": "AAAA target for your Appwrite custom domains.", + "x-example": "::1" + }, + "_APP_STORAGE_LIMIT": { + "type": "integer", + "description": "Maximum file size allowed for file upload in bytes.", + "x-example": "30000000", + "format": "int32" + }, + "_APP_COMPUTE_SIZE_LIMIT": { + "type": "integer", + "description": "Maximum file size allowed for deployment in bytes.", + "x-example": "30000000", + "format": "int32" + }, + "_APP_USAGE_STATS": { + "type": "string", + "description": "Defines if usage stats are enabled. This value is set to 'enabled' by default, to disable the usage stats set the value to 'disabled'.", + "x-example": "enabled" + }, + "_APP_VCS_ENABLED": { + "type": "boolean", + "description": "Defines if VCS (Version Control System) is enabled.", + "x-example": true + }, + "_APP_DOMAIN_ENABLED": { + "type": "boolean", + "description": "Defines if main domain is configured. If so, custom domains can be created.", + "x-example": true + }, + "_APP_ASSISTANT_ENABLED": { + "type": "boolean", + "description": "Defines if AI assistant is enabled.", + "x-example": true + }, + "_APP_DOMAIN_SITES": { + "type": "string", + "description": "A domain to use for site URLs.", + "x-example": "sites.localhost" + }, + "_APP_DOMAIN_FUNCTIONS": { + "type": "string", + "description": "A domain to use for function URLs.", + "x-example": "functions.localhost" + }, + "_APP_OPTIONS_FORCE_HTTPS": { + "type": "string", + "description": "Defines if HTTPS is enforced for all requests.", + "x-example": "enabled" + }, + "_APP_DOMAINS_NAMESERVERS": { + "type": "string", + "description": "Comma-separated list of nameservers.", + "x-example": "ns1.example.com,ns2.example.com" + } + }, + "required": [ + "_APP_DOMAIN_TARGET_CNAME", + "_APP_DOMAIN_TARGET_A", + "_APP_DOMAIN_TARGET_AAAA", + "_APP_STORAGE_LIMIT", + "_APP_COMPUTE_SIZE_LIMIT", + "_APP_USAGE_STATS", + "_APP_VCS_ENABLED", + "_APP_DOMAIN_ENABLED", + "_APP_ASSISTANT_ENABLED", + "_APP_DOMAIN_SITES", + "_APP_DOMAIN_FUNCTIONS", + "_APP_OPTIONS_FORCE_HTTPS", + "_APP_DOMAINS_NAMESERVERS" + ] + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ] + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "x-example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ] + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "x-example": true + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "x-example": true + } + }, + "required": [ + "secret", + "uri" + ] + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "x-example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "x-example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "x-example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "x-example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode" + ] + }, + "provider": { + "description": "Provider", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Provider ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Provider creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Provider update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name for the provider instance.", + "x-example": "Mailgun" + }, + "provider": { + "type": "string", + "description": "The name of the provider service.", + "x-example": "mailgun" + }, + "enabled": { + "type": "boolean", + "description": "Is provider enabled?", + "x-example": true + }, + "type": { + "type": "string", + "description": "Type of provider.", + "x-example": "sms" + }, + "credentials": { + "type": "object", + "additionalProperties": true, + "description": "Provider credentials.", + "x-example": { + "key": "123456789" + } + }, + "options": { + "type": "object", + "additionalProperties": true, + "description": "Provider options.", + "x-example": { + "from": "sender-email@mydomain" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "provider", + "enabled", + "type", + "credentials" + ] + }, + "message": { + "description": "Message", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Message ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Message creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Message update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerType": { + "type": "string", + "description": "Message provider type.", + "x-example": "email" + }, + "topics": { + "type": "array", + "description": "Topic IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "users": { + "type": "array", + "description": "User IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "targets": { + "type": "array", + "description": "Target IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for message.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + }, + "deliveredAt": { + "type": "string", + "description": "The time when the message was delivered.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + }, + "deliveryErrors": { + "type": "array", + "description": "Delivery errors if any.", + "items": { + "type": "string" + }, + "x-example": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "x-nullable": true + }, + "deliveredTotal": { + "type": "integer", + "description": "Number of recipients the message was delivered to.", + "x-example": 1, + "format": "int32" + }, + "data": { + "type": "object", + "additionalProperties": true, + "description": "Data of the message.", + "x-example": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + } + }, + "status": { + "type": "string", + "description": "Status of delivery.", + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "providerType", + "topics", + "users", + "targets", + "deliveredTotal", + "data", + "status" + ] + }, + "topic": { + "description": "Topic", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Topic creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Topic update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name of the topic.", + "x-example": "events" + }, + "emailTotal": { + "type": "integer", + "description": "Total count of email subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "smsTotal": { + "type": "integer", + "description": "Total count of SMS subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "pushTotal": { + "type": "integer", + "description": "Total count of push subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "subscribe": { + "type": "array", + "description": "Subscribe permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "emailTotal", + "smsTotal", + "pushTotal", + "subscribe" + ] + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "x-example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + } + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ] + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "x-example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "x-example": "259125845563242502", + "x-nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ] + }, + "migration": { + "description": "Migration", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Migration ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Migration creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "string", + "description": "Migration status ( pending, processing, failed, completed ) ", + "x-example": "pending" + }, + "stage": { + "type": "string", + "description": "Migration stage ( init, processing, source-check, destination-check, migrating, finished )", + "x-example": "init" + }, + "source": { + "type": "string", + "description": "A string containing the type of source of the migration.", + "x-example": "Appwrite" + }, + "destination": { + "type": "string", + "description": "A string containing the type of destination of the migration.", + "x-example": "Appwrite" + }, + "resources": { + "type": "array", + "description": "Resources to migrate.", + "items": { + "type": "string" + }, + "x-example": [ + "user" + ] + }, + "resourceId": { + "type": "string", + "description": "Id of the resource to migrate.", + "x-example": "databaseId:collectionId" + }, + "statusCounters": { + "type": "object", + "additionalProperties": true, + "description": "A group of counters that represent the total progress of the migration.", + "x-example": "{\"Database\": {\"PENDING\": 0, \"SUCCESS\": 1, \"ERROR\": 0, \"SKIP\": 0, \"PROCESSING\": 0, \"WARNING\": 0}}" + }, + "resourceData": { + "type": "object", + "additionalProperties": true, + "description": "An array of objects containing the report data of the resources that were migrated.", + "x-example": "[{\"resource\":\"Database\",\"id\":\"public\",\"status\":\"SUCCESS\",\"message\":\"\"}]" + }, + "errors": { + "type": "array", + "description": "All errors that occurred during the migration process.", + "items": { + "type": "string" + }, + "x-example": [] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "status", + "stage", + "source", + "destination", + "resources", + "resourceId", + "statusCounters", + "resourceData", + "errors" + ] + }, + "migrationReport": { + "description": "Migration Report", + "type": "object", + "properties": { + "user": { + "type": "integer", + "description": "Number of users to be migrated.", + "x-example": 20, + "format": "int32" + }, + "team": { + "type": "integer", + "description": "Number of teams to be migrated.", + "x-example": 20, + "format": "int32" + }, + "database": { + "type": "integer", + "description": "Number of databases to be migrated.", + "x-example": 20, + "format": "int32" + }, + "document": { + "type": "integer", + "description": "Number of documents to be migrated.", + "x-example": 20, + "format": "int32" + }, + "file": { + "type": "integer", + "description": "Number of files to be migrated.", + "x-example": 20, + "format": "int32" + }, + "bucket": { + "type": "integer", + "description": "Number of buckets to be migrated.", + "x-example": 20, + "format": "int32" + }, + "function": { + "type": "integer", + "description": "Number of functions to be migrated.", + "x-example": 20, + "format": "int32" + }, + "size": { + "type": "integer", + "description": "Size of files to be migrated in mb.", + "x-example": 30000, + "format": "int32" + }, + "version": { + "type": "string", + "description": "Version of the Appwrite instance to be migrated.", + "x-example": "1.4.0" + } + }, + "required": [ + "user", + "team", + "database", + "document", + "file", + "bucket", + "function", + "size", + "version" + ] + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file diff --git a/app/config/specs/swagger2-1.8.x-server.json b/app/config/specs/swagger2-1.8.x-server.json new file mode 100644 index 0000000000..7c15f9e5ea --- /dev/null +++ b/app/config/specs/swagger2-1.8.x-server.json @@ -0,0 +1,30828 @@ +{ + "swagger": "2.0", + "info": { + "version": "1.7.4", + "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@appwrite.io" + }, + "license": { + "name": "BSD-3-Clause", + "url": "https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE" + } + }, + "host": "cloud.appwrite.io", + "x-host-docs": "<REGION>.cloud.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", + "x-appwrite": { + "demo": "<YOUR_PROJECT_ID>" + } + }, + "Key": { + "type": "apiKey", + "name": "X-Appwrite-Key", + "description": "Your secret API key", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_API_KEY>" + } + }, + "JWT": { + "type": "apiKey", + "name": "X-Appwrite-JWT", + "description": "Your secret JSON Web Token", + "in": "header", + "x-appwrite": { + "demo": "<YOUR_JWT>" + } + }, + "Locale": { + "type": "apiKey", + "name": "X-Appwrite-Locale", + "description": "", + "in": "header", + "x-appwrite": { + "demo": "en" + } + }, + "Session": { + "type": "apiKey", + "name": "X-Appwrite-Session", + "description": "The user session to authenticate with", + "in": "header" + }, + "ForwardedUserAgent": { + "type": "apiKey", + "name": "X-Forwarded-User-Agent", + "description": "The user agent string of the client that made the request", + "in": "header" + } + }, + "paths": { + "\/account": { + "get": { + "summary": "Get account", + "operationId": "accountGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the currently logged in user.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "account", + "weight": 10, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create account", + "operationId": "accountCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createEmailSession).", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "create", + "group": "account", + "weight": 9, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "default": null, + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/email": { + "patch": { + "summary": "Update email", + "operationId": "accountUpdateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateEmail", + "group": "account", + "weight": 35, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/identities": { + "get": { + "summary": "List identities", + "operationId": "accountListIdentities", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of identities for the currently logged in user.", + "responses": { + "200": { + "description": "Identities List", + "schema": { + "$ref": "#\/definitions\/identityList" + } + } + }, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 58, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "accountDeleteIdentity", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 59, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "type": "string", + "x-example": "<IDENTITY_ID>", + "in": "path" + } + ] + } + }, + "\/account\/jwts": { + "post": { + "summary": "Create JWT", + "operationId": "accountCreateJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.", + "responses": { + "201": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "x-appwrite": { + "method": "createJWT", + "group": "tokens", + "weight": 30, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md", + "rate-limit": 100, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/logs": { + "get": { + "summary": "List logs", + "operationId": "accountListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 32, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "accountUpdateMFA", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Enable or disable MFA on an account.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateMFA", + "group": "mfa", + "weight": 45, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-m-f-a.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "default": null, + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + ] + } + }, + "\/account\/mfa\/authenticators\/{type}": { + "post": { + "summary": "Create authenticator", + "operationId": "accountCreateMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](\/docs\/references\/cloud\/client-web\/account#updateMfaAuthenticator) method.", + "responses": { + "200": { + "description": "MFAType", + "schema": { + "$ref": "#\/definitions\/mfaType" + } + } + }, + "x-appwrite": { + "method": "createMfaAuthenticator", + "group": "mfa", + "weight": 47, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator. Must be `totp`", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + }, + "put": { + "summary": "Update authenticator (confirmation)", + "operationId": "accountUpdateMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Verify an authenticator app after adding it using the [add authenticator](\/docs\/references\/cloud\/client-web\/account#createMfaAuthenticator) method.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateMfaAuthenticator", + "group": "mfa", + "weight": 48, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "otp": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<OTP>" + } + }, + "required": [ + "otp" + ] + } + } + ] + }, + "delete": { + "summary": "Delete authenticator", + "operationId": "accountDeleteMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete an authenticator for a user by ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 52, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + } + }, + "\/account\/mfa\/challenge": { + "post": { + "summary": "Create MFA challenge", + "operationId": "accountCreateMfaChallenge", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](\/docs\/references\/cloud\/client-web\/account#updateMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Challenge", + "schema": { + "$ref": "#\/definitions\/mfaChallenge" + } + } + }, + "x-appwrite": { + "method": "createMfaChallenge", + "group": "mfa", + "weight": 53, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "factor": { + "type": "string", + "description": "Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.", + "default": null, + "x-example": "email", + "enum": [ + "email", + "phone", + "totp", + "recoverycode" + ], + "x-enum-name": "AuthenticationFactor", + "x-enum-keys": [] + } + }, + "required": [ + "factor" + ] + } + } + ] + }, + "put": { + "summary": "Update MFA challenge (confirmation)", + "operationId": "accountUpdateMfaChallenge", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "updateMfaChallenge", + "group": "mfa", + "weight": 54, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-challenge.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-challenge.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},challengeId:{param-challengeId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "challengeId": { + "type": "string", + "description": "ID of the challenge.", + "default": null, + "x-example": "<CHALLENGE_ID>" + }, + "otp": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<OTP>" + } + }, + "required": [ + "challengeId", + "otp" + ] + } + } + ] + } + }, + "\/account\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "accountListMfaFactors", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "schema": { + "$ref": "#\/definitions\/mfaFactors" + } + } + }, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 46, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/mfa\/recovery-codes": { + "get": { + "summary": "List MFA recovery codes", + "operationId": "accountGetMfaRecoveryCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 51, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "post": { + "summary": "Create MFA recovery codes", + "operationId": "accountCreateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 49, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "accountUpdateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 50, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/name": { + "patch": { + "summary": "Update name", + "operationId": "accountUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account name.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "account", + "weight": 33, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + } + }, + "\/account\/password": { + "patch": { + "summary": "Update password", + "operationId": "accountUpdatePassword", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updatePassword", + "group": "account", + "weight": 34, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "default": null, + "x-example": null + }, + "oldPassword": { + "type": "string", + "description": "Current user password. Must be at least 8 chars.", + "default": "", + "x-example": "password" + } + }, + "required": [ + "password" + ] + } + } + ] + } + }, + "\/account\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "accountUpdatePhone", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST \/account\/verification\/phone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createPhoneVerification) endpoint to send a confirmation SMS.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updatePhone", + "group": "account", + "weight": 36, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "phone", + "password" + ] + } + } + ] + } + }, + "\/account\/prefs": { + "get": { + "summary": "Get account preferences", + "operationId": "accountGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the preferences as a key-value object for the currently logged in user.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "account", + "weight": 31, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "patch": { + "summary": "Update preferences", + "operationId": "accountUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "account", + "weight": 37, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + }, + "\/account\/recovery": { + "post": { + "summary": "Create password recovery", + "operationId": "accountCreateRecovery", + "consumes": [ + "application\/json" + ], + "produces": [ + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createRecovery", + "group": "recovery", + "weight": 39, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "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.", + "default": null, + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "email", + "url" + ] + } + } + ] + }, + "put": { + "summary": "Update password recovery (confirmation)", + "operationId": "accountUpdateRecovery", + "consumes": [ + "application\/json" + ], + "produces": [ + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/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.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "updateRecovery", + "group": "recovery", + "weight": 40, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "sessions.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid reset token.", + "default": null, + "x-example": "<SECRET>" + }, + "password": { + "type": "string", + "description": "New user password. Must be between 8 and 256 chars.", + "default": null, + "x-example": null + } + }, + "required": [ + "userId", + "secret", + "password" + ] + } + } + ] + } + }, + "\/account\/sessions": { + "get": { + "summary": "List sessions", + "operationId": "accountListSessions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Get the list of active sessions across different devices for the currently logged in user.", + "responses": { + "200": { + "description": "Sessions List", + "schema": { + "$ref": "#\/definitions\/sessionList" + } + } + }, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 12, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/list-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "delete": { + "summary": "Delete sessions", + "operationId": "accountDeleteSessions", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Delete all sessions from the user account and remove any sessions cookies from the end client.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 13, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/sessions\/anonymous": { + "post": { + "summary": "Create anonymous session", + "operationId": "accountCreateAnonymousSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateEmail) or create an [OAuth2 session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#CreateOAuth2Session).", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "createAnonymousSession", + "group": "sessions", + "weight": 18, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-anonymous-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-anonymous.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ] + } + }, + "\/account\/sessions\/email": { + "post": { + "summary": "Create email password session", + "operationId": "accountCreateEmailPasswordSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "createEmailPasswordSession", + "group": "sessions", + "weight": 17, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-email-password-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session-email-password.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},email:{param-email}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password. Must be at least 8 chars.", + "default": null, + "x-example": "password" + } + }, + "required": [ + "email", + "password" + ] + } + } + ] + } + }, + "\/account\/sessions\/magic-url": { + "put": { + "summary": "Update magic URL session", + "operationId": "accountUpdateMagicURLSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "updateMagicURLSession", + "group": "sessions", + "weight": 27, + "cookies": false, + "type": "", + "deprecated": true, + "demo": "account\/update-magic-u-r-l-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/phone": { + "put": { + "summary": "Update phone session", + "operationId": "accountUpdatePhoneSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "updatePhoneSession", + "group": "sessions", + "weight": 28, + "cookies": false, + "type": "", + "deprecated": true, + "demo": "account\/update-phone-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/token": { + "post": { + "summary": "Create session", + "operationId": "accountCreateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 19, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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": "ip:{ip},userId:{param-userId}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/sessions\/{sessionId}": { + "get": { + "summary": "Get session", + "operationId": "accountGetSession", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "getSession", + "group": "sessions", + "weight": 14, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/get-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to get the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update session", + "operationId": "accountUpdateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.", + "responses": { + "200": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "updateSession", + "group": "sessions", + "weight": 16, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-session.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to update the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete session", + "operationId": "accountDeleteSession", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "account" + ], + "description": "Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#deleteSessions) instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 15, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "sessionId", + "description": "Session ID. Use the string 'current' to delete the current device session.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + } + }, + "\/account\/status": { + "patch": { + "summary": "Update status", + "operationId": "accountUpdateStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateStatus", + "group": "account", + "weight": 38, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-status.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + } + }, + "\/account\/tokens\/email": { + "post": { + "summary": "Create email token (OTP)", + "operationId": "accountCreateEmailToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createEmailToken", + "group": "tokens", + "weight": 26, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-email-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-email.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "default": false, + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + ] + } + }, + "\/account\/tokens\/magic-url": { + "post": { + "summary": "Create magic URL token", + "operationId": "accountCreateMagicURLToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createMagicURLToken", + "group": "tokens", + "weight": 25, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-magic-u-r-l-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-magic-url.md", + "rate-limit": 60, + "rate-time": 3600, + "rate-key": [ + "url:{url},email:{param-email}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the magic URL login. 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.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "phrase": { + "type": "boolean", + "description": "Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.", + "default": false, + "x-example": false + } + }, + "required": [ + "userId", + "email" + ] + } + } + ] + } + }, + "\/account\/tokens\/oauth2\/{provider}": { + "get": { + "summary": "Create OAuth2 token", + "operationId": "accountCreateOAuth2Token", + "consumes": [], + "produces": [ + "text\/html" + ], + "tags": [ + "account" + ], + "description": "Allow the user to login to their account using the OAuth2 provider of their 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. \n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "301": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "createOAuth2Token", + "group": "tokens", + "weight": 24, + "cookies": false, + "type": "webAuth", + "deprecated": false, + "demo": "account\/create-o-auth2token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-oauth2.md", + "rate-limit": 50, + "rate-time": 3600, + "rate-key": "ip:{ip}", + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "provider", + "description": "OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.", + "required": true, + "type": "string", + "x-example": "amazon", + "enum": [ + "amazon", + "apple", + "auth0", + "authentik", + "autodesk", + "bitbucket", + "bitly", + "box", + "dailymotion", + "discord", + "disqus", + "dropbox", + "etsy", + "facebook", + "figma", + "github", + "gitlab", + "google", + "linkedin", + "microsoft", + "notion", + "oidc", + "okta", + "paypal", + "paypalSandbox", + "podio", + "salesforce", + "slack", + "spotify", + "stripe", + "tradeshift", + "tradeshiftBox", + "twitch", + "wordpress", + "yahoo", + "yammer", + "yandex", + "zoho", + "zoom", + "mock" + ], + "x-enum-name": "OAuthProvider", + "x-enum-keys": [], + "in": "path" + }, + { + "name": "success", + "description": "URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's 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": "", + "in": "query" + }, + { + "name": "failure", + "description": "URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's 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": "", + "in": "query" + }, + { + "name": "scopes", + "description": "A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/account\/tokens\/phone": { + "post": { + "summary": "Create phone token", + "operationId": "accountCreatePhoneToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST \/v1\/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https:\/\/appwrite.io\/docs\/authentication-security#limits).", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createPhoneToken", + "group": "tokens", + "weight": 29, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-phone-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-token-phone.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},phone:{param-phone}", + "url:{url},ip:{ip}" + ], + "scope": "sessions.write", + "platforms": [ + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + } + }, + "required": [ + "userId", + "phone" + ] + } + } + ] + } + }, + "\/account\/verification": { + "post": { + "summary": "Create email verification", + "operationId": "accountCreateVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "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](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\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", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createVerification", + "group": "verification", + "weight": 41, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{userId}", + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "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.", + "default": null, + "x-example": "https:\/\/example.com" + } + }, + "required": [ + "url" + ] + } + } + ] + }, + "put": { + "summary": "Update email verification (confirmation)", + "operationId": "accountUpdateVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "updateVerification", + "group": "verification", + "weight": 42, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-email-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/account\/verification\/phone": { + "post": { + "summary": "Create phone verification", + "operationId": "accountCreatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createPhoneVerification", + "group": "verification", + "weight": 43, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/create-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": [ + "url:{url},userId:{userId}", + "url:{url},ip:{ip}" + ], + "scope": "account", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ] + }, + "put": { + "summary": "Update phone verification (confirmation)", + "operationId": "accountUpdatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "account" + ], + "description": "Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.", + "responses": { + "200": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "verification", + "weight": 44, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "account\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-phone-verification.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "userId:{param-userId}", + "scope": "public", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Valid verification token.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/avatars\/browsers\/{code}": { + "get": { + "summary": "Get browser icon", + "operationId": "avatarsGetBrowser", + "consumes": [], + "produces": [ + "image\/png" + ], + "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 [GET \/account\/sessions](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getBrowser", + "group": null, + "weight": 61, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Browser Code.", + "required": true, + "type": "string", + "x-example": "aa", + "enum": [ + "aa", + "an", + "ch", + "ci", + "cm", + "cr", + "ff", + "sf", + "mf", + "ps", + "oi", + "om", + "op", + "on" + ], + "x-enum-name": "Browser", + "x-enum-keys": [ + "Avant Browser", + "Android WebView Beta", + "Google Chrome", + "Google Chrome (iOS)", + "Google Chrome (Mobile)", + "Chromium", + "Mozilla Firefox", + "Safari", + "Mobile Safari", + "Microsoft Edge", + "Microsoft Edge (iOS)", + "Opera Mini", + "Opera", + "Opera (Next)" + ], + "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 keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/credit-cards\/{code}": { + "get": { + "summary": "Get credit card icon", + "operationId": "avatarsGetCreditCard", + "consumes": [], + "produces": [ + "image\/png" + ], + "tags": [ + "avatars" + ], + "description": "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getCreditCard", + "group": null, + "weight": 60, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.", + "required": true, + "type": "string", + "x-example": "amex", + "enum": [ + "amex", + "argencard", + "cabal", + "cencosud", + "diners", + "discover", + "elo", + "hipercard", + "jcb", + "mastercard", + "naranja", + "targeta-shopping", + "union-china-pay", + "visa", + "mir", + "maestro", + "rupay" + ], + "x-enum-name": "CreditCard", + "x-enum-keys": [ + "American Express", + "Argencard", + "Cabal", + "Cencosud", + "Diners Club", + "Discover", + "Elo", + "Hipercard", + "JCB", + "Mastercard", + "Naranja", + "Tarjeta Shopping", + "Union China Pay", + "Visa", + "MIR", + "Maestro", + "Rupay" + ], + "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 keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/favicon": { + "get": { + "summary": "Get favicon", + "operationId": "avatarsGetFavicon", + "consumes": [], + "produces": [ + "image\/*" + ], + "tags": [ + "avatars" + ], + "description": "Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getFavicon", + "group": null, + "weight": 64, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "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": "avatarsGetFlag", + "consumes": [], + "produces": [ + "image\/png" + ], + "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. Country codes follow the [ISO 3166-1](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getFlag", + "group": null, + "weight": 62, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "code", + "description": "Country Code. ISO Alpha-2 country code format.", + "required": true, + "type": "string", + "x-example": "af", + "enum": [ + "af", + "ao", + "al", + "ad", + "ae", + "ar", + "am", + "ag", + "au", + "at", + "az", + "bi", + "be", + "bj", + "bf", + "bd", + "bg", + "bh", + "bs", + "ba", + "by", + "bz", + "bo", + "br", + "bb", + "bn", + "bt", + "bw", + "cf", + "ca", + "ch", + "cl", + "cn", + "ci", + "cm", + "cd", + "cg", + "co", + "km", + "cv", + "cr", + "cu", + "cy", + "cz", + "de", + "dj", + "dm", + "dk", + "do", + "dz", + "ec", + "eg", + "er", + "es", + "ee", + "et", + "fi", + "fj", + "fr", + "fm", + "ga", + "gb", + "ge", + "gh", + "gn", + "gm", + "gw", + "gq", + "gr", + "gd", + "gt", + "gy", + "hn", + "hr", + "ht", + "hu", + "id", + "in", + "ie", + "ir", + "iq", + "is", + "il", + "it", + "jm", + "jo", + "jp", + "kz", + "ke", + "kg", + "kh", + "ki", + "kn", + "kr", + "kw", + "la", + "lb", + "lr", + "ly", + "lc", + "li", + "lk", + "ls", + "lt", + "lu", + "lv", + "ma", + "mc", + "md", + "mg", + "mv", + "mx", + "mh", + "mk", + "ml", + "mt", + "mm", + "me", + "mn", + "mz", + "mr", + "mu", + "mw", + "my", + "na", + "ne", + "ng", + "ni", + "nl", + "no", + "np", + "nr", + "nz", + "om", + "pk", + "pa", + "pe", + "ph", + "pw", + "pg", + "pl", + "pf", + "kp", + "pt", + "py", + "qa", + "ro", + "ru", + "rw", + "sa", + "sd", + "sn", + "sg", + "sb", + "sl", + "sv", + "sm", + "so", + "rs", + "ss", + "st", + "sr", + "sk", + "si", + "se", + "sz", + "sc", + "sy", + "td", + "tg", + "th", + "tj", + "tm", + "tl", + "to", + "tt", + "tn", + "tr", + "tv", + "tz", + "ug", + "ua", + "uy", + "us", + "uz", + "va", + "vc", + "ve", + "vn", + "vu", + "ws", + "ye", + "za", + "zm", + "zw" + ], + "x-enum-name": "Flag", + "x-enum-keys": [ + "Afghanistan", + "Angola", + "Albania", + "Andorra", + "United Arab Emirates", + "Argentina", + "Armenia", + "Antigua and Barbuda", + "Australia", + "Austria", + "Azerbaijan", + "Burundi", + "Belgium", + "Benin", + "Burkina Faso", + "Bangladesh", + "Bulgaria", + "Bahrain", + "Bahamas", + "Bosnia and Herzegovina", + "Belarus", + "Belize", + "Bolivia", + "Brazil", + "Barbados", + "Brunei Darussalam", + "Bhutan", + "Botswana", + "Central African Republic", + "Canada", + "Switzerland", + "Chile", + "China", + "C\u00f4te d'Ivoire", + "Cameroon", + "Democratic Republic of the Congo", + "Republic of the Congo", + "Colombia", + "Comoros", + "Cape Verde", + "Costa Rica", + "Cuba", + "Cyprus", + "Czech Republic", + "Germany", + "Djibouti", + "Dominica", + "Denmark", + "Dominican Republic", + "Algeria", + "Ecuador", + "Egypt", + "Eritrea", + "Spain", + "Estonia", + "Ethiopia", + "Finland", + "Fiji", + "France", + "Micronesia (Federated States of)", + "Gabon", + "United Kingdom", + "Georgia", + "Ghana", + "Guinea", + "Gambia", + "Guinea-Bissau", + "Equatorial Guinea", + "Greece", + "Grenada", + "Guatemala", + "Guyana", + "Honduras", + "Croatia", + "Haiti", + "Hungary", + "Indonesia", + "India", + "Ireland", + "Iran (Islamic Republic of)", + "Iraq", + "Iceland", + "Israel", + "Italy", + "Jamaica", + "Jordan", + "Japan", + "Kazakhstan", + "Kenya", + "Kyrgyzstan", + "Cambodia", + "Kiribati", + "Saint Kitts and Nevis", + "South Korea", + "Kuwait", + "Lao People's Democratic Republic", + "Lebanon", + "Liberia", + "Libya", + "Saint Lucia", + "Liechtenstein", + "Sri Lanka", + "Lesotho", + "Lithuania", + "Luxembourg", + "Latvia", + "Morocco", + "Monaco", + "Moldova", + "Madagascar", + "Maldives", + "Mexico", + "Marshall Islands", + "North Macedonia", + "Mali", + "Malta", + "Myanmar", + "Montenegro", + "Mongolia", + "Mozambique", + "Mauritania", + "Mauritius", + "Malawi", + "Malaysia", + "Namibia", + "Niger", + "Nigeria", + "Nicaragua", + "Netherlands", + "Norway", + "Nepal", + "Nauru", + "New Zealand", + "Oman", + "Pakistan", + "Panama", + "Peru", + "Philippines", + "Palau", + "Papua New Guinea", + "Poland", + "French Polynesia", + "North Korea", + "Portugal", + "Paraguay", + "Qatar", + "Romania", + "Russia", + "Rwanda", + "Saudi Arabia", + "Sudan", + "Senegal", + "Singapore", + "Solomon Islands", + "Sierra Leone", + "El Salvador", + "San Marino", + "Somalia", + "Serbia", + "South Sudan", + "Sao Tome and Principe", + "Suriname", + "Slovakia", + "Slovenia", + "Sweden", + "Eswatini", + "Seychelles", + "Syria", + "Chad", + "Togo", + "Thailand", + "Tajikistan", + "Turkmenistan", + "Timor-Leste", + "Tonga", + "Trinidad and Tobago", + "Tunisia", + "Turkey", + "Tuvalu", + "Tanzania", + "Uganda", + "Ukraine", + "Uruguay", + "United States", + "Uzbekistan", + "Vatican City", + "Saint Vincent and the Grenadines", + "Venezuela", + "Vietnam", + "Vanuatu", + "Samoa", + "Yemen", + "South Africa", + "Zambia", + "Zimbabwe" + ], + "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 keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + } + ] + } + }, + "\/avatars\/image": { + "get": { + "summary": "Get image from URL", + "operationId": "avatarsGetImage", + "consumes": [], + "produces": [ + "image\/*" + ], + "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getImage", + "group": null, + "weight": 63, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "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. Defaults to 400.", + "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. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 400, + "in": "query" + } + ] + } + }, + "\/avatars\/initials": { + "get": { + "summary": "Get user initials", + "operationId": "avatarsGetInitials", + "consumes": [], + "produces": [ + "image\/png" + ], + "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.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getInitials", + "group": null, + "weight": 66, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "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": "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": "avatarsGetQR", + "consumes": [], + "produces": [ + "image\/png" + ], + "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.\n", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getQR", + "group": null, + "weight": 65, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "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 1 to 1000. Defaults to 400.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 1, + "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" + } + ] + } + }, + "\/databases": { + "get": { + "summary": "List databases", + "operationId": "databasesList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Databases List", + "schema": { + "$ref": "#\/definitions\/databaseList" + } + } + }, + "x-appwrite": { + "method": "list", + "group": "databases", + "weight": 71, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create database", + "operationId": "databasesCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a new Database.\n", + "responses": { + "201": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "x-appwrite": { + "method": "create", + "group": "databases", + "weight": 70, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "databaseId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<DATABASE_ID>" + }, + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "databaseId", + "name" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}": { + "get": { + "summary": "Get database", + "operationId": "databasesGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "databases", + "weight": 72, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update database", + "operationId": "databasesUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a database by its unique ID.", + "responses": { + "200": { + "description": "Database", + "schema": { + "$ref": "#\/definitions\/database" + } + } + }, + "x-appwrite": { + "method": "update", + "group": "databases", + "weight": 74, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Database name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete database", + "operationId": "databasesDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "databases", + "weight": 75, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "databases.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections": { + "get": { + "summary": "List collections", + "operationId": "databasesListCollections", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.", + "responses": { + "200": { + "description": "Collections List", + "schema": { + "$ref": "#\/definitions\/collectionList" + } + } + }, + "x-appwrite": { + "method": "listCollections", + "group": "collections", + "weight": 77, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-collections.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-collections.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create collection", + "operationId": "databasesCreateCollection", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Collection", + "schema": { + "$ref": "#\/definitions\/collection" + } + } + }, + "x-appwrite": { + "method": "createCollection", + "group": "collections", + "weight": 76, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "collectionId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<COLLECTION_ID>" + }, + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "collectionId", + "name" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}": { + "get": { + "summary": "Get collection", + "operationId": "databasesGetCollection", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.", + "responses": { + "200": { + "description": "Collection", + "schema": { + "$ref": "#\/definitions\/collection" + } + } + }, + "x-appwrite": { + "method": "getCollection", + "group": "collections", + "weight": 78, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update collection", + "operationId": "databasesUpdateCollection", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a collection by its unique ID.", + "responses": { + "200": { + "description": "Collection", + "schema": { + "$ref": "#\/definitions\/collection" + } + } + }, + "x-appwrite": { + "method": "updateCollection", + "group": "collections", + "weight": 80, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Collection name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documentSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete collection", + "operationId": "databasesDeleteCollection", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteCollection", + "group": "collections", + "weight": 81, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-collection.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-collection.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes": { + "get": { + "summary": "List attributes", + "operationId": "databasesListAttributes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "List attributes in the collection.", + "responses": { + "200": { + "description": "Attributes List", + "schema": { + "$ref": "#\/definitions\/attributeList" + } + } + }, + "x-appwrite": { + "method": "listAttributes", + "group": "attributes", + "weight": 92, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-attributes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-attributes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean": { + "post": { + "summary": "Create boolean attribute", + "operationId": "databasesCreateBooleanAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a boolean attribute.\n", + "responses": { + "202": { + "description": "AttributeBoolean", + "schema": { + "$ref": "#\/definitions\/attributeBoolean" + } + } + }, + "x-appwrite": { + "method": "createBooleanAttribute", + "group": "attributes", + "weight": 89, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": false + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/boolean\/{key}": { + "patch": { + "summary": "Update boolean attribute", + "operationId": "databasesUpdateBooleanAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a boolean attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeBoolean", + "schema": { + "$ref": "#\/definitions\/attributeBoolean" + } + } + }, + "x-appwrite": { + "method": "updateBooleanAttribute", + "group": "attributes", + "weight": 101, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-boolean-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-boolean-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": false, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime": { + "post": { + "summary": "Create datetime attribute", + "operationId": "databasesCreateDatetimeAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a date time attribute according to the ISO 8601 standard.", + "responses": { + "202": { + "description": "AttributeDatetime", + "schema": { + "$ref": "#\/definitions\/attributeDatetime" + } + } + }, + "x-appwrite": { + "method": "createDatetimeAttribute", + "group": "attributes", + "weight": 90, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for the attribute in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/datetime\/{key}": { + "patch": { + "summary": "Update dateTime attribute", + "operationId": "databasesUpdateDatetimeAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a date time attribute. Changing the `default` value will not update already existing documents.", + "responses": { + "200": { + "description": "AttributeDatetime", + "schema": { + "$ref": "#\/definitions\/attributeDatetime" + } + } + }, + "x-appwrite": { + "method": "updateDatetimeAttribute", + "group": "attributes", + "weight": 102, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-datetime-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-datetime-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email": { + "post": { + "summary": "Create email attribute", + "operationId": "databasesCreateEmailAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create an email attribute.\n", + "responses": { + "202": { + "description": "AttributeEmail", + "schema": { + "$ref": "#\/definitions\/attributeEmail" + } + } + }, + "x-appwrite": { + "method": "createEmailAttribute", + "group": "attributes", + "weight": 83, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "email@example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/email\/{key}": { + "patch": { + "summary": "Update email attribute", + "operationId": "databasesUpdateEmailAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an email attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEmail", + "schema": { + "$ref": "#\/definitions\/attributeEmail" + } + } + }, + "x-appwrite": { + "method": "updateEmailAttribute", + "group": "attributes", + "weight": 95, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-email-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-email-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "email@example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum": { + "post": { + "summary": "Create enum attribute", + "operationId": "databasesCreateEnumAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute. \n", + "responses": { + "202": { + "description": "AttributeEnum", + "schema": { + "$ref": "#\/definitions\/attributeEnum" + } + } + }, + "x-appwrite": { + "method": "createEnumAttribute", + "group": "attributes", + "weight": 84, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-attribute-enum.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "elements", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/enum\/{key}": { + "patch": { + "summary": "Update enum attribute", + "operationId": "databasesUpdateEnumAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an enum attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeEnum", + "schema": { + "$ref": "#\/definitions\/attributeEnum" + } + } + }, + "x-appwrite": { + "method": "updateEnumAttribute", + "group": "attributes", + "weight": 96, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-enum-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-enum-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "description": "Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "elements", + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float": { + "post": { + "summary": "Create float attribute", + "operationId": "databasesCreateFloatAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a float attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeFloat", + "schema": { + "$ref": "#\/definitions\/attributeFloat" + } + } + }, + "x-appwrite": { + "method": "createFloatAttribute", + "group": "attributes", + "weight": 88, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value to enforce on new documents", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value to enforce on new documents", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/float\/{key}": { + "patch": { + "summary": "Update float attribute", + "operationId": "databasesUpdateFloatAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a float attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeFloat", + "schema": { + "$ref": "#\/definitions\/attributeFloat" + } + } + }, + "x-appwrite": { + "method": "updateFloatAttribute", + "group": "attributes", + "weight": 100, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-float-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-float-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "number", + "description": "Minimum value to enforce on new documents", + "default": null, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value to enforce on new documents", + "default": null, + "x-example": null + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer": { + "post": { + "summary": "Create integer attribute", + "operationId": "databasesCreateIntegerAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create an integer attribute. Optionally, minimum and maximum values can be provided.\n", + "responses": { + "202": { + "description": "AttributeInteger", + "schema": { + "$ref": "#\/definitions\/attributeInteger" + } + } + }, + "x-appwrite": { + "method": "createIntegerAttribute", + "group": "attributes", + "weight": 87, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce on new documents", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce on new documents", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/integer\/{key}": { + "patch": { + "summary": "Update integer attribute", + "operationId": "databasesUpdateIntegerAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an integer attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeInteger", + "schema": { + "$ref": "#\/definitions\/attributeInteger" + } + } + }, + "x-appwrite": { + "method": "updateIntegerAttribute", + "group": "attributes", + "weight": 99, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-integer-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-integer-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce on new documents", + "default": null, + "x-example": null + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce on new documents", + "default": null, + "x-example": null + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip": { + "post": { + "summary": "Create IP address attribute", + "operationId": "databasesCreateIpAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create IP address attribute.\n", + "responses": { + "202": { + "description": "AttributeIP", + "schema": { + "$ref": "#\/definitions\/attributeIp" + } + } + }, + "x-appwrite": { + "method": "createIpAttribute", + "group": "attributes", + "weight": 85, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/ip\/{key}": { + "patch": { + "summary": "Update IP address attribute", + "operationId": "databasesUpdateIpAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an ip attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeIP", + "schema": { + "$ref": "#\/definitions\/attributeIp" + } + } + }, + "x-appwrite": { + "method": "updateIpAttribute", + "group": "attributes", + "weight": 97, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-ip-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-ip-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": null, + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/relationship": { + "post": { + "summary": "Create relationship attribute", + "operationId": "databasesCreateRelationshipAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "202": { + "description": "AttributeRelationship", + "schema": { + "$ref": "#\/definitions\/attributeRelationship" + } + } + }, + "x-appwrite": { + "method": "createRelationshipAttribute", + "group": "attributes", + "weight": 91, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "relatedCollectionId": { + "type": "string", + "description": "Related Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "default": null, + "x-example": "<RELATED_COLLECTION_ID>" + }, + "type": { + "type": "string", + "description": "Relation type", + "default": null, + "x-example": "oneToOne", + "enum": [ + "oneToOne", + "manyToOne", + "manyToMany", + "oneToMany" + ], + "x-enum-name": "RelationshipType", + "x-enum-keys": [] + }, + "twoWay": { + "type": "boolean", + "description": "Is Two Way?", + "default": false, + "x-example": false + }, + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "twoWayKey": { + "type": "string", + "description": "Two Way Attribute Key.", + "default": null, + "x-example": null + }, + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": "restrict", + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + } + }, + "required": [ + "relatedCollectionId", + "type" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string": { + "post": { + "summary": "Create string attribute", + "operationId": "databasesCreateStringAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a string attribute.\n", + "responses": { + "202": { + "description": "AttributeString", + "schema": { + "$ref": "#\/definitions\/attributeString" + } + } + }, + "x-appwrite": { + "method": "createStringAttribute", + "group": "attributes", + "weight": 82, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "size": { + "type": "integer", + "description": "Attribute size for text attributes, in number of characters.", + "default": null, + "x-example": 1 + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + }, + "encrypt": { + "type": "boolean", + "description": "Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "size", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/string\/{key}": { + "patch": { + "summary": "Update string attribute", + "operationId": "databasesUpdateStringAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a string attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeString", + "schema": { + "$ref": "#\/definitions\/attributeString" + } + } + }, + "x-appwrite": { + "method": "updateStringAttribute", + "group": "attributes", + "weight": 94, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-string-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-string-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "<DEFAULT>", + "x-nullable": true + }, + "size": { + "type": "integer", + "description": "Maximum size of the string attribute.", + "default": null, + "x-example": 1 + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url": { + "post": { + "summary": "Create URL attribute", + "operationId": "databasesCreateUrlAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a URL attribute.\n", + "responses": { + "202": { + "description": "AttributeURL", + "schema": { + "$ref": "#\/definitions\/attributeUrl" + } + } + }, + "x-appwrite": { + "method": "createUrlAttribute", + "group": "attributes", + "weight": 86, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "default": null, + "x-example": null + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "https:\/\/example.com" + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "default": false, + "x-example": false + } + }, + "required": [ + "key", + "required" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/url\/{key}": { + "patch": { + "summary": "Update URL attribute", + "operationId": "databasesUpdateUrlAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update an url attribute. Changing the `default` value will not update already existing documents.\n", + "responses": { + "200": { + "description": "AttributeURL", + "schema": { + "$ref": "#\/definitions\/attributeUrl" + } + } + }, + "x-appwrite": { + "method": "updateUrlAttribute", + "group": "attributes", + "weight": 98, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-url-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-url-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "required": { + "type": "boolean", + "description": "Is attribute required?", + "default": null, + "x-example": false + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "default": null, + "x-example": "https:\/\/example.com", + "x-nullable": true + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + }, + "required": [ + "required", + "default" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}": { + "get": { + "summary": "Get attribute", + "operationId": "databasesGetAttribute", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get attribute by ID.", + "responses": { + "200": { + "description": "AttributeBoolean, or AttributeInteger, or AttributeFloat, or AttributeEmail, or AttributeEnum, or AttributeURL, or AttributeIP, or AttributeDatetime, or AttributeRelationship, or AttributeString", + "schema": { + "x-oneOf": [ + { + "$ref": "#\/definitions\/attributeBoolean" + }, + { + "$ref": "#\/definitions\/attributeInteger" + }, + { + "$ref": "#\/definitions\/attributeFloat" + }, + { + "$ref": "#\/definitions\/attributeEmail" + }, + { + "$ref": "#\/definitions\/attributeEnum" + }, + { + "$ref": "#\/definitions\/attributeUrl" + }, + { + "$ref": "#\/definitions\/attributeIp" + }, + { + "$ref": "#\/definitions\/attributeDatetime" + }, + { + "$ref": "#\/definitions\/attributeRelationship" + }, + { + "$ref": "#\/definitions\/attributeString" + } + ] + } + } + }, + "x-appwrite": { + "method": "getAttribute", + "group": "attributes", + "weight": 93, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete attribute", + "operationId": "databasesDeleteAttribute", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Deletes an attribute.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteAttribute", + "group": "attributes", + "weight": 104, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/attributes\/{key}\/relationship": { + "patch": { + "summary": "Update relationship attribute", + "operationId": "databasesUpdateRelationshipAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update relationship attribute. [Learn more about relationship attributes](https:\/\/appwrite.io\/docs\/databases-relationships#relationship-attributes).\n", + "responses": { + "200": { + "description": "AttributeRelationship", + "schema": { + "$ref": "#\/definitions\/attributeRelationship" + } + } + }, + "x-appwrite": { + "method": "updateRelationshipAttribute", + "group": "attributes", + "weight": 103, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-relationship-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-relationship-attribute.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Attribute Key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "onDelete": { + "type": "string", + "description": "Constraints option", + "default": null, + "x-example": "cascade", + "enum": [ + "cascade", + "restrict", + "setNull" + ], + "x-enum-name": "RelationMutate", + "x-enum-keys": [] + }, + "newKey": { + "type": "string", + "description": "New attribute key.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents": { + "get": { + "summary": "List documents", + "operationId": "databasesListDocuments", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a list of all the user's documents in a given collection. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "listDocuments", + "group": "documents", + "weight": 110, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-documents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create document", + "operationId": "databasesCreateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "201": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "createDocument", + "group": "documents", + "weight": 109, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "client", + "server", + "server" + ], + "packaging": false, + "methods": [ + { + "name": "createDocument", + "auth": { + "Admin": [], + "Session": [], + "Key": [], + "JWT": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documentId", + "data", + "permissions" + ], + "required": [ + "databaseId", + "collectionId", + "documentId", + "data" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/document" + } + ], + "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + }, + { + "name": "createDocuments", + "auth": { + "Admin": [], + "Key": [] + }, + "parameters": [ + "databaseId", + "collectionId", + "documents" + ], + "required": [ + "databaseId", + "collectionId", + "documents" + ], + "responses": [ + { + "code": 201, + "model": "#\/definitions\/documentList" + } + ], + "description": "Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." + } + ], + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection). Make sure to define attributes before creating documents.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "description": "Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": "", + "x-example": "<DOCUMENT_ID>" + }, + "data": { + "type": "object", + "description": "Document data as JSON object.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "documents": { + "type": "array", + "description": "Array of documents data as JSON objects.", + "default": [], + "x-example": null, + "items": { + "type": "object" + } + } + } + } + } + ] + }, + "put": { + "summary": "Create or update documents", + "operationId": "databasesUpsertDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.\n", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "upsertDocuments", + "group": "documents", + "weight": 118, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "documents": { + "type": "array", + "description": "Array of document data as JSON objects. May contain partial documents.", + "default": null, + "x-example": null, + "items": { + "type": "object" + } + } + }, + "required": [ + "documents" + ] + } + } + ] + }, + "patch": { + "summary": "Update documents", + "operationId": "databasesUpdateDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "updateDocuments", + "group": "documents", + "weight": 117, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-documents.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete documents", + "operationId": "databasesDeleteDocuments", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Bulk delete documents using queries, if no queries are passed then all documents are deleted.", + "responses": { + "200": { + "description": "Documents List", + "schema": { + "$ref": "#\/definitions\/documentList" + } + } + }, + "x-appwrite": { + "method": "deleteDocuments", + "group": "documents", + "weight": 120, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-documents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-documents.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "queries": { + "type": "array", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}": { + "get": { + "summary": "Get document", + "operationId": "databasesGetDocument", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "getDocument", + "group": "documents", + "weight": 111, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-document.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "documents.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long.", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "put": { + "summary": "Upsert document", + "operationId": "databasesUpsertDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "upsertDocument", + "group": "documents", + "weight": 114, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/upsert-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/upsert-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include all required attributes of the document to be created or updated.", + "default": {}, + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ] + } + } + ] + }, + "patch": { + "summary": "Update document", + "operationId": "databasesUpdateDocument", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "updateDocument", + "group": "documents", + "weight": 113, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/update-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/update-document.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Document data as JSON object. Include only attribute and value pairs to be updated.", + "default": [], + "x-example": "{}" + }, + "permissions": { + "type": "array", + "description": "An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete document", + "operationId": "databasesDeleteDocument", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete a document by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDocument", + "group": "documents", + "weight": 119, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-document.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-document.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { + "get": { + "summary": "List indexes", + "operationId": "databasesListIndexes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "List indexes in the collection.", + "responses": { + "200": { + "description": "Indexes List", + "schema": { + "$ref": "#\/definitions\/indexList" + } + } + }, + "x-appwrite": { + "method": "listIndexes", + "group": "indexes", + "weight": 106, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/list-indexes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/list-indexes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create index", + "operationId": "databasesCreateIndex", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.\nAttributes can be `key`, `fulltext`, and `unique`.", + "responses": { + "202": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/index" + } + } + }, + "x-appwrite": { + "method": "createIndex", + "group": "collections", + "weight": 105, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/create-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/create-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "default": null, + "x-example": null + }, + "type": { + "type": "string", + "description": "Index type.", + "default": null, + "x-example": "key", + "enum": [ + "key", + "fulltext", + "unique" + ], + "x-enum-name": "IndexType", + "x-enum-keys": [] + }, + "attributes": { + "type": "array", + "description": "Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "orders": { + "type": "array", + "description": "Array of index orders. Maximum of 100 orders are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "lengths": { + "type": "array", + "description": "Length of index. Maximum of 100", + "default": [], + "x-example": null, + "items": { + "type": "integer" + } + } + }, + "required": [ + "key", + "type", + "attributes" + ] + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes\/{key}": { + "get": { + "summary": "Get index", + "operationId": "databasesGetIndex", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Get index by ID.", + "responses": { + "200": { + "description": "Index", + "schema": { + "$ref": "#\/definitions\/index" + } + } + }, + "x-appwrite": { + "method": "getIndex", + "group": "indexes", + "weight": 107, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/get-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/get-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete index", + "operationId": "databasesDeleteIndex", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "databases" + ], + "description": "Delete an index.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteIndex", + "group": "indexes", + "weight": 108, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/delete-index.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/delete-index.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "collections.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID. You can create a new collection using the Database service [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection).", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "key", + "description": "Index Key.", + "required": true, + "type": "string", + "in": "path" + } + ] + } + }, + "\/functions": { + "get": { + "summary": "List functions", + "operationId": "functionsList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all the project's functions. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Functions List", + "schema": { + "$ref": "#\/definitions\/functionList" + } + } + }, + "x-appwrite": { + "method": "list", + "group": "functions", + "weight": 378, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's functions. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create function", + "operationId": "functionsCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "responses": { + "201": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "x-appwrite": { + "method": "create", + "group": "functions", + "weight": 375, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function. You can pass a list of [permissions](https:\/\/appwrite.io\/docs\/permissions) to allow different project users or team with access to execute the function using the client API.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "functionId": { + "type": "string", + "description": "Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<FUNCTION_ID>" + }, + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "default": null, + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": [], + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "default": "", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Function maximum execution time in seconds.", + "default": 15, + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "default": true, + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "default": "", + "x-example": "<ENTRYPOINT>" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "default": "", + "x-example": "<COMMANDS>" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function.", + "default": "", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function.", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "functionId", + "name", + "runtime" + ] + } + } + ] + } + }, + "\/functions\/runtimes": { + "get": { + "summary": "List runtimes", + "operationId": "functionsListRuntimes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all runtimes that are currently active on your instance.", + "responses": { + "200": { + "description": "Runtimes List", + "schema": { + "$ref": "#\/definitions\/runtimeList" + } + } + }, + "x-appwrite": { + "method": "listRuntimes", + "group": "runtimes", + "weight": 380, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-runtimes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all runtimes that are currently active on your instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "functionsListSpecifications", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "List allowed function specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "schema": { + "$ref": "#\/definitions\/specificationList" + } + } + }, + "x-appwrite": { + "method": "listSpecifications", + "group": "runtimes", + "weight": 381, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed function specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/functions\/{functionId}": { + "get": { + "summary": "Get function", + "operationId": "functionsGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "functions", + "weight": 376, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update function", + "operationId": "functionsUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Update function by its unique ID.", + "responses": { + "200": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "x-appwrite": { + "method": "update", + "group": "functions", + "weight": 377, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Function name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "runtime": { + "type": "string", + "description": "Execution runtime.", + "default": "", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "execute": { + "type": "array", + "description": "An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": [], + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + }, + "events": { + "type": "array", + "description": "Events list. Maximum of 100 events are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "description": "Schedule CRON syntax.", + "default": "", + "x-example": null + }, + "timeout": { + "type": "integer", + "description": "Maximum execution time in seconds.", + "default": 15, + "x-example": 1 + }, + "enabled": { + "type": "boolean", + "description": "Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "default": true, + "x-example": false + }, + "entrypoint": { + "type": "string", + "description": "Entrypoint File. This path is relative to the \"providerRootDirectory\".", + "default": "", + "x-example": "<ENTRYPOINT>" + }, + "commands": { + "type": "string", + "description": "Build Commands.", + "default": "", + "x-example": "<COMMANDS>" + }, + "scopes": { + "type": "array", + "description": "List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Controle System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the function", + "default": null, + "x-example": "<PROVIDER_REPOSITORY_ID>", + "x-nullable": true + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the function", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Runtime specification for the function and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete function", + "operationId": "functionsDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a function by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "functions", + "weight": 379, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployment": { + "patch": { + "summary": "Update function's deployment", + "operationId": "functionsUpdateFunctionDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "responses": { + "200": { + "description": "Function", + "schema": { + "$ref": "#\/definitions\/function" + } + } + }, + "x-appwrite": { + "method": "updateFunctionDeployment", + "group": "functions", + "weight": 384, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update-function-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "functionsListDeployments", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all the function's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "schema": { + "$ref": "#\/definitions\/deploymentList" + } + } + }, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 385, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the function's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "functionsCreateDeployment", + "consumes": [ + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 382, + "cookies": false, + "type": "upload", + "deprecated": false, + "demo": "functions\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.\n\nThis endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https:\/\/appwrite.io\/docs\/functions).\n\nUse the \"command\" param to set the entrypoint used to execute your code.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "entrypoint", + "description": "Entrypoint File.", + "required": false, + "type": "string", + "x-example": "<ENTRYPOINT>", + "in": "formData" + }, + { + "name": "commands", + "description": "Build Commands.", + "required": false, + "type": "string", + "x-example": "<COMMANDS>", + "in": "formData" + }, + { + "name": "code", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "required": true, + "type": "file", + "in": "formData" + }, + { + "name": "activate", + "description": "Automatically activate the deployment when it is finished building.", + "required": true, + "type": "boolean", + "x-example": false, + "in": "formData" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "functionsCreateDuplicateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 390, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + }, + "buildId": { + "type": "string", + "description": "Build unique ID.", + "default": "", + "x-example": "<BUILD_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "functionsCreateTemplateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 387, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/functions#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "default": null, + "x-example": "<REPOSITORY>" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "default": null, + "x-example": "<OWNER>" + }, + "rootDirectory": { + "type": "string", + "description": "Path to function code in the template repo.", + "default": null, + "x-example": "<ROOT_DIRECTORY>" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the function template.", + "default": null, + "x-example": "<VERSION>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "functionsCreateVcsDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 388, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a function is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "default": null, + "x-example": "branch", + "enum": [ + "branch", + "commit" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "default": null, + "x-example": "<REFERENCE>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "functionsGetDeployment", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 383, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "functionsDeleteDeployment", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a code deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 386, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a code deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "functionsGetDeploymentDownload", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "functions" + ], + "description": "Get a function deployment 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.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 389, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "functions\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function deployment 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.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source", + "in": "query" + } + ] + } + }, + "\/functions\/{functionId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "functionsUpdateDeploymentStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 391, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/executions": { + "get": { + "summary": "List executions", + "operationId": "functionsListExecutions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all the current user function execution logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "schema": { + "$ref": "#\/definitions\/executionList" + } + } + }, + "x-appwrite": { + "method": "listExecutions", + "group": "executions", + "weight": 394, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-executions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the current user function execution logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create execution", + "operationId": "functionsCreateExecution", + "consumes": [ + "application\/json" + ], + "produces": [ + "multipart\/form-data" + ], + "tags": [ + "functions" + ], + "description": "Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "responses": { + "201": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "x-appwrite": { + "method": "createExecution", + "group": "executions", + "weight": 392, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterTrigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "body": { + "type": "string", + "description": "HTTP body of execution. Default value is empty string.", + "default": "", + "x-example": "<BODY>" + }, + "async": { + "type": "boolean", + "description": "Execute code in the background. Default value is false.", + "default": false, + "x-example": false + }, + "path": { + "type": "string", + "description": "HTTP path of execution. Path can include query params. Default value is \/", + "default": "\/", + "x-example": "<PATH>" + }, + "method": { + "type": "string", + "description": "HTTP method of execution. Default value is GET.", + "default": "POST", + "x-example": "GET", + "enum": [ + "GET", + "POST", + "PUT", + "PATCH", + "DELETE", + "OPTIONS" + ], + "x-enum-name": "ExecutionMethod", + "x-enum-keys": [] + }, + "headers": { + "type": "object", + "description": "HTTP headers of execution. Defaults to empty.", + "default": [], + "x-example": "{}" + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled execution time in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/functions\/{functionId}\/executions\/{executionId}": { + "get": { + "summary": "Get execution", + "operationId": "functionsGetExecution", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a function execution log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "x-appwrite": { + "method": "getExecution", + "group": "executions", + "weight": 393, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a function execution log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "type": "string", + "x-example": "<EXECUTION_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete execution", + "operationId": "functionsDeleteExecution", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a function execution by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteExecution", + "group": "executions", + "weight": 395, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete-execution.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a function execution by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "execution.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "executionId", + "description": "Execution ID.", + "required": true, + "type": "string", + "x-example": "<EXECUTION_ID>", + "in": "path" + } + ] + } + }, + "\/functions\/{functionId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "functionsListVariables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a list of all variables of a specific function.", + "responses": { + "200": { + "description": "Variables List", + "schema": { + "$ref": "#\/definitions\/variableList" + } + } + }, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 400, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific function.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "functionsCreateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "responses": { + "201": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 398, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new function environment variable. These variables can be accessed in the function at runtime as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "default": true, + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + ] + } + }, + "\/functions\/{functionId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "functionsGetVariable", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 399, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "functionsUpdateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "functions" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 401, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only functions can read them during build and runtime.", + "default": null, + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + ] + }, + "delete": { + "summary": "Delete variable", + "operationId": "functionsDeleteVariable", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "functions" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 402, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "functions\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "functions.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "functionId", + "description": "Function unique ID.", + "required": true, + "type": "string", + "x-example": "<FUNCTION_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + } + }, + "\/graphql": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlQuery", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "schema": { + "$ref": "#\/definitions\/any" + } + } + }, + "x-appwrite": { + "method": "query", + "group": "graphql", + "weight": 308, + "cookies": false, + "type": "graphql", + "deprecated": false, + "demo": "graphql\/query.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "description": "The query or queries to execute.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "query" + ] + } + } + ] + } + }, + "\/graphql\/mutation": { + "post": { + "summary": "GraphQL endpoint", + "operationId": "graphqlMutation", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "graphql" + ], + "description": "Execute a GraphQL mutation.", + "responses": { + "200": { + "description": "Any", + "schema": { + "$ref": "#\/definitions\/any" + } + } + }, + "x-appwrite": { + "method": "mutation", + "group": "graphql", + "weight": 307, + "cookies": false, + "type": "graphql", + "deprecated": false, + "demo": "graphql\/mutation.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/graphql\/post.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "url:{url},ip:{ip}", + "scope": "graphql", + "platforms": [ + "server", + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "description": "The query or queries to execute.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "query" + ] + } + } + ] + } + }, + "\/health": { + "get": { + "summary": "Get HTTP", + "operationId": "healthGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite HTTP server is up and responsive.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "health", + "weight": 132, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/anti-virus": { + "get": { + "summary": "Get antivirus", + "operationId": "healthGetAntivirus", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite Antivirus server is up and connection is successful.", + "responses": { + "200": { + "description": "Health Antivirus", + "schema": { + "$ref": "#\/definitions\/healthAntivirus" + } + } + }, + "x-appwrite": { + "method": "getAntivirus", + "group": "health", + "weight": 153, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-antivirus.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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/cache": { + "get": { + "summary": "Get cache", + "operationId": "healthGetCache", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite in-memory cache servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "x-appwrite": { + "method": "getCache", + "group": "health", + "weight": 135, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/certificate": { + "get": { + "summary": "Get the SSL certificate for a domain", + "operationId": "healthGetCertificate", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the SSL certificate for a domain", + "responses": { + "200": { + "description": "Health Certificate", + "schema": { + "$ref": "#\/definitions\/healthCertificate" + } + } + }, + "x-appwrite": { + "method": "getCertificate", + "group": "health", + "weight": 140, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-certificate.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-certificate.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "domain", + "description": "string", + "required": false, + "type": "string", + "in": "query" + } + ] + } + }, + "\/health\/db": { + "get": { + "summary": "Get DB", + "operationId": "healthGetDB", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite database servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "x-appwrite": { + "method": "getDB", + "group": "health", + "weight": 134, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/pubsub": { + "get": { + "summary": "Get pubsub", + "operationId": "healthGetPubSub", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite pub-sub servers are up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "x-appwrite": { + "method": "getPubSub", + "group": "health", + "weight": 136, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-pub-sub.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-pubsub.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/queue\/builds": { + "get": { + "summary": "Get builds queue", + "operationId": "healthGetQueueBuilds", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of builds that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueBuilds", + "group": "queue", + "weight": 142, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-builds.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-builds.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/certificates": { + "get": { + "summary": "Get certificates queue", + "operationId": "healthGetQueueCertificates", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueCertificates", + "group": "queue", + "weight": 141, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/databases": { + "get": { + "summary": "Get databases queue", + "operationId": "healthGetQueueDatabases", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueDatabases", + "group": "queue", + "weight": 143, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-databases.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-databases.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "Queue name for which to check the queue size", + "required": false, + "type": "string", + "x-example": "<NAME>", + "default": "database_db_main", + "in": "query" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/deletes": { + "get": { + "summary": "Get deletes queue", + "operationId": "healthGetQueueDeletes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueDeletes", + "group": "queue", + "weight": 144, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-deletes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-deletes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/failed\/{name}": { + "get": { + "summary": "Get number of failed queue jobs", + "operationId": "healthGetFailedJobs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Returns the amount of failed jobs in a given queue.\n", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getFailedJobs", + "group": "queue", + "weight": 154, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-failed-jobs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-failed-queue-jobs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "name", + "description": "The name of the queue", + "required": true, + "type": "string", + "x-example": "v1-database", + "enum": [ + "v1-database", + "v1-deletes", + "v1-audits", + "v1-mails", + "v1-functions", + "v1-stats-resources", + "v1-stats-usage", + "v1-webhooks", + "v1-certificates", + "v1-builds", + "v1-messaging", + "v1-migrations" + ], + "x-enum-name": null, + "x-enum-keys": [], + "in": "path" + }, + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/functions": { + "get": { + "summary": "Get functions queue", + "operationId": "healthGetQueueFunctions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueFunctions", + "group": "queue", + "weight": 148, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/logs": { + "get": { + "summary": "Get logs queue", + "operationId": "healthGetQueueLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of logs that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueLogs", + "group": "queue", + "weight": 139, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/mails": { + "get": { + "summary": "Get mails queue", + "operationId": "healthGetQueueMails", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of mails that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueMails", + "group": "queue", + "weight": 145, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-mails.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-mails.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/messaging": { + "get": { + "summary": "Get messaging queue", + "operationId": "healthGetQueueMessaging", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of messages that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueMessaging", + "group": "queue", + "weight": 146, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-messaging.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-messaging.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/migrations": { + "get": { + "summary": "Get migrations queue", + "operationId": "healthGetQueueMigrations", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueMigrations", + "group": "queue", + "weight": 147, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-migrations.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-migrations.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-resources": { + "get": { + "summary": "Get stats resources queue", + "operationId": "healthGetQueueStatsResources", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueStatsResources", + "group": "queue", + "weight": 149, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-stats-resources.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-resources.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/stats-usage": { + "get": { + "summary": "Get stats usage queue", + "operationId": "healthGetQueueUsage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueUsage", + "group": "queue", + "weight": 150, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-queue-usage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-stats-usage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/queue\/webhooks": { + "get": { + "summary": "Get webhooks queue", + "operationId": "healthGetQueueWebhooks", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.", + "responses": { + "200": { + "description": "Health Queue", + "schema": { + "$ref": "#\/definitions\/healthQueue" + } + } + }, + "x-appwrite": { + "method": "getQueueWebhooks", + "group": "queue", + "weight": 138, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "threshold", + "description": "Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.", + "required": false, + "type": "integer", + "format": "int32", + "default": 5000, + "in": "query" + } + ] + } + }, + "\/health\/storage": { + "get": { + "summary": "Get storage", + "operationId": "healthGetStorage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "x-appwrite": { + "method": "getStorage", + "group": "storage", + "weight": 152, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "health\/get-storage.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "health.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/storage\/local": { + "get": { + "summary": "Get local storage", + "operationId": "healthGetStorageLocal", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "health" + ], + "description": "Check the Appwrite local storage device is up and connection is successful.", + "responses": { + "200": { + "description": "Health Status", + "schema": { + "$ref": "#\/definitions\/healthStatus" + } + } + }, + "x-appwrite": { + "method": "getStorageLocal", + "group": "storage", + "weight": 151, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/health\/time": { + "get": { + "summary": "Get time", + "operationId": "healthGetTime", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Health Time", + "schema": { + "$ref": "#\/definitions\/healthTime" + } + } + }, + "x-appwrite": { + "method": "getTime", + "group": "health", + "weight": 137, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/locale": { + "get": { + "summary": "Get user locale", + "operationId": "localeGet", + "consumes": [], + "produces": [ + "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))", + "responses": { + "200": { + "description": "Locale", + "schema": { + "$ref": "#\/definitions\/locale" + } + } + }, + "x-appwrite": { + "method": "get", + "group": null, + "weight": 124, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/codes": { + "get": { + "summary": "List locale codes", + "operationId": "localeListCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes).", + "responses": { + "200": { + "description": "Locale codes list", + "schema": { + "$ref": "#\/definitions\/localeCodeList" + } + } + }, + "x-appwrite": { + "method": "listCodes", + "group": null, + "weight": 125, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-locale-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/continents": { + "get": { + "summary": "List continents", + "operationId": "localeListContinents", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all continents. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Continents List", + "schema": { + "$ref": "#\/definitions\/continentList" + } + } + }, + "x-appwrite": { + "method": "listContinents", + "group": null, + "weight": 129, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-continents.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-continents.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries": { + "get": { + "summary": "List countries", + "operationId": "localeListCountries", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "locale" + ], + "description": "List of all countries. You can use the locale header to get the data in a supported language.", + "responses": { + "200": { + "description": "Countries List", + "schema": { + "$ref": "#\/definitions\/countryList" + } + } + }, + "x-appwrite": { + "method": "listCountries", + "group": null, + "weight": 126, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/eu": { + "get": { + "summary": "List EU countries", + "operationId": "localeListCountriesEU", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Countries List", + "schema": { + "$ref": "#\/definitions\/countryList" + } + } + }, + "x-appwrite": { + "method": "listCountriesEU", + "group": null, + "weight": 127, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries-e-u.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-eu.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/countries\/phones": { + "get": { + "summary": "List countries phone codes", + "operationId": "localeListCountriesPhones", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Phones List", + "schema": { + "$ref": "#\/definitions\/phoneList" + } + } + }, + "x-appwrite": { + "method": "listCountriesPhones", + "group": null, + "weight": 128, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-countries-phones.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-countries-phones.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/currencies": { + "get": { + "summary": "List currencies", + "operationId": "localeListCurrencies", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Currencies List", + "schema": { + "$ref": "#\/definitions\/currencyList" + } + } + }, + "x-appwrite": { + "method": "listCurrencies", + "group": null, + "weight": 130, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-currencies.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-currencies.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/locale\/languages": { + "get": { + "summary": "List languages", + "operationId": "localeListLanguages", + "consumes": [], + "produces": [ + "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.", + "responses": { + "200": { + "description": "Languages List", + "schema": { + "$ref": "#\/definitions\/languageList" + } + } + }, + "x-appwrite": { + "method": "listLanguages", + "group": null, + "weight": 131, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "locale\/list-languages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/list-languages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "locale.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ] + } + }, + "\/messaging\/messages": { + "get": { + "summary": "List messages", + "operationId": "messagingListMessages", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all messages from the current Appwrite project.", + "responses": { + "200": { + "description": "Message list", + "schema": { + "$ref": "#\/definitions\/messageList" + } + } + }, + "x-appwrite": { + "method": "listMessages", + "group": "messages", + "weight": 362, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-messages.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-messages.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/email": { + "post": { + "summary": "Create email", + "operationId": "messagingCreateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new email message.", + "responses": { + "201": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "x-appwrite": { + "method": "createEmail", + "group": "messages", + "weight": 359, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<MESSAGE_ID>" + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "default": null, + "x-example": "<SUBJECT>" + }, + "content": { + "type": "string", + "description": "Email Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": false, + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "default": false, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + } + }, + "required": [ + "messageId", + "subject", + "content" + ] + } + } + ] + } + }, + "\/messaging\/messages\/email\/{messageId}": { + "patch": { + "summary": "Update email", + "operationId": "messagingUpdateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "x-appwrite": { + "method": "updateEmail", + "group": "messages", + "weight": 366, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "subject": { + "type": "string", + "description": "Email Subject.", + "default": null, + "x-example": "<SUBJECT>" + }, + "content": { + "type": "string", + "description": "Email Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": null, + "x-example": false + }, + "html": { + "type": "boolean", + "description": "Is content of type HTML", + "default": null, + "x-example": false + }, + "cc": { + "type": "array", + "description": "Array of target IDs to be added as CC.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "bcc": { + "type": "array", + "description": "Array of target IDs to be added as BCC.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + }, + "attachments": { + "type": "array", + "description": "Array of compound ID strings of bucket IDs and file IDs to be attached to the email. They should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "\/messaging\/messages\/push": { + "post": { + "summary": "Create push notification", + "operationId": "messagingCreatePush", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new push notification.", + "responses": { + "201": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "x-appwrite": { + "method": "createPush", + "group": "messages", + "weight": 361, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<MESSAGE_ID>" + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "default": "", + "x-example": "<TITLE>" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "default": "", + "x-example": "<BODY>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "data": { + "type": "object", + "description": "Additional key-value pair data for push notification.", + "default": {}, + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "default": "", + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": "", + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web Platform.", + "default": "", + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS Platform.", + "default": "", + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android Platform.", + "default": "", + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android Platform.", + "default": "", + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS Platform.", + "default": -1, + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": false, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": false, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device state and may not deliver notifications immediately. \"high\" will always attempt to immediately deliver the notification.", + "default": "high", + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + }, + "required": [ + "messageId" + ] + } + } + ] + } + }, + "\/messaging\/messages\/push\/{messageId}": { + "patch": { + "summary": "Update push notification", + "operationId": "messagingUpdatePush", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "x-appwrite": { + "method": "updatePush", + "group": "messages", + "weight": 368, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-push.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-push.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "title": { + "type": "string", + "description": "Title for push notification.", + "default": null, + "x-example": "<TITLE>" + }, + "body": { + "type": "string", + "description": "Body for push notification.", + "default": null, + "x-example": "<BODY>" + }, + "data": { + "type": "object", + "description": "Additional Data for push notification.", + "default": {}, + "x-example": "{}" + }, + "action": { + "type": "string", + "description": "Action for push notification.", + "default": null, + "x-example": "<ACTION>" + }, + "image": { + "type": "string", + "description": "Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage. It should be formatted as <BUCKET_ID>:<FILE_ID>.", + "default": null, + "x-example": "[ID1:ID2]" + }, + "icon": { + "type": "string", + "description": "Icon for push notification. Available only for Android and Web platforms.", + "default": null, + "x-example": "<ICON>" + }, + "sound": { + "type": "string", + "description": "Sound for push notification. Available only for Android and iOS platforms.", + "default": null, + "x-example": "<SOUND>" + }, + "color": { + "type": "string", + "description": "Color for push notification. Available only for Android platforms.", + "default": null, + "x-example": "<COLOR>" + }, + "tag": { + "type": "string", + "description": "Tag for push notification. Available only for Android platforms.", + "default": null, + "x-example": "<TAG>" + }, + "badge": { + "type": "integer", + "description": "Badge for push notification. Available only for iOS platforms.", + "default": null, + "x-example": null + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": null, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + }, + "contentAvailable": { + "type": "boolean", + "description": "If set to true, the notification will be delivered in the background. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "critical": { + "type": "boolean", + "description": "If set to true, the notification will be marked as critical. This requires the app to have the critical notification entitlement. Available only for iOS Platform.", + "default": null, + "x-example": false + }, + "priority": { + "type": "string", + "description": "Set the notification priority. \"normal\" will consider device battery state and may send notifications later. \"high\" will always attempt to immediately deliver the notification.", + "default": null, + "x-example": "normal", + "enum": [ + "normal", + "high" + ], + "x-enum-name": "MessagePriority", + "x-enum-keys": [] + } + } + } + } + ] + } + }, + "\/messaging\/messages\/sms": { + "post": { + "summary": "Create SMS", + "operationId": "messagingCreateSms", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new SMS message.", + "responses": { + "201": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "x-appwrite": { + "method": "createSms", + "group": "messages", + "weight": 360, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "messageId": { + "type": "string", + "description": "Message ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<MESSAGE_ID>" + }, + "content": { + "type": "string", + "description": "SMS Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": false, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + } + }, + "required": [ + "messageId", + "content" + ] + } + } + ] + } + }, + "\/messaging\/messages\/sms\/{messageId}": { + "patch": { + "summary": "Update SMS", + "operationId": "messagingUpdateSms", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "x-appwrite": { + "method": "updateSms", + "group": "messages", + "weight": 367, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-sms.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sms.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "description": "List of Topic IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "users": { + "type": "array", + "description": "List of User IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "targets": { + "type": "array", + "description": "List of Targets IDs.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "content": { + "type": "string", + "description": "Email Content.", + "default": null, + "x-example": "<CONTENT>" + }, + "draft": { + "type": "boolean", + "description": "Is message a draft", + "default": null, + "x-example": false + }, + "scheduledAt": { + "type": "string", + "description": "Scheduled delivery time for message in [ISO 8601](https:\/\/www.iso.org\/iso-8601-date-and-time-format.html) format. DateTime value must be in future.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/messaging\/messages\/{messageId}": { + "get": { + "summary": "Get message", + "operationId": "messagingGetMessage", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a message by its unique ID.\n", + "responses": { + "200": { + "description": "Message", + "schema": { + "$ref": "#\/definitions\/message" + } + } + }, + "x-appwrite": { + "method": "getMessage", + "group": "messages", + "weight": 365, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-message.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete message", + "operationId": "messagingDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "messages", + "weight": 369, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-message.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/logs": { + "get": { + "summary": "List message logs", + "operationId": "messagingListMessageLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the message activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listMessageLogs", + "group": "logs", + "weight": 363, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-message-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/messages\/{messageId}\/targets": { + "get": { + "summary": "List message targets", + "operationId": "messagingListTargets", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of the targets associated with a message.", + "responses": { + "200": { + "description": "Target list", + "schema": { + "$ref": "#\/definitions\/targetList" + } + } + }, + "x-appwrite": { + "method": "listTargets", + "group": "messages", + "weight": 364, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-message-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "messages.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "messageId", + "description": "Message ID.", + "required": true, + "type": "string", + "x-example": "<MESSAGE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/providers": { + "get": { + "summary": "List providers", + "operationId": "messagingListProviders", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all providers from the current Appwrite project.", + "responses": { + "200": { + "description": "Provider list", + "schema": { + "$ref": "#\/definitions\/providerList" + } + } + }, + "x-appwrite": { + "method": "listProviders", + "group": "providers", + "weight": 334, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-providers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-providers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/messaging\/providers\/apns": { + "post": { + "summary": "Create APNS provider", + "operationId": "messagingCreateApnsProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Apple Push Notification service provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createApnsProvider", + "group": "providers", + "weight": 333, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "default": "", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "default": "", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "default": "", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "default": "", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/apns\/{providerId}": { + "patch": { + "summary": "Update APNS provider", + "operationId": "messagingUpdateApnsProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Apple Push Notification service provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateApnsProvider", + "group": "providers", + "weight": 346, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-apns-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-apns-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "authKey": { + "type": "string", + "description": "APNS authentication key.", + "default": "", + "x-example": "<AUTH_KEY>" + }, + "authKeyId": { + "type": "string", + "description": "APNS authentication key ID.", + "default": "", + "x-example": "<AUTH_KEY_ID>" + }, + "teamId": { + "type": "string", + "description": "APNS team ID.", + "default": "", + "x-example": "<TEAM_ID>" + }, + "bundleId": { + "type": "string", + "description": "APNS bundle ID.", + "default": "", + "x-example": "<BUNDLE_ID>" + }, + "sandbox": { + "type": "boolean", + "description": "Use APNS sandbox environment.", + "default": null, + "x-example": false + } + } + } + } + ] + } + }, + "\/messaging\/providers\/fcm": { + "post": { + "summary": "Create FCM provider", + "operationId": "messagingCreateFcmProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Firebase Cloud Messaging provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createFcmProvider", + "group": "providers", + "weight": 332, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "default": {}, + "x-example": "{}" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/fcm\/{providerId}": { + "patch": { + "summary": "Update FCM provider", + "operationId": "messagingUpdateFcmProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Firebase Cloud Messaging provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateFcmProvider", + "group": "providers", + "weight": 345, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-fcm-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-fcm-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "serviceAccountJSON": { + "type": "object", + "description": "FCM service account JSON.", + "default": {}, + "x-example": "{}" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/mailgun": { + "post": { + "summary": "Create Mailgun provider", + "operationId": "messagingCreateMailgunProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Mailgun provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createMailgunProvider", + "group": "providers", + "weight": 324, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "default": "", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "default": "", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "default": null, + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.", + "default": "", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/mailgun\/{providerId}": { + "patch": { + "summary": "Update Mailgun provider", + "operationId": "messagingUpdateMailgunProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Mailgun provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateMailgunProvider", + "group": "providers", + "weight": 337, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-mailgun-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-mailgun-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Mailgun API Key.", + "default": "", + "x-example": "<API_KEY>" + }, + "domain": { + "type": "string", + "description": "Mailgun Domain.", + "default": "", + "x-example": "<DOMAIN>" + }, + "isEuRegion": { + "type": "boolean", + "description": "Set as EU region.", + "default": null, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "default": "", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/msg91": { + "post": { + "summary": "Create Msg91 provider", + "operationId": "messagingCreateMsg91Provider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new MSG91 provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createMsg91Provider", + "group": "providers", + "weight": 327, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-msg91provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID", + "default": "", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "default": "", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "default": "", + "x-example": "<AUTH_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/msg91\/{providerId}": { + "patch": { + "summary": "Update Msg91 provider", + "operationId": "messagingUpdateMsg91Provider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a MSG91 provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateMsg91Provider", + "group": "providers", + "weight": 340, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-msg91provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-msg91-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "templateId": { + "type": "string", + "description": "Msg91 template ID.", + "default": "", + "x-example": "<TEMPLATE_ID>" + }, + "senderId": { + "type": "string", + "description": "Msg91 sender ID.", + "default": "", + "x-example": "<SENDER_ID>" + }, + "authKey": { + "type": "string", + "description": "Msg91 auth key.", + "default": "", + "x-example": "<AUTH_KEY>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/sendgrid": { + "post": { + "summary": "Create Sendgrid provider", + "operationId": "messagingCreateSendgridProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Sendgrid provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createSendgridProvider", + "group": "providers", + "weight": 325, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "default": "", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/sendgrid\/{providerId}": { + "patch": { + "summary": "Update Sendgrid provider", + "operationId": "messagingUpdateSendgridProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Sendgrid provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateSendgridProvider", + "group": "providers", + "weight": 338, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-sendgrid-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-sendgrid-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Sendgrid API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "default": "", + "x-example": "<REPLY_TO_EMAIL>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/smtp": { + "post": { + "summary": "Create SMTP provider", + "operationId": "messagingCreateSmtpProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new SMTP provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createSmtpProvider", + "group": "providers", + "weight": 326, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "default": null, + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "The default SMTP server port.", + "default": 587, + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "default": "", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "default": "", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be omitted, 'ssl', or 'tls'", + "default": "", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "default": true, + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "default": "", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the reply to field for the mail. Default value is sender name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the reply to field for the mail. Default value is sender email.", + "default": "", + "x-example": "email@example.com" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name", + "host" + ] + } + } + ] + } + }, + "\/messaging\/providers\/smtp\/{providerId}": { + "patch": { + "summary": "Update SMTP provider", + "operationId": "messagingUpdateSmtpProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a SMTP provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateSmtpProvider", + "group": "providers", + "weight": 339, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-smtp-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-smtp-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "host": { + "type": "string", + "description": "SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as `smtp1.example.com:25;smtp2.example.com`. You can also specify encryption type, for example: `tls:\/\/smtp1.example.com:587;ssl:\/\/smtp2.example.com:465\"`. Hosts will be tried in order.", + "default": "", + "x-example": "<HOST>" + }, + "port": { + "type": "integer", + "description": "SMTP port.", + "default": null, + "x-example": 1 + }, + "username": { + "type": "string", + "description": "Authentication username.", + "default": "", + "x-example": "<USERNAME>" + }, + "password": { + "type": "string", + "description": "Authentication password.", + "default": "", + "x-example": "<PASSWORD>" + }, + "encryption": { + "type": "string", + "description": "Encryption type. Can be 'ssl' or 'tls'", + "default": "", + "x-example": "none", + "enum": [ + "none", + "ssl", + "tls" + ], + "x-enum-name": "SmtpEncryption", + "x-enum-keys": [] + }, + "autoTLS": { + "type": "boolean", + "description": "Enable SMTP AutoTLS feature.", + "default": null, + "x-example": false + }, + "mailer": { + "type": "string", + "description": "The value to use for the X-Mailer header.", + "default": "", + "x-example": "<MAILER>" + }, + "fromName": { + "type": "string", + "description": "Sender Name.", + "default": "", + "x-example": "<FROM_NAME>" + }, + "fromEmail": { + "type": "string", + "description": "Sender email address.", + "default": "", + "x-example": "email@example.com" + }, + "replyToName": { + "type": "string", + "description": "Name set in the Reply To field for the mail. Default value is Sender Name.", + "default": "", + "x-example": "<REPLY_TO_NAME>" + }, + "replyToEmail": { + "type": "string", + "description": "Email set in the Reply To field for the mail. Default value is Sender Email.", + "default": "", + "x-example": "<REPLY_TO_EMAIL>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + } + } + } + ] + } + }, + "\/messaging\/providers\/telesign": { + "post": { + "summary": "Create Telesign provider", + "operationId": "messagingCreateTelesignProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Telesign provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createTelesignProvider", + "group": "providers", + "weight": 328, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "default": "", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/telesign\/{providerId}": { + "patch": { + "summary": "Update Telesign provider", + "operationId": "messagingUpdateTelesignProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Telesign provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateTelesignProvider", + "group": "providers", + "weight": 341, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-telesign-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-telesign-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "customerId": { + "type": "string", + "description": "Telesign customer ID.", + "default": "", + "x-example": "<CUSTOMER_ID>" + }, + "apiKey": { + "type": "string", + "description": "Telesign API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/textmagic": { + "post": { + "summary": "Create Textmagic provider", + "operationId": "messagingCreateTextmagicProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Textmagic provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createTextmagicProvider", + "group": "providers", + "weight": 329, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "default": "", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "default": "", + "x-example": "<API_KEY>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/textmagic\/{providerId}": { + "patch": { + "summary": "Update Textmagic provider", + "operationId": "messagingUpdateTextmagicProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Textmagic provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateTextmagicProvider", + "group": "providers", + "weight": 342, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-textmagic-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-textmagic-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "username": { + "type": "string", + "description": "Textmagic username.", + "default": "", + "x-example": "<USERNAME>" + }, + "apiKey": { + "type": "string", + "description": "Textmagic apiKey.", + "default": "", + "x-example": "<API_KEY>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/twilio": { + "post": { + "summary": "Create Twilio provider", + "operationId": "messagingCreateTwilioProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Twilio provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createTwilioProvider", + "group": "providers", + "weight": 330, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "default": "", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "default": "", + "x-example": "<AUTH_TOKEN>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/twilio\/{providerId}": { + "patch": { + "summary": "Update Twilio provider", + "operationId": "messagingUpdateTwilioProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Twilio provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateTwilioProvider", + "group": "providers", + "weight": 343, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-twilio-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-twilio-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "accountSid": { + "type": "string", + "description": "Twilio account secret ID.", + "default": "", + "x-example": "<ACCOUNT_SID>" + }, + "authToken": { + "type": "string", + "description": "Twilio authentication token.", + "default": "", + "x-example": "<AUTH_TOKEN>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/vonage": { + "post": { + "summary": "Create Vonage provider", + "operationId": "messagingCreateVonageProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new Vonage provider.", + "responses": { + "201": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "createVonageProvider", + "group": "providers", + "weight": 331, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Provider name.", + "default": null, + "x-example": "<NAME>" + }, + "from": { + "type": "string", + "description": "Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "default": "", + "x-example": "<API_SECRET>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + } + }, + "required": [ + "providerId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/providers\/vonage\/{providerId}": { + "patch": { + "summary": "Update Vonage provider", + "operationId": "messagingUpdateVonageProvider", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a Vonage provider by its unique ID.", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "updateVonageProvider", + "group": "providers", + "weight": 344, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-vonage-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-vonage-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Provider name.", + "default": "", + "x-example": "<NAME>" + }, + "enabled": { + "type": "boolean", + "description": "Set as enabled.", + "default": null, + "x-example": false + }, + "apiKey": { + "type": "string", + "description": "Vonage API key.", + "default": "", + "x-example": "<API_KEY>" + }, + "apiSecret": { + "type": "string", + "description": "Vonage API secret.", + "default": "", + "x-example": "<API_SECRET>" + }, + "from": { + "type": "string", + "description": "Sender number.", + "default": "", + "x-example": "<FROM>" + } + } + } + } + ] + } + }, + "\/messaging\/providers\/{providerId}": { + "get": { + "summary": "Get provider", + "operationId": "messagingGetProvider", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a provider by its unique ID.\n", + "responses": { + "200": { + "description": "Provider", + "schema": { + "$ref": "#\/definitions\/provider" + } + } + }, + "x-appwrite": { + "method": "getProvider", + "group": "providers", + "weight": 336, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete provider", + "operationId": "messagingDeleteProvider", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a provider by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteProvider", + "group": "providers", + "weight": 347, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete-provider.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-provider.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + } + ] + } + }, + "\/messaging\/providers\/{providerId}\/logs": { + "get": { + "summary": "List provider logs", + "operationId": "messagingListProviderLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the provider activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listProviderLogs", + "group": "providers", + "weight": 335, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-provider-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-provider-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "providers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "providerId", + "description": "Provider ID.", + "required": true, + "type": "string", + "x-example": "<PROVIDER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/subscribers\/{subscriberId}\/logs": { + "get": { + "summary": "List subscriber logs", + "operationId": "messagingListSubscriberLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the subscriber activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listSubscriberLogs", + "group": "subscribers", + "weight": 356, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-subscriber-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscriber-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "type": "string", + "x-example": "<SUBSCRIBER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/topics": { + "get": { + "summary": "List topics", + "operationId": "messagingListTopics", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all topics from the current Appwrite project.", + "responses": { + "200": { + "description": "Topic list", + "schema": { + "$ref": "#\/definitions\/topicList" + } + } + }, + "x-appwrite": { + "method": "listTopics", + "group": "topics", + "weight": 349, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-topics.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topics.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create topic", + "operationId": "messagingCreateTopic", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new topic.", + "responses": { + "201": { + "description": "Topic", + "schema": { + "$ref": "#\/definitions\/topic" + } + } + }, + "x-appwrite": { + "method": "createTopic", + "group": "topics", + "weight": 348, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "topicId": { + "type": "string", + "description": "Topic ID. Choose a custom Topic ID or a new Topic ID.", + "default": null, + "x-example": "<TOPIC_ID>" + }, + "name": { + "type": "string", + "description": "Topic Name.", + "default": null, + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": [ + "users" + ], + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + }, + "required": [ + "topicId", + "name" + ] + } + } + ] + } + }, + "\/messaging\/topics\/{topicId}": { + "get": { + "summary": "Get topic", + "operationId": "messagingGetTopic", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "schema": { + "$ref": "#\/definitions\/topic" + } + } + }, + "x-appwrite": { + "method": "getTopic", + "group": "topics", + "weight": 351, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update topic", + "operationId": "messagingUpdateTopic", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Update a topic by its unique ID.\n", + "responses": { + "200": { + "description": "Topic", + "schema": { + "$ref": "#\/definitions\/topic" + } + } + }, + "x-appwrite": { + "method": "updateTopic", + "group": "topics", + "weight": 352, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/update-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/update-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Topic Name.", + "default": null, + "x-example": "<NAME>" + }, + "subscribe": { + "type": "array", + "description": "An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https:\/\/appwrite.io\/docs\/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.", + "default": null, + "x-example": "[\"any\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete topic", + "operationId": "messagingDeleteTopic", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a topic by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteTopic", + "group": "topics", + "weight": 353, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete-topic.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-topic.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/logs": { + "get": { + "summary": "List topic logs", + "operationId": "messagingListTopicLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get the topic activity logs listed by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listTopicLogs", + "group": "topics", + "weight": 350, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-topic-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-topic-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "topics.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers": { + "get": { + "summary": "List subscribers", + "operationId": "messagingListSubscribers", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a list of all subscribers from the current Appwrite project.", + "responses": { + "200": { + "description": "Subscriber list", + "schema": { + "$ref": "#\/definitions\/subscriberList" + } + } + }, + "x-appwrite": { + "method": "listSubscribers", + "group": "subscribers", + "weight": 355, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/list-subscribers.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/list-subscribers.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create subscriber", + "operationId": "messagingCreateSubscriber", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Create a new subscriber.", + "responses": { + "201": { + "description": "Subscriber", + "schema": { + "$ref": "#\/definitions\/subscriber" + } + } + }, + "x-appwrite": { + "method": "createSubscriber", + "group": "subscribers", + "weight": 354, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/create-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/create-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "JWT": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID to subscribe to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "subscriberId": { + "type": "string", + "description": "Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.", + "default": null, + "x-example": "<SUBSCRIBER_ID>" + }, + "targetId": { + "type": "string", + "description": "Target ID. The target ID to link to the specified Topic ID.", + "default": null, + "x-example": "<TARGET_ID>" + } + }, + "required": [ + "subscriberId", + "targetId" + ] + } + } + ] + } + }, + "\/messaging\/topics\/{topicId}\/subscribers\/{subscriberId}": { + "get": { + "summary": "Get subscriber", + "operationId": "messagingGetSubscriber", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "messaging" + ], + "description": "Get a subscriber by its unique ID.\n", + "responses": { + "200": { + "description": "Subscriber", + "schema": { + "$ref": "#\/definitions\/subscriber" + } + } + }, + "x-appwrite": { + "method": "getSubscriber", + "group": "subscribers", + "weight": 357, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/get-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/get-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "type": "string", + "x-example": "<SUBSCRIBER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete subscriber", + "operationId": "messagingDeleteSubscriber", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "messaging" + ], + "description": "Delete a subscriber by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSubscriber", + "group": "subscribers", + "weight": 358, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "messaging\/delete-subscriber.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/messaging\/delete-subscriber.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "subscribers.write", + "platforms": [ + "server", + "client", + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "JWT": [] + } + }, + "security": [ + { + "Project": [], + "JWT": [], + "Session": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "topicId", + "description": "Topic ID. The topic ID subscribed to.", + "required": true, + "type": "string", + "x-example": "<TOPIC_ID>", + "in": "path" + }, + { + "name": "subscriberId", + "description": "Subscriber ID.", + "required": true, + "type": "string", + "x-example": "<SUBSCRIBER_ID>", + "in": "path" + } + ] + } + }, + "\/sites": { + "get": { + "summary": "List sites", + "operationId": "sitesList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all the project's sites. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Sites List", + "schema": { + "$ref": "#\/definitions\/siteList" + } + } + }, + "x-appwrite": { + "method": "list", + "group": "sites", + "weight": 407, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the project's sites. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create site", + "operationId": "sitesCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new site.", + "responses": { + "201": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "x-appwrite": { + "method": "create", + "group": "sites", + "weight": 405, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "siteId": { + "type": "string", + "description": "Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<SITE_ID>" + }, + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "default": null, + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "default": true, + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "default": 30, + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "default": "", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "default": "", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "default": "", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "default": null, + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "default": "", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "default": "", + "x-example": "<FALLBACK_FILE>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "siteId", + "name", + "framework", + "buildRuntime" + ] + } + } + ] + } + }, + "\/sites\/frameworks": { + "get": { + "summary": "List frameworks", + "operationId": "sitesListFrameworks", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all frameworks that are currently available on the server instance.", + "responses": { + "200": { + "description": "Frameworks List", + "schema": { + "$ref": "#\/definitions\/frameworkList" + } + } + }, + "x-appwrite": { + "method": "listFrameworks", + "group": "frameworks", + "weight": 410, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-frameworks.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all frameworks that are currently available on the server instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "public", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/specifications": { + "get": { + "summary": "List specifications", + "operationId": "sitesListSpecifications", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "List allowed site specifications for this instance.", + "responses": { + "200": { + "description": "Specifications List", + "schema": { + "$ref": "#\/definitions\/specificationList" + } + } + }, + "x-appwrite": { + "method": "listSpecifications", + "group": "frameworks", + "weight": 433, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-specifications.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList allowed site specifications for this instance.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ] + } + }, + "\/sites\/{siteId}": { + "get": { + "summary": "Get site", + "operationId": "sitesGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "sites", + "weight": 406, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update site", + "operationId": "sitesUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Update site by its unique ID.", + "responses": { + "200": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "x-appwrite": { + "method": "update", + "group": "sites", + "weight": 408, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Site name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "framework": { + "type": "string", + "description": "Sites framework.", + "default": null, + "x-example": "analog", + "enum": [ + "analog", + "angular", + "nextjs", + "react", + "nuxt", + "vue", + "sveltekit", + "astro", + "remix", + "lynx", + "flutter", + "react-native", + "vite", + "other" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "enabled": { + "type": "boolean", + "description": "Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.", + "default": true, + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "default": true, + "x-example": false + }, + "timeout": { + "type": "integer", + "description": "Maximum request time in seconds.", + "default": 30, + "x-example": 1 + }, + "installCommand": { + "type": "string", + "description": "Install Command.", + "default": "", + "x-example": "<INSTALL_COMMAND>" + }, + "buildCommand": { + "type": "string", + "description": "Build Command.", + "default": "", + "x-example": "<BUILD_COMMAND>" + }, + "outputDirectory": { + "type": "string", + "description": "Output Directory for site.", + "default": "", + "x-example": "<OUTPUT_DIRECTORY>" + }, + "buildRuntime": { + "type": "string", + "description": "Runtime to use during build step.", + "default": "", + "x-example": "node-14.5", + "enum": [ + "node-14.5", + "node-16.0", + "node-18.0", + "node-19.0", + "node-20.0", + "node-21.0", + "node-22", + "php-8.0", + "php-8.1", + "php-8.2", + "php-8.3", + "ruby-3.0", + "ruby-3.1", + "ruby-3.2", + "ruby-3.3", + "python-3.8", + "python-3.9", + "python-3.10", + "python-3.11", + "python-3.12", + "python-ml-3.11", + "python-ml-3.12", + "deno-1.21", + "deno-1.24", + "deno-1.35", + "deno-1.40", + "deno-1.46", + "deno-2.0", + "dart-2.15", + "dart-2.16", + "dart-2.17", + "dart-2.18", + "dart-2.19", + "dart-3.0", + "dart-3.1", + "dart-3.3", + "dart-3.5", + "dart-3.8", + "dotnet-6.0", + "dotnet-7.0", + "dotnet-8.0", + "java-8.0", + "java-11.0", + "java-17.0", + "java-18.0", + "java-21.0", + "java-22", + "swift-5.5", + "swift-5.8", + "swift-5.9", + "swift-5.10", + "kotlin-1.6", + "kotlin-1.8", + "kotlin-1.9", + "kotlin-2.0", + "cpp-17", + "cpp-20", + "bun-1.0", + "bun-1.1", + "go-1.23", + "static-1", + "flutter-3.24", + "flutter-3.27", + "flutter-3.29", + "flutter-3.32" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "adapter": { + "type": "string", + "description": "Framework adapter defining rendering strategy. Allowed values are: static, ssr", + "default": "", + "x-example": "static", + "enum": [ + "static", + "ssr" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "fallbackFile": { + "type": "string", + "description": "Fallback file for single page application sites.", + "default": "", + "x-example": "<FALLBACK_FILE>" + }, + "installationId": { + "type": "string", + "description": "Appwrite Installation ID for VCS (Version Control System) deployment.", + "default": "", + "x-example": "<INSTALLATION_ID>" + }, + "providerRepositoryId": { + "type": "string", + "description": "Repository ID of the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_REPOSITORY_ID>" + }, + "providerBranch": { + "type": "string", + "description": "Production branch for the repo linked to the site.", + "default": "", + "x-example": "<PROVIDER_BRANCH>" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.", + "default": false, + "x-example": false + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site code in the linked repo.", + "default": "", + "x-example": "<PROVIDER_ROOT_DIRECTORY>" + }, + "specification": { + "type": "string", + "description": "Framework specification for the site and builds.", + "default": "s-1vcpu-512mb", + "x-example": null + } + }, + "required": [ + "name", + "framework" + ] + } + } + ] + }, + "delete": { + "summary": "Delete site", + "operationId": "sitesDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "sites" + ], + "description": "Delete a site by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "sites", + "weight": 409, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployment": { + "patch": { + "summary": "Update site's deployment", + "operationId": "sitesUpdateSiteDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "responses": { + "200": { + "description": "Site", + "schema": { + "$ref": "#\/definitions\/site" + } + } + }, + "x-appwrite": { + "method": "updateSiteDeployment", + "group": "sites", + "weight": 416, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update-site-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments": { + "get": { + "summary": "List deployments", + "operationId": "sitesListDeployments", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all the site's code deployments. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Deployments List", + "schema": { + "$ref": "#\/definitions\/deploymentList" + } + } + }, + "x-appwrite": { + "method": "listDeployments", + "group": "deployments", + "weight": 415, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-deployments.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all the site's code deployments. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create deployment", + "operationId": "sitesCreateDeployment", + "consumes": [ + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createDeployment", + "group": "deployments", + "weight": 411, + "cookies": false, + "type": "upload", + "deprecated": false, + "demo": "sites\/create-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the function's deployment to use your new deployment ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": true, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "installCommand", + "description": "Install Commands.", + "required": false, + "type": "string", + "x-example": "<INSTALL_COMMAND>", + "in": "formData" + }, + { + "name": "buildCommand", + "description": "Build Commands.", + "required": false, + "type": "string", + "x-example": "<BUILD_COMMAND>", + "in": "formData" + }, + { + "name": "outputDirectory", + "description": "Output Directory.", + "required": false, + "type": "string", + "x-example": "<OUTPUT_DIRECTORY>", + "in": "formData" + }, + { + "name": "code", + "description": "Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.", + "required": true, + "type": "file", + "in": "formData" + }, + { + "name": "activate", + "description": "Automatically activate the deployment when it is finished building.", + "required": true, + "type": "boolean", + "x-example": false, + "in": "formData" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/duplicate": { + "post": { + "summary": "Create duplicate deployment", + "operationId": "sitesCreateDuplicateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createDuplicateDeployment", + "group": "deployments", + "weight": 419, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-duplicate-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "deploymentId": { + "type": "string", + "description": "Deployment ID.", + "default": null, + "x-example": "<DEPLOYMENT_ID>" + } + }, + "required": [ + "deploymentId" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/template": { + "post": { + "summary": "Create template deployment", + "operationId": "sitesCreateTemplateDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createTemplateDeployment", + "group": "deployments", + "weight": 412, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-template-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment based on a template.\n\nUse this endpoint with combination of [listTemplates](https:\/\/appwrite.io\/docs\/server\/sites#listTemplates) to find the template details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository name of the template.", + "default": null, + "x-example": "<REPOSITORY>" + }, + "owner": { + "type": "string", + "description": "The name of the owner of the template.", + "default": null, + "x-example": "<OWNER>" + }, + "rootDirectory": { + "type": "string", + "description": "Path to site code in the template repo.", + "default": null, + "x-example": "<ROOT_DIRECTORY>" + }, + "version": { + "type": "string", + "description": "Version (tag) for the repo linked to the site template.", + "default": null, + "x-example": "<VERSION>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "repository", + "owner", + "rootDirectory", + "version" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/vcs": { + "post": { + "summary": "Create VCS deployment", + "operationId": "sitesCreateVcsDeployment", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "responses": { + "202": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "createVcsDeployment", + "group": "deployments", + "weight": 413, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-vcs-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a deployment when a site is connected to VCS.\n\nThis endpoint lets you create deployment from a branch, commit, or a tag.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Type of reference passed. Allowed values are: branch, commit", + "default": null, + "x-example": "branch", + "enum": [ + "branch", + "commit", + "tag" + ], + "x-enum-name": "VCSDeploymentType", + "x-enum-keys": [] + }, + "reference": { + "type": "string", + "description": "VCS reference to create deployment from. Depending on type this can be: branch name, commit hash", + "default": null, + "x-example": "<REFERENCE>" + }, + "activate": { + "type": "boolean", + "description": "Automatically activate the deployment when it is finished building.", + "default": false, + "x-example": false + } + }, + "required": [ + "type", + "reference" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}": { + "get": { + "summary": "Get deployment", + "operationId": "sitesGetDeployment", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a site deployment by its unique ID.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "getDeployment", + "group": "deployments", + "weight": 414, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete deployment", + "operationId": "sitesDeleteDeployment", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "sites" + ], + "description": "Delete a site deployment by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteDeployment", + "group": "deployments", + "weight": 417, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-deployment.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site deployment by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/download": { + "get": { + "summary": "Get deployment download", + "operationId": "sitesGetDeploymentDownload", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "sites" + ], + "description": "Get a site deployment 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.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getDeploymentDownload", + "group": "deployments", + "weight": 418, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "sites\/get-deployment-download.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site deployment 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.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Deployment file to download. Can be: \"source\", \"output\".", + "required": false, + "type": "string", + "x-example": "source", + "enum": [ + "source", + "output" + ], + "x-enum-name": "DeploymentDownloadType", + "x-enum-keys": [], + "default": "source", + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/deployments\/{deploymentId}\/status": { + "patch": { + "summary": "Update deployment status", + "operationId": "sitesUpdateDeploymentStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "responses": { + "200": { + "description": "Deployment", + "schema": { + "$ref": "#\/definitions\/deployment" + } + } + }, + "x-appwrite": { + "method": "updateDeploymentStatus", + "group": "deployments", + "weight": 420, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update-deployment-status.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "deploymentId", + "description": "Deployment ID.", + "required": true, + "type": "string", + "x-example": "<DEPLOYMENT_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/logs": { + "get": { + "summary": "List logs", + "operationId": "sitesListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all site logs. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Executions List", + "schema": { + "$ref": "#\/definitions\/executionList" + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 422, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all site logs. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/sites\/{siteId}\/logs\/{logId}": { + "get": { + "summary": "Get log", + "operationId": "sitesGetLog", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a site request log by its unique ID.", + "responses": { + "200": { + "description": "Execution", + "schema": { + "$ref": "#\/definitions\/execution" + } + } + }, + "x-appwrite": { + "method": "getLog", + "group": "logs", + "weight": 421, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a site request log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "type": "string", + "x-example": "<LOG_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete log", + "operationId": "sitesDeleteLog", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Delete a site log by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteLog", + "group": "logs", + "weight": 423, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-log.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a site log by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "log.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "logId", + "description": "Log ID.", + "required": true, + "type": "string", + "x-example": "<LOG_ID>", + "in": "path" + } + ] + } + }, + "\/sites\/{siteId}\/variables": { + "get": { + "summary": "List variables", + "operationId": "sitesListVariables", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a list of all variables of a specific site.", + "responses": { + "200": { + "description": "Variables List", + "schema": { + "$ref": "#\/definitions\/variableList" + } + } + }, + "x-appwrite": { + "method": "listVariables", + "group": "variables", + "weight": 426, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/list-variables.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a list of all variables of a specific site.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create variable", + "operationId": "sitesCreateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "responses": { + "201": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "x-appwrite": { + "method": "createVariable", + "group": "variables", + "weight": 424, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/create-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "default": true, + "x-example": false + } + }, + "required": [ + "key", + "value" + ] + } + } + ] + } + }, + "\/sites\/{siteId}\/variables\/{variableId}": { + "get": { + "summary": "Get variable", + "operationId": "sitesGetVariable", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Get a variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "x-appwrite": { + "method": "getVariable", + "group": "variables", + "weight": 425, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/get-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update variable", + "operationId": "sitesUpdateVariable", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "sites" + ], + "description": "Update variable by its unique ID.", + "responses": { + "200": { + "description": "Variable", + "schema": { + "$ref": "#\/definitions\/variable" + } + } + }, + "x-appwrite": { + "method": "updateVariable", + "group": "variables", + "weight": 427, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/update-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Variable key. Max length: 255 chars.", + "default": null, + "x-example": "<KEY>" + }, + "value": { + "type": "string", + "description": "Variable value. Max length: 8192 chars.", + "default": null, + "x-example": "<VALUE>" + }, + "secret": { + "type": "boolean", + "description": "Secret variables can be updated or deleted, but only sites can read them during build and runtime.", + "default": null, + "x-example": false + } + }, + "required": [ + "key" + ] + } + } + ] + }, + "delete": { + "summary": "Delete variable", + "operationId": "sitesDeleteVariable", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "sites" + ], + "description": "Delete a variable by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteVariable", + "group": "variables", + "weight": 428, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "sites\/delete-variable.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a variable by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "sites.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "siteId", + "description": "Site unique ID.", + "required": true, + "type": "string", + "x-example": "<SITE_ID>", + "in": "path" + }, + { + "name": "variableId", + "description": "Variable unique ID.", + "required": true, + "type": "string", + "x-example": "<VARIABLE_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets": { + "get": { + "summary": "List buckets", + "operationId": "storageListBuckets", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a list of all the storage buckets. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Buckets List", + "schema": { + "$ref": "#\/definitions\/bucketList" + } + } + }, + "x-appwrite": { + "method": "listBuckets", + "group": "buckets", + "weight": 209, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/list-buckets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/list-buckets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create bucket", + "operationId": "storageCreateBucket", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Create a new storage bucket.", + "responses": { + "201": { + "description": "Bucket", + "schema": { + "$ref": "#\/definitions\/bucket" + } + } + }, + "x-appwrite": { + "method": "createBucket", + "group": "buckets", + "weight": 208, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/create-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "bucketId": { + "type": "string", + "description": "Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<BUCKET_ID>" + }, + "name": { + "type": "string", + "description": "Bucket name", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, no user is granted with any permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "default": true, + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "default": {}, + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "default": "none", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "default": true, + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "default": true, + "x-example": false + } + }, + "required": [ + "bucketId", + "name" + ] + } + } + ] + } + }, + "\/storage\/buckets\/{bucketId}": { + "get": { + "summary": "Get bucket", + "operationId": "storageGetBucket", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.", + "responses": { + "200": { + "description": "Bucket", + "schema": { + "$ref": "#\/definitions\/bucket" + } + } + }, + "x-appwrite": { + "method": "getBucket", + "group": "buckets", + "weight": 210, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/get-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/get-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update bucket", + "operationId": "storageUpdateBucket", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Update a storage bucket by its unique ID.", + "responses": { + "200": { + "description": "Bucket", + "schema": { + "$ref": "#\/definitions\/bucket" + } + } + }, + "x-appwrite": { + "method": "updateBucket", + "group": "buckets", + "weight": 211, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/update-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Bucket name", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + }, + "fileSecurity": { + "type": "boolean", + "description": "Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": false, + "x-example": false + }, + "enabled": { + "type": "boolean", + "description": "Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.", + "default": true, + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size allowed in bytes. Maximum allowed value is 30MB.", + "default": {}, + "x-example": 1 + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.", + "default": [], + "x-example": null, + "items": { + "type": "string" + } + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Can be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd), For file size above 20MB compression is skipped even if it's enabled", + "default": "none", + "x-example": "none", + "enum": [ + "none", + "gzip", + "zstd" + ], + "x-enum-name": null, + "x-enum-keys": [] + }, + "encryption": { + "type": "boolean", + "description": "Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled", + "default": true, + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled", + "default": true, + "x-example": false + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete bucket", + "operationId": "storageDeleteBucket", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "storage" + ], + "description": "Delete a storage bucket by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteBucket", + "group": "buckets", + "weight": 212, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/delete-bucket.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-bucket.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "buckets.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Bucket unique ID.", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files": { + "get": { + "summary": "List files", + "operationId": "storageListFiles", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a list of all the user files. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Files List", + "schema": { + "$ref": "#\/definitions\/fileList" + } + } + }, + "x-appwrite": { + "method": "listFiles", + "group": "files", + "weight": 214, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create file", + "operationId": "storageCreateFile", + "consumes": [ + "multipart\/form-data" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/storage#storageCreateBucket) API or directly from your Appwrite console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.\n", + "responses": { + "201": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "x-appwrite": { + "method": "createFile", + "group": "files", + "weight": 213, + "cookies": false, + "type": "upload", + "deprecated": false, + "demo": "storage\/create-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId},chunkId:{chunkId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "x-upload-id": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "formData" + }, + { + "name": "file", + "description": "Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https:\/\/appwrite.io\/docs\/products\/storage\/upload-download#input-file).", + "required": true, + "type": "file", + "in": "formData" + }, + { + "name": "permissions", + "description": "An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "x-example": "[\"read(\"any\")\"]", + "in": "formData" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "Get file", + "operationId": "storageGetFile", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.", + "responses": { + "200": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "x-appwrite": { + "method": "getFile", + "group": "files", + "weight": 215, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update file", + "operationId": "storageUpdateFile", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "storage" + ], + "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource.", + "responses": { + "200": { + "description": "File", + "schema": { + "$ref": "#\/definitions\/file" + } + } + }, + "x-appwrite": { + "method": "updateFile", + "group": "files", + "weight": 220, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/update-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the file", + "default": null, + "x-example": "<NAME>" + }, + "permissions": { + "type": "array", + "description": "An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "default": null, + "x-example": "[\"read(\"any\")\"]", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "delete": { + "summary": "Delete file", + "operationId": "storageDeleteFile", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "storage" + ], + "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteFile", + "group": "files", + "weight": 221, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "storage\/delete-file.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "files.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/download": { + "get": { + "summary": "Get file for download", + "operationId": "storageGetFileDownload", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "storage" + ], + "description": "Get a 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.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getFileDownload", + "group": "files", + "weight": 217, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/preview": { + "get": { + "summary": "Get file preview", + "operationId": "storageGetFilePreview", + "consumes": [], + "produces": [ + "image\/*" + ], + "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. Preview is supported only for image files smaller than 10MB.", + "responses": { + "200": { + "description": "Image", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getFilePreview", + "group": "files", + "weight": 216, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File 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": "gravity", + "description": "Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right", + "required": false, + "type": "string", + "x-example": "center", + "enum": [ + "center", + "top-left", + "top", + "top-right", + "left", + "right", + "bottom-left", + "bottom", + "bottom-right" + ], + "x-enum-name": "ImageGravity", + "x-enum-keys": [], + "default": "center", + "in": "query" + }, + { + "name": "quality", + "description": "Preview image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -1, + "default": -1, + "in": "query" + }, + { + "name": "borderWidth", + "description": "Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "borderColor", + "description": "Preview image border color. Use a valid HEX color, no # is needed for prefix.", + "required": false, + "type": "string", + "default": "", + "in": "query" + }, + { + "name": "borderRadius", + "description": "Preview image border radius in pixels. Pass an integer between 0 to 4000.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 0, + "default": 0, + "in": "query" + }, + { + "name": "opacity", + "description": "Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.", + "required": false, + "type": "number", + "format": "float", + "x-example": 0, + "default": 1, + "in": "query" + }, + { + "name": "rotation", + "description": "Preview image rotation in degrees. Pass an integer between -360 and 360.", + "required": false, + "type": "integer", + "format": "int32", + "x-example": -360, + "default": 0, + "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", + "enum": [ + "jpg", + "jpeg", + "png", + "webp", + "heic", + "avif", + "gif" + ], + "x-enum-name": "ImageFormat", + "x-enum-keys": [], + "default": "", + "in": "query" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/storage\/buckets\/{bucketId}\/files\/{fileId}\/view": { + "get": { + "summary": "Get file for view", + "operationId": "storageGetFileView", + "consumes": [], + "produces": [ + "*\/*" + ], + "tags": [ + "storage" + ], + "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.", + "responses": { + "200": { + "description": "File", + "schema": { + "type": "file" + } + } + }, + "x-appwrite": { + "method": "getFileView", + "group": "files", + "weight": 218, + "cookies": false, + "type": "location", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "token", + "description": "File token for accessing this file.", + "required": false, + "type": "string", + "x-example": "<TOKEN>", + "default": "", + "in": "query" + } + ] + } + }, + "\/teams": { + "get": { + "summary": "List teams", + "operationId": "teamsList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.", + "responses": { + "200": { + "description": "Teams List", + "schema": { + "$ref": "#\/definitions\/teamList" + } + } + }, + "x-appwrite": { + "method": "list", + "group": "teams", + "weight": 225, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create team", + "operationId": "teamsCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "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. Only the users with the owner role can invite new members, add new owners and delete or update the team.", + "responses": { + "201": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "x-appwrite": { + "method": "create", + "group": "teams", + "weight": 224, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "teamId": { + "type": "string", + "description": "Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TEAM_ID>" + }, + "name": { + "type": "string", + "description": "Team name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + }, + "roles": { + "type": "array", + "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](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": [ + "owner" + ], + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "teamId", + "name" + ] + } + } + ] + } + }, + "\/teams\/{teamId}": { + "get": { + "summary": "Get team", + "operationId": "teamsGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a team by its ID. All team members have read access for this resource.", + "responses": { + "200": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "teams", + "weight": 226, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update name", + "operationId": "teamsUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Update the team's name by its unique ID.", + "responses": { + "200": { + "description": "Team", + "schema": { + "$ref": "#\/definitions\/team" + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "teams", + "weight": 228, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "New team name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + }, + "delete": { + "summary": "Delete team", + "operationId": "teamsDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "teams" + ], + "description": "Delete a team using its ID. Only team members with the owner role can delete the team.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "teams", + "weight": 230, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships": { + "get": { + "summary": "List team memberships", + "operationId": "teamsListMemberships", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Memberships List", + "schema": { + "$ref": "#\/definitions\/membershipList" + } + } + }, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 232, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/list-team-members.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create team membership", + "operationId": "teamsCreateMembership", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team. \n\nPlease note that to avoid a [Redirect Attack](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.\n", + "responses": { + "201": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "x-appwrite": { + "method": "createMembership", + "group": "memberships", + "weight": 231, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/create-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/create-team-membership.md", + "rate-limit": 10, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the new team member.", + "default": "", + "x-example": "email@example.com" + }, + "userId": { + "type": "string", + "description": "ID of the user to be added to a team.", + "default": "", + "x-example": "<USER_ID>" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": "", + "x-example": "+12065550100" + }, + "roles": { + "type": "array", + "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](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.", + "default": "", + "x-example": "https:\/\/example.com" + }, + "name": { + "type": "string", + "description": "Name of the new team member. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "roles" + ] + } + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}": { + "get": { + "summary": "Get team membership", + "operationId": "teamsGetMembership", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "x-appwrite": { + "method": "getMembership", + "group": "memberships", + "weight": 233, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/get-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-member.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update membership", + "operationId": "teamsUpdateMembership", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions).\n", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "x-appwrite": { + "method": "updateMembership", + "group": "memberships", + "weight": 234, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-membership.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "roles": { + "type": "array", + "description": "An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https:\/\/appwrite.io\/docs\/permissions). Maximum of 100 roles are allowed, each 32 characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "roles" + ] + } + } + ] + }, + "delete": { + "summary": "Delete team membership", + "operationId": "teamsDeleteMembership", + "consumes": [ + "application\/json" + ], + "produces": [], + "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 it is not accepted.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMembership", + "group": "memberships", + "weight": 236, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + } + ] + } + }, + "\/teams\/{teamId}\/memberships\/{membershipId}\/status": { + "patch": { + "summary": "Update team membership status", + "operationId": "teamsUpdateMembershipStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n", + "responses": { + "200": { + "description": "Membership", + "schema": { + "$ref": "#\/definitions\/membership" + } + } + }, + "x-appwrite": { + "method": "updateMembershipStatus", + "group": "memberships", + "weight": 235, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "membershipId", + "description": "Membership ID.", + "required": true, + "type": "string", + "x-example": "<MEMBERSHIP_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID.", + "default": null, + "x-example": "<USER_ID>" + }, + "secret": { + "type": "string", + "description": "Secret key.", + "default": null, + "x-example": "<SECRET>" + } + }, + "required": [ + "userId", + "secret" + ] + } + } + ] + } + }, + "\/teams\/{teamId}\/prefs": { + "get": { + "summary": "Get team preferences", + "operationId": "teamsGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#getPrefs).", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "teams", + "weight": 227, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/get-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.read", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update preferences", + "operationId": "teamsUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "teams" + ], + "description": "Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "teams", + "weight": 229, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "teams\/update-prefs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-prefs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "teams.write", + "platforms": [ + "client", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Session": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "teamId", + "description": "Team ID.", + "required": true, + "type": "string", + "x-example": "<TEAM_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + }, + "\/tokens\/buckets\/{bucketId}\/files\/{fileId}": { + "get": { + "summary": "List tokens", + "operationId": "tokensList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "List all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Resource Tokens List", + "schema": { + "$ref": "#\/definitions\/resourceTokenList" + } + } + }, + "x-appwrite": { + "method": "list", + "group": "files", + "weight": 441, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/list.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterList all the tokens created for a specific file or bucket. You can use the query params to filter your results.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create file token", + "operationId": "tokensCreateFileToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Create a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "responses": { + "201": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "createFileToken", + "group": "files", + "weight": 439, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/create-file-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterCreate a new token. A token is linked to a file. Token can be passed as a request URL search parameter.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "bucketId", + "description": "Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https:\/\/appwrite.io\/docs\/server\/storage#createBucket).", + "required": true, + "type": "string", + "x-example": "<BUCKET_ID>", + "in": "path" + }, + { + "name": "fileId", + "description": "File unique ID.", + "required": true, + "type": "string", + "x-example": "<FILE_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "Token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + } + } + } + } + ] + } + }, + "\/tokens\/{tokenId}": { + "get": { + "summary": "Get token", + "operationId": "tokensGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Get a token by its unique ID.", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "tokens", + "weight": 440, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/get.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterGet a token by its unique ID.", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "tokens.read", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update token", + "operationId": "tokensUpdate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "tokens" + ], + "description": "Update a token by its unique ID. Use this endpoint to update a token's expiry date.", + "responses": { + "200": { + "description": "ResourceToken", + "schema": { + "$ref": "#\/definitions\/resourceToken" + } + } + }, + "x-appwrite": { + "method": "update", + "group": "tokens", + "weight": 442, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/update.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterUpdate a token by its unique ID. Use this endpoint to update a token's expiry date.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token unique ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "string", + "description": "File token expiry date", + "default": null, + "x-example": null, + "x-nullable": true + } + } + } + } + ] + }, + "delete": { + "summary": "Delete token", + "operationId": "tokensDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "tokens" + ], + "description": "Delete a token by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "tokens", + "weight": 443, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "tokens\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/masterDelete a token by its unique ID.", + "rate-limit": 60, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "tokens.write", + "platforms": [ + "console", + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "tokenId", + "description": "Token ID.", + "required": true, + "type": "string", + "x-example": "<TOKEN_ID>", + "in": "path" + } + ] + } + }, + "\/users": { + "get": { + "summary": "List users", + "operationId": "usersList", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get a list of all the project's users. You can use the query params to filter your results.", + "responses": { + "200": { + "description": "Users List", + "schema": { + "$ref": "#\/definitions\/userList" + } + } + }, + "x-appwrite": { + "method": "list", + "group": "users", + "weight": 247, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + }, + "post": { + "summary": "Create user", + "operationId": "usersCreate", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "create", + "group": "users", + "weight": 238, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "phone": { + "type": "string", + "description": "Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.", + "default": null, + "x-example": "+12065550100" + }, + "password": { + "type": "string", + "description": "Plain text user password. Must be at least 8 chars.", + "default": "", + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId" + ] + } + } + ] + } + }, + "\/users\/argon2": { + "post": { + "summary": "Create user with Argon2 password", + "operationId": "usersCreateArgon2User", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Argon2](https:\/\/en.wikipedia.org\/wiki\/Argon2) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "createArgon2User", + "group": "users", + "weight": 241, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-argon2user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-argon2-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Argon2.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/bcrypt": { + "post": { + "summary": "Create user with bcrypt password", + "operationId": "usersCreateBcryptUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Bcrypt](https:\/\/en.wikipedia.org\/wiki\/Bcrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "createBcryptUser", + "group": "users", + "weight": 239, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-bcrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-bcrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Bcrypt.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/identities": { + "get": { + "summary": "List identities", + "operationId": "usersListIdentities", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get identities for all users.", + "responses": { + "200": { + "description": "Identities List", + "schema": { + "$ref": "#\/definitions\/identityList" + } + } + }, + "x-appwrite": { + "method": "listIdentities", + "group": "identities", + "weight": 255, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-identities.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-identities.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/users\/identities\/{identityId}": { + "delete": { + "summary": "Delete identity", + "operationId": "usersDeleteIdentity", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete an identity by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteIdentity", + "group": "identities", + "weight": 278, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-identity.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-identity.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "identityId", + "description": "Identity ID.", + "required": true, + "type": "string", + "x-example": "<IDENTITY_ID>", + "in": "path" + } + ] + } + }, + "\/users\/md5": { + "post": { + "summary": "Create user with MD5 password", + "operationId": "usersCreateMD5User", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [MD5](https:\/\/en.wikipedia.org\/wiki\/MD5) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "createMD5User", + "group": "users", + "weight": 240, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-m-d5user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-md5-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using MD5.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/phpass": { + "post": { + "summary": "Create user with PHPass password", + "operationId": "usersCreatePHPassUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [PHPass](https:\/\/www.openwall.com\/phpass\/) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "createPHPassUser", + "group": "users", + "weight": 243, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-p-h-pass-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-phpass-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or pass the string `ID.unique()`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using PHPass.", + "default": null, + "x-example": "password" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/scrypt": { + "post": { + "summary": "Create user with Scrypt password", + "operationId": "usersCreateScryptUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt](https:\/\/github.com\/Tarsnap\/scrypt) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "createScryptUser", + "group": "users", + "weight": 244, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-scrypt-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt.", + "default": null, + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Optional salt used to hash password.", + "default": null, + "x-example": "<PASSWORD_SALT>" + }, + "passwordCpu": { + "type": "integer", + "description": "Optional CPU cost used to hash password.", + "default": null, + "x-example": null + }, + "passwordMemory": { + "type": "integer", + "description": "Optional memory cost used to hash password.", + "default": null, + "x-example": null + }, + "passwordParallel": { + "type": "integer", + "description": "Optional parallelization cost used to hash password.", + "default": null, + "x-example": null + }, + "passwordLength": { + "type": "integer", + "description": "Optional hash length used to hash password.", + "default": null, + "x-example": null + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordCpu", + "passwordMemory", + "passwordParallel", + "passwordLength" + ] + } + } + ] + } + }, + "\/users\/scrypt-modified": { + "post": { + "summary": "Create user with Scrypt modified password", + "operationId": "usersCreateScryptModifiedUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [Scrypt Modified](https:\/\/gist.github.com\/Meldiron\/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "createScryptModifiedUser", + "group": "users", + "weight": 245, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-scrypt-modified-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-scrypt-modified-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using Scrypt Modified.", + "default": null, + "x-example": "password" + }, + "passwordSalt": { + "type": "string", + "description": "Salt used to hash password.", + "default": null, + "x-example": "<PASSWORD_SALT>" + }, + "passwordSaltSeparator": { + "type": "string", + "description": "Salt separator used to hash password.", + "default": null, + "x-example": "<PASSWORD_SALT_SEPARATOR>" + }, + "passwordSignerKey": { + "type": "string", + "description": "Signer key used to hash password.", + "default": null, + "x-example": "<PASSWORD_SIGNER_KEY>" + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password", + "passwordSalt", + "passwordSaltSeparator", + "passwordSignerKey" + ] + } + } + ] + } + }, + "\/users\/sha": { + "post": { + "summary": "Create user with SHA password", + "operationId": "usersCreateSHAUser", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a new user. Password provided must be hashed with the [SHA](https:\/\/en.wikipedia.org\/wiki\/Secure_Hash_Algorithm) algorithm. Use the [POST \/users](https:\/\/appwrite.io\/docs\/server\/users#usersCreate) endpoint to create users with a plain text password.", + "responses": { + "201": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "createSHAUser", + "group": "users", + "weight": 242, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-s-h-a-user.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-sha-user.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<USER_ID>" + }, + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + }, + "password": { + "type": "string", + "description": "User password hashed using SHA.", + "default": null, + "x-example": "password" + }, + "passwordVersion": { + "type": "string", + "description": "Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512\/224', 'sha512\/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'", + "default": "", + "x-example": "sha1", + "enum": [ + "sha1", + "sha224", + "sha256", + "sha384", + "sha512\/224", + "sha512\/256", + "sha512", + "sha3-224", + "sha3-256", + "sha3-384", + "sha3-512" + ], + "x-enum-name": "PasswordHash", + "x-enum-keys": [] + }, + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "userId", + "email", + "password" + ] + } + } + ] + } + }, + "\/users\/{userId}": { + "get": { + "summary": "Get user", + "operationId": "usersGet", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get a user by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "get", + "group": "users", + "weight": 248, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user", + "operationId": "usersDelete", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https:\/\/appwrite.io\/docs\/server\/users#usersUpdateStatus) endpoint instead.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "delete", + "group": "users", + "weight": 276, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/email": { + "patch": { + "summary": "Update email", + "operationId": "usersUpdateEmail", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user email by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateEmail", + "group": "users", + "weight": 261, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-email.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "User email.", + "default": null, + "x-example": "email@example.com" + } + }, + "required": [ + "email" + ] + } + } + ] + } + }, + "\/users\/{userId}\/jwts": { + "post": { + "summary": "Create user JWT", + "operationId": "usersCreateJWT", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.", + "responses": { + "201": { + "description": "JWT", + "schema": { + "$ref": "#\/definitions\/jwt" + } + } + }, + "x-appwrite": { + "method": "createJWT", + "group": "sessions", + "weight": 279, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-j-w-t.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-user-jwt.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "sessionId": { + "type": "string", + "description": "Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.", + "default": "", + "x-example": "<SESSION_ID>" + }, + "duration": { + "type": "integer", + "description": "Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.", + "default": 900, + "x-example": 0 + } + } + } + } + ] + } + }, + "\/users\/{userId}\/labels": { + "put": { + "summary": "Update user labels", + "operationId": "usersUpdateLabels", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user labels by its unique ID. \n\nLabels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https:\/\/appwrite.io\/docs\/permissions) for more info.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateLabels", + "group": "users", + "weight": 257, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-labels.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-labels.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "labels": { + "type": "array", + "description": "Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.", + "default": null, + "x-example": null, + "items": { + "type": "string" + } + } + }, + "required": [ + "labels" + ] + } + } + ] + } + }, + "\/users\/{userId}\/logs": { + "get": { + "summary": "List user logs", + "operationId": "usersListLogs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user activity logs list by its unique ID.", + "responses": { + "200": { + "description": "Logs List", + "schema": { + "$ref": "#\/definitions\/logList" + } + } + }, + "x-appwrite": { + "method": "listLogs", + "group": "logs", + "weight": 253, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-logs.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-logs.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Only supported methods are limit and offset", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/memberships": { + "get": { + "summary": "List user memberships", + "operationId": "usersListMemberships", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user membership list by its unique ID.", + "responses": { + "200": { + "description": "Memberships List", + "schema": { + "$ref": "#\/definitions\/membershipList" + } + } + }, + "x-appwrite": { + "method": "listMemberships", + "group": "memberships", + "weight": 252, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-memberships.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-memberships.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + }, + { + "name": "search", + "description": "Search term to filter your list results. Max length: 256 chars.", + "required": false, + "type": "string", + "x-example": "<SEARCH>", + "default": "", + "in": "query" + } + ] + } + }, + "\/users\/{userId}\/mfa": { + "patch": { + "summary": "Update MFA", + "operationId": "usersUpdateMfa", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Enable or disable MFA on a user account.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateMfa", + "group": "users", + "weight": 266, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-mfa.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-mfa.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "mfa": { + "type": "boolean", + "description": "Enable or disable MFA.", + "default": null, + "x-example": false + } + }, + "required": [ + "mfa" + ] + } + } + ] + } + }, + "\/users\/{userId}\/mfa\/authenticators\/{type}": { + "delete": { + "summary": "Delete authenticator", + "operationId": "usersDeleteMfaAuthenticator", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete an authenticator app.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteMfaAuthenticator", + "group": "mfa", + "weight": 271, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-mfa-authenticator.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-mfa-authenticator.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "type", + "description": "Type of authenticator.", + "required": true, + "type": "string", + "x-example": "totp", + "enum": [ + "totp" + ], + "x-enum-name": "AuthenticatorType", + "x-enum-keys": [], + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/factors": { + "get": { + "summary": "List factors", + "operationId": "usersListMfaFactors", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "List the factors available on the account to be used as a MFA challange.", + "responses": { + "200": { + "description": "MFAFactors", + "schema": { + "$ref": "#\/definitions\/mfaFactors" + } + } + }, + "x-appwrite": { + "method": "listMfaFactors", + "group": "mfa", + "weight": 267, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-mfa-factors.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-mfa-factors.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/mfa\/recovery-codes": { + "get": { + "summary": "Get MFA recovery codes", + "operationId": "usersGetMfaRecoveryCodes", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "x-appwrite": { + "method": "getMfaRecoveryCodes", + "group": "mfa", + "weight": 268, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/get-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "put": { + "summary": "Update MFA recovery codes (regenerate)", + "operationId": "usersUpdateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](\/docs\/references\/cloud\/client-web\/account#createMfaRecoveryCodes) method.", + "responses": { + "200": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "x-appwrite": { + "method": "updateMfaRecoveryCodes", + "group": "mfa", + "weight": 270, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Create MFA recovery codes", + "operationId": "usersCreateMfaRecoveryCodes", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](\/docs\/references\/cloud\/client-web\/account#createMfaChallenge) method by client SDK.", + "responses": { + "201": { + "description": "MFA Recovery Codes", + "schema": { + "$ref": "#\/definitions\/mfaRecoveryCodes" + } + } + }, + "x-appwrite": { + "method": "createMfaRecoveryCodes", + "group": "mfa", + "weight": 269, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-mfa-recovery-codes.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-mfa-recovery-codes.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/name": { + "patch": { + "summary": "Update name", + "operationId": "usersUpdateName", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user name by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateName", + "group": "users", + "weight": 259, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-name.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-name.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User name. Max length: 128 chars.", + "default": null, + "x-example": "<NAME>" + } + }, + "required": [ + "name" + ] + } + } + ] + } + }, + "\/users\/{userId}\/password": { + "patch": { + "summary": "Update password", + "operationId": "usersUpdatePassword", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user password by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updatePassword", + "group": "users", + "weight": 260, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-password.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-password.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "New user password. Must be at least 8 chars.", + "default": null, + "x-example": null + } + }, + "required": [ + "password" + ] + } + } + ] + } + }, + "\/users\/{userId}\/phone": { + "patch": { + "summary": "Update phone", + "operationId": "usersUpdatePhone", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user phone by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updatePhone", + "group": "users", + "weight": 262, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-phone.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "User phone number.", + "default": null, + "x-example": "+12065550100" + } + }, + "required": [ + "number" + ] + } + } + ] + } + }, + "\/users\/{userId}\/prefs": { + "get": { + "summary": "Get user preferences", + "operationId": "usersGetPrefs", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user preferences by its unique ID.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "x-appwrite": { + "method": "getPrefs", + "group": "users", + "weight": 249, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user preferences", + "operationId": "usersUpdatePrefs", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.", + "responses": { + "200": { + "description": "Preferences", + "schema": { + "$ref": "#\/definitions\/preferences" + } + } + }, + "x-appwrite": { + "method": "updatePrefs", + "group": "users", + "weight": 264, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "prefs": { + "type": "object", + "description": "Prefs key-value JSON object.", + "default": {}, + "x-example": "{}" + } + }, + "required": [ + "prefs" + ] + } + } + ] + } + }, + "\/users\/{userId}\/sessions": { + "get": { + "summary": "List user sessions", + "operationId": "usersListSessions", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get the user sessions list by its unique ID.", + "responses": { + "200": { + "description": "Sessions List", + "schema": { + "$ref": "#\/definitions\/sessionList" + } + } + }, + "x-appwrite": { + "method": "listSessions", + "group": "sessions", + "weight": 251, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.read", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "post": { + "summary": "Create session", + "operationId": "usersCreateSession", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Creates a session for a user. Returns an immediately usable session object.\n\nIf you want to generate a token for a custom authentication flow, use the [POST \/users\/{userId}\/tokens](https:\/\/appwrite.io\/docs\/server\/users#createToken) endpoint.", + "responses": { + "201": { + "description": "Session", + "schema": { + "$ref": "#\/definitions\/session" + } + } + }, + "x-appwrite": { + "method": "createSession", + "group": "sessions", + "weight": 272, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + }, + "delete": { + "summary": "Delete user sessions", + "operationId": "usersDeleteSessions", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete all user's sessions by using the user's unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSessions", + "group": "sessions", + "weight": 275, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-sessions.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-sessions.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/sessions\/{sessionId}": { + "delete": { + "summary": "Delete user session", + "operationId": "usersDeleteSession", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete a user sessions by its unique ID.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteSession", + "group": "sessions", + "weight": 274, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-session.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-user-session.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "sessionId", + "description": "Session ID.", + "required": true, + "type": "string", + "x-example": "<SESSION_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/status": { + "patch": { + "summary": "Update user status", + "operationId": "usersUpdateStatus", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateStatus", + "group": "users", + "weight": 256, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "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" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "description": "User Status. To activate the user pass `true` and to block the user pass `false`.", + "default": null, + "x-example": false + } + }, + "required": [ + "status" + ] + } + } + ] + } + }, + "\/users\/{userId}\/targets": { + "get": { + "summary": "List user targets", + "operationId": "usersListTargets", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "List the messaging targets that are associated with a user.", + "responses": { + "200": { + "description": "Target list", + "schema": { + "$ref": "#\/definitions\/targetList" + } + } + }, + "x-appwrite": { + "method": "listTargets", + "group": "targets", + "weight": 254, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/list-targets.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/list-user-targets.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "queries", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", + "required": false, + "type": "array", + "collectionFormat": "multi", + "items": { + "type": "string" + }, + "default": [], + "in": "query" + } + ] + }, + "post": { + "summary": "Create user target", + "operationId": "usersCreateTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Create a messaging target.", + "responses": { + "201": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "x-appwrite": { + "method": "createTarget", + "group": "targets", + "weight": 246, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "targetId": { + "type": "string", + "description": "Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.", + "default": null, + "x-example": "<TARGET_ID>" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "default": null, + "x-example": "email", + "enum": [ + "email", + "sms", + "push" + ], + "x-enum-name": "MessagingProviderType", + "x-enum-keys": [] + }, + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": null, + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "default": "", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "default": "", + "x-example": "<NAME>" + } + }, + "required": [ + "targetId", + "providerType", + "identifier" + ] + } + } + ] + } + }, + "\/users\/{userId}\/targets\/{targetId}": { + "get": { + "summary": "Get user target", + "operationId": "usersGetTarget", + "consumes": [], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Get a user's push notification target by ID.", + "responses": { + "200": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "x-appwrite": { + "method": "getTarget", + "group": "targets", + "weight": 250, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/get-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.read", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + } + ] + }, + "patch": { + "summary": "Update user target", + "operationId": "usersUpdateTarget", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update a messaging target.", + "responses": { + "200": { + "description": "Target", + "schema": { + "$ref": "#\/definitions\/target" + } + } + }, + "x-appwrite": { + "method": "updateTarget", + "group": "targets", + "weight": 265, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "The target identifier (token, email, phone etc.)", + "default": "", + "x-example": "<IDENTIFIER>" + }, + "providerId": { + "type": "string", + "description": "Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.", + "default": "", + "x-example": "<PROVIDER_ID>" + }, + "name": { + "type": "string", + "description": "Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.", + "default": "", + "x-example": "<NAME>" + } + } + } + } + ] + }, + "delete": { + "summary": "Delete user target", + "operationId": "usersDeleteTarget", + "consumes": [ + "application\/json" + ], + "produces": [], + "tags": [ + "users" + ], + "description": "Delete a messaging target.", + "responses": { + "204": { + "description": "No content" + } + }, + "x-appwrite": { + "method": "deleteTarget", + "group": "targets", + "weight": 277, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/delete-target.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/delete-target.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "targets.write", + "platforms": [ + "server", + "console" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "targetId", + "description": "Target ID.", + "required": true, + "type": "string", + "x-example": "<TARGET_ID>", + "in": "path" + } + ] + } + }, + "\/users\/{userId}\/tokens": { + "post": { + "summary": "Create token", + "operationId": "usersCreateToken", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT \/account\/sessions\/token](https:\/\/appwrite.io\/docs\/references\/cloud\/client-web\/account#createSession) endpoint to complete the login process.\n", + "responses": { + "201": { + "description": "Token", + "schema": { + "$ref": "#\/definitions\/token" + } + } + }, + "x-appwrite": { + "method": "createToken", + "group": "sessions", + "weight": 273, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/create-token.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/create-token.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "length": { + "type": "integer", + "description": "Token length in characters. The default length is 6 characters", + "default": 6, + "x-example": 4 + }, + "expire": { + "type": "integer", + "description": "Token expiration period in seconds. The default expiration is 15 minutes.", + "default": 900, + "x-example": 60 + } + } + } + } + ] + } + }, + "\/users\/{userId}\/verification": { + "patch": { + "summary": "Update email verification", + "operationId": "usersUpdateEmailVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user email verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updateEmailVerification", + "group": "users", + "weight": 263, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-email-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-email-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "emailVerification": { + "type": "boolean", + "description": "User email verification status.", + "default": null, + "x-example": false + } + }, + "required": [ + "emailVerification" + ] + } + } + ] + } + }, + "\/users\/{userId}\/verification\/phone": { + "patch": { + "summary": "Update phone verification", + "operationId": "usersUpdatePhoneVerification", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "users" + ], + "description": "Update the user phone verification status by its unique ID.", + "responses": { + "200": { + "description": "User", + "schema": { + "$ref": "#\/definitions\/user" + } + } + }, + "x-appwrite": { + "method": "updatePhoneVerification", + "group": "users", + "weight": 258, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "users\/update-phone-verification.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/update-user-phone-verification.md", + "rate-limit": 0, + "rate-time": 3600, + "rate-key": "url:{url},ip:{ip}", + "scope": "users.write", + "platforms": [ + "server" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [] + } + ], + "parameters": [ + { + "name": "userId", + "description": "User ID.", + "required": true, + "type": "string", + "x-example": "<USER_ID>", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "phoneVerification": { + "type": "boolean", + "description": "User phone verification status.", + "default": null, + "x-example": false + } + }, + "required": [ + "phoneVerification" + ] + } + } + ] + } + } + }, + "tags": [ + { + "name": "account", + "description": "The Account service allows you to authenticate and manage a user account." + }, + { + "name": "avatars", + "description": "The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars." + }, + { + "name": "databases", + "description": "The Databases service allows you to create structured collections of documents, query and filter lists of documents" + }, + { + "name": "locale", + "description": "The Locale service allows you to customize your app based on your users' location." + }, + { + "name": "health", + "description": "The Health service allows you to both validate and monitor your Appwrite server's health." + }, + { + "name": "projects", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "project", + "description": "The Project service allows you to manage all the projects in your Appwrite server." + }, + { + "name": "storage", + "description": "The Storage service allows you to manage your project files." + }, + { + "name": "teams", + "description": "The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources" + }, + { + "name": "users", + "description": "The Users service allows you to manage your project users." + }, + { + "name": "sites", + "description": "The Sites Service allows you view, create and manage your web applications." + }, + { + "name": "functions", + "description": "The Functions Service allows you view, create and manage your Cloud Functions." + }, + { + "name": "proxy", + "description": "The Proxy Service allows you to configure actions for your domains beyond DNS configuration." + }, + { + "name": "graphql", + "description": "The GraphQL API allows you to query and mutate your Appwrite server using GraphQL." + }, + { + "name": "console", + "description": "The Console service allows you to interact with console relevant informations." + }, + { + "name": "migrations", + "description": "The Migrations service allows you to migrate third-party data to your Appwrite project." + }, + { + "name": "messaging", + "description": "The Messaging service allows you to send messages to any provider type (SMTP, push notification, SMS, etc.)." + } + ], + "definitions": { + "any": { + "description": "Any", + "type": "object", + "additionalProperties": true + }, + "documentList": { + "description": "Documents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of documents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "documents": { + "type": "array", + "description": "List of documents.", + "items": { + "type": "object", + "$ref": "#\/definitions\/document" + }, + "x-example": "" + } + }, + "required": [ + "total", + "documents" + ] + }, + "collectionList": { + "description": "Collections List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of collections documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "collections": { + "type": "array", + "description": "List of collections.", + "items": { + "type": "object", + "$ref": "#\/definitions\/collection" + }, + "x-example": "" + } + }, + "required": [ + "total", + "collections" + ] + }, + "databaseList": { + "description": "Databases List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of databases documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "databases": { + "type": "array", + "description": "List of databases.", + "items": { + "type": "object", + "$ref": "#\/definitions\/database" + }, + "x-example": "" + } + }, + "required": [ + "total", + "databases" + ] + }, + "indexList": { + "description": "Indexes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of indexes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "indexes": { + "type": "array", + "description": "List of indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/index" + }, + "x-example": "" + } + }, + "required": [ + "total", + "indexes" + ] + }, + "userList": { + "description": "Users List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of users documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "users": { + "type": "array", + "description": "List of users.", + "items": { + "type": "object", + "$ref": "#\/definitions\/user" + }, + "x-example": "" + } + }, + "required": [ + "total", + "users" + ] + }, + "sessionList": { + "description": "Sessions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sessions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sessions": { + "type": "array", + "description": "List of sessions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/session" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sessions" + ] + }, + "identityList": { + "description": "Identities List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of identities documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "identities": { + "type": "array", + "description": "List of identities.", + "items": { + "type": "object", + "$ref": "#\/definitions\/identity" + }, + "x-example": "" + } + }, + "required": [ + "total", + "identities" + ] + }, + "logList": { + "description": "Logs List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of logs documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "logs": { + "type": "array", + "description": "List of logs.", + "items": { + "type": "object", + "$ref": "#\/definitions\/log" + }, + "x-example": "" + } + }, + "required": [ + "total", + "logs" + ] + }, + "fileList": { + "description": "Files List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of files documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "files": { + "type": "array", + "description": "List of files.", + "items": { + "type": "object", + "$ref": "#\/definitions\/file" + }, + "x-example": "" + } + }, + "required": [ + "total", + "files" + ] + }, + "bucketList": { + "description": "Buckets List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of buckets documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "buckets": { + "type": "array", + "description": "List of buckets.", + "items": { + "type": "object", + "$ref": "#\/definitions\/bucket" + }, + "x-example": "" + } + }, + "required": [ + "total", + "buckets" + ] + }, + "resourceTokenList": { + "description": "Resource Tokens List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of tokens documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "tokens": { + "type": "array", + "description": "List of tokens.", + "items": { + "type": "object", + "$ref": "#\/definitions\/resourceToken" + }, + "x-example": "" + } + }, + "required": [ + "total", + "tokens" + ] + }, + "teamList": { + "description": "Teams List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of teams documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "teams": { + "type": "array", + "description": "List of teams.", + "items": { + "type": "object", + "$ref": "#\/definitions\/team" + }, + "x-example": "" + } + }, + "required": [ + "total", + "teams" + ] + }, + "membershipList": { + "description": "Memberships List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of memberships documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "memberships": { + "type": "array", + "description": "List of memberships.", + "items": { + "type": "object", + "$ref": "#\/definitions\/membership" + }, + "x-example": "" + } + }, + "required": [ + "total", + "memberships" + ] + }, + "siteList": { + "description": "Sites List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of sites documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "sites": { + "type": "array", + "description": "List of sites.", + "items": { + "type": "object", + "$ref": "#\/definitions\/site" + }, + "x-example": "" + } + }, + "required": [ + "total", + "sites" + ] + }, + "functionList": { + "description": "Functions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of functions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "functions": { + "type": "array", + "description": "List of functions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/function" + }, + "x-example": "" + } + }, + "required": [ + "total", + "functions" + ] + }, + "frameworkList": { + "description": "Frameworks List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of frameworks documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "frameworks": { + "type": "array", + "description": "List of frameworks.", + "items": { + "type": "object", + "$ref": "#\/definitions\/framework" + }, + "x-example": "" + } + }, + "required": [ + "total", + "frameworks" + ] + }, + "runtimeList": { + "description": "Runtimes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of runtimes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "runtimes": { + "type": "array", + "description": "List of runtimes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/runtime" + }, + "x-example": "" + } + }, + "required": [ + "total", + "runtimes" + ] + }, + "deploymentList": { + "description": "Deployments List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of deployments documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "deployments": { + "type": "array", + "description": "List of deployments.", + "items": { + "type": "object", + "$ref": "#\/definitions\/deployment" + }, + "x-example": "" + } + }, + "required": [ + "total", + "deployments" + ] + }, + "executionList": { + "description": "Executions List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of executions documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "executions": { + "type": "array", + "description": "List of executions.", + "items": { + "type": "object", + "$ref": "#\/definitions\/execution" + }, + "x-example": "" + } + }, + "required": [ + "total", + "executions" + ] + }, + "countryList": { + "description": "Countries List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of countries documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "countries": { + "type": "array", + "description": "List of countries.", + "items": { + "type": "object", + "$ref": "#\/definitions\/country" + }, + "x-example": "" + } + }, + "required": [ + "total", + "countries" + ] + }, + "continentList": { + "description": "Continents List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of continents documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "continents": { + "type": "array", + "description": "List of continents.", + "items": { + "type": "object", + "$ref": "#\/definitions\/continent" + }, + "x-example": "" + } + }, + "required": [ + "total", + "continents" + ] + }, + "languageList": { + "description": "Languages List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of languages documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "languages": { + "type": "array", + "description": "List of languages.", + "items": { + "type": "object", + "$ref": "#\/definitions\/language" + }, + "x-example": "" + } + }, + "required": [ + "total", + "languages" + ] + }, + "currencyList": { + "description": "Currencies List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of currencies documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "currencies": { + "type": "array", + "description": "List of currencies.", + "items": { + "type": "object", + "$ref": "#\/definitions\/currency" + }, + "x-example": "" + } + }, + "required": [ + "total", + "currencies" + ] + }, + "phoneList": { + "description": "Phones List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of phones documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "phones": { + "type": "array", + "description": "List of phones.", + "items": { + "type": "object", + "$ref": "#\/definitions\/phone" + }, + "x-example": "" + } + }, + "required": [ + "total", + "phones" + ] + }, + "variableList": { + "description": "Variables List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of variables documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "variables": { + "type": "array", + "description": "List of variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/variable" + }, + "x-example": "" + } + }, + "required": [ + "total", + "variables" + ] + }, + "localeCodeList": { + "description": "Locale codes list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of localeCodes documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "localeCodes": { + "type": "array", + "description": "List of localeCodes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/localeCode" + }, + "x-example": "" + } + }, + "required": [ + "total", + "localeCodes" + ] + }, + "providerList": { + "description": "Provider list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of providers documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "providers": { + "type": "array", + "description": "List of providers.", + "items": { + "type": "object", + "$ref": "#\/definitions\/provider" + }, + "x-example": "" + } + }, + "required": [ + "total", + "providers" + ] + }, + "messageList": { + "description": "Message list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of messages documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "messages": { + "type": "array", + "description": "List of messages.", + "items": { + "type": "object", + "$ref": "#\/definitions\/message" + }, + "x-example": "" + } + }, + "required": [ + "total", + "messages" + ] + }, + "topicList": { + "description": "Topic list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of topics documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "topics": { + "type": "array", + "description": "List of topics.", + "items": { + "type": "object", + "$ref": "#\/definitions\/topic" + }, + "x-example": "" + } + }, + "required": [ + "total", + "topics" + ] + }, + "subscriberList": { + "description": "Subscriber list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of subscribers documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "subscribers": { + "type": "array", + "description": "List of subscribers.", + "items": { + "type": "object", + "$ref": "#\/definitions\/subscriber" + }, + "x-example": "" + } + }, + "required": [ + "total", + "subscribers" + ] + }, + "targetList": { + "description": "Target list", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of targets documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "targets": { + "type": "array", + "description": "List of targets.", + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + }, + "x-example": "" + } + }, + "required": [ + "total", + "targets" + ] + }, + "specificationList": { + "description": "Specifications List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of specifications documents that matched your query.", + "x-example": 5, + "format": "int32" + }, + "specifications": { + "type": "array", + "description": "List of specifications.", + "items": { + "type": "object", + "$ref": "#\/definitions\/specification" + }, + "x-example": "" + } + }, + "required": [ + "total", + "specifications" + ] + }, + "database": { + "description": "Database", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Database name.", + "x-example": "My Database" + }, + "$createdAt": { + "type": "string", + "description": "Database creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Database update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "enabled": { + "type": "boolean", + "description": "If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + } + }, + "required": [ + "$id", + "name", + "$createdAt", + "$updatedAt", + "enabled" + ] + }, + "collection": { + "description": "Collection", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Collection creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Collection update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Collection permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c16897e" + }, + "name": { + "type": "string", + "description": "Collection name.", + "x-example": "My Collection" + }, + "enabled": { + "type": "boolean", + "description": "Collection enabled. Can be 'enabled' or 'disabled'. When disabled, the collection is inaccessible to users, but remains accessible to Server SDKs using API keys.", + "x-example": false + }, + "documentSecurity": { + "type": "boolean", + "description": "Whether document-level permissions are enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "attributes": { + "type": "array", + "description": "Collection attributes.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/attributeBoolean" + }, + { + "$ref": "#\/definitions\/attributeInteger" + }, + { + "$ref": "#\/definitions\/attributeFloat" + }, + { + "$ref": "#\/definitions\/attributeEmail" + }, + { + "$ref": "#\/definitions\/attributeEnum" + }, + { + "$ref": "#\/definitions\/attributeUrl" + }, + { + "$ref": "#\/definitions\/attributeIp" + }, + { + "$ref": "#\/definitions\/attributeDatetime" + }, + { + "$ref": "#\/definitions\/attributeRelationship" + }, + { + "$ref": "#\/definitions\/attributeString" + } + ] + }, + "x-example": {} + }, + "indexes": { + "type": "array", + "description": "Collection indexes.", + "items": { + "type": "object", + "$ref": "#\/definitions\/index" + }, + "x-example": {} + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "databaseId", + "name", + "enabled", + "documentSecurity", + "attributes", + "indexes" + ] + }, + "attributeList": { + "description": "Attributes List", + "type": "object", + "properties": { + "total": { + "type": "integer", + "description": "Total number of attributes in the given collection.", + "x-example": 5, + "format": "int32" + }, + "attributes": { + "type": "array", + "description": "List of attributes.", + "items": { + "x-anyOf": [ + { + "$ref": "#\/definitions\/attributeBoolean" + }, + { + "$ref": "#\/definitions\/attributeInteger" + }, + { + "$ref": "#\/definitions\/attributeFloat" + }, + { + "$ref": "#\/definitions\/attributeEmail" + }, + { + "$ref": "#\/definitions\/attributeEnum" + }, + { + "$ref": "#\/definitions\/attributeUrl" + }, + { + "$ref": "#\/definitions\/attributeIp" + }, + { + "$ref": "#\/definitions\/attributeDatetime" + }, + { + "$ref": "#\/definitions\/attributeRelationship" + }, + { + "$ref": "#\/definitions\/attributeString" + } + ] + }, + "x-example": "" + } + }, + "required": [ + "total", + "attributes" + ] + }, + "attributeString": { + "description": "AttributeString", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "size": { + "type": "integer", + "description": "Attribute size.", + "x-example": 128, + "format": "int32" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default", + "x-nullable": true + }, + "encrypt": { + "type": "boolean", + "description": "Defines whether this attribute is encrypted or not.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "size" + ] + }, + "attributeInteger": { + "description": "AttributeInteger", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "count" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "integer" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "integer", + "description": "Minimum value to enforce for new documents.", + "x-example": 1, + "format": "int32", + "x-nullable": true + }, + "max": { + "type": "integer", + "description": "Maximum value to enforce for new documents.", + "x-example": 10, + "format": "int32", + "x-nullable": true + }, + "default": { + "type": "integer", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 10, + "format": "int32", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ] + }, + "attributeFloat": { + "description": "AttributeFloat", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "percentageCompleted" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "double" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "min": { + "type": "number", + "description": "Minimum value to enforce for new documents.", + "x-example": 1.5, + "format": "double", + "x-nullable": true + }, + "max": { + "type": "number", + "description": "Maximum value to enforce for new documents.", + "x-example": 10.5, + "format": "double", + "x-nullable": true + }, + "default": { + "type": "number", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": 2.5, + "format": "double", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ] + }, + "attributeBoolean": { + "description": "AttributeBoolean", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "isEnabled" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "boolean" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "default": { + "type": "boolean", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": false, + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt" + ] + }, + "attributeEmail": { + "description": "AttributeEmail", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "userEmail" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "email" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "default@example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeEnum": { + "description": "AttributeEnum", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "status" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "elements": { + "type": "array", + "description": "Array of elements in enumerated type.", + "items": { + "type": "string" + }, + "x-example": "element" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "enum" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "element", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "elements", + "format" + ] + }, + "attributeIp": { + "description": "AttributeIP", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "ipAddress" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "ip" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "192.0.2.0", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeUrl": { + "description": "AttributeURL", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "githubUrl" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "String format.", + "x-example": "url" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Cannot be set when attribute is required.", + "x-example": "http:\/\/example.com", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeDatetime": { + "description": "AttributeDatetime", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "birthDay" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "datetime" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "format": { + "type": "string", + "description": "ISO 8601 format.", + "x-example": "datetime" + }, + "default": { + "type": "string", + "description": "Default value for attribute when not provided. Only null is optional", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "format" + ] + }, + "attributeRelationship": { + "description": "AttributeRelationship", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Attribute Key.", + "x-example": "fullName" + }, + "type": { + "type": "string", + "description": "Attribute type.", + "x-example": "string" + }, + "status": { + "type": "string", + "description": "Attribute status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an attribute.", + "x-example": "string" + }, + "required": { + "type": "boolean", + "description": "Is attribute required?", + "x-example": true + }, + "array": { + "type": "boolean", + "description": "Is attribute an array?", + "x-example": false, + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Attribute creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Attribute update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "relatedCollection": { + "type": "string", + "description": "The ID of the related collection.", + "x-example": "collection" + }, + "relationType": { + "type": "string", + "description": "The type of the relationship.", + "x-example": "oneToOne|oneToMany|manyToOne|manyToMany" + }, + "twoWay": { + "type": "boolean", + "description": "Is the relationship two-way?", + "x-example": false + }, + "twoWayKey": { + "type": "string", + "description": "The key of the two-way relationship.", + "x-example": "string" + }, + "onDelete": { + "type": "string", + "description": "How deleting the parent document will propagate to child documents.", + "x-example": "restrict|cascade|setNull" + }, + "side": { + "type": "string", + "description": "Whether this is the parent or child side of the relationship", + "x-example": "parent|child" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "required", + "$createdAt", + "$updatedAt", + "relatedCollection", + "relationType", + "twoWay", + "twoWayKey", + "onDelete", + "side" + ] + }, + "index": { + "description": "Index", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Index Key.", + "x-example": "index1" + }, + "type": { + "type": "string", + "description": "Index type.", + "x-example": "primary" + }, + "status": { + "type": "string", + "description": "Index status. Possible values: `available`, `processing`, `deleting`, `stuck`, or `failed`", + "x-example": "available" + }, + "error": { + "type": "string", + "description": "Error message. Displays error generated on failure of creating or deleting an index.", + "x-example": "string" + }, + "attributes": { + "type": "array", + "description": "Index attributes.", + "items": { + "type": "string" + }, + "x-example": [] + }, + "lengths": { + "type": "array", + "description": "Index attributes length.", + "items": { + "type": "integer", + "format": "int32" + }, + "x-example": [] + }, + "orders": { + "type": "array", + "description": "Index orders.", + "items": { + "type": "string" + }, + "x-example": [], + "x-nullable": true + }, + "$createdAt": { + "type": "string", + "description": "Index creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Index update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "key", + "type", + "status", + "error", + "attributes", + "lengths", + "$createdAt", + "$updatedAt" + ] + }, + "document": { + "description": "Document", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Document ID.", + "x-example": "5e5ea5c16897e" + }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, + "$collectionId": { + "type": "string", + "description": "Collection ID.", + "x-example": "5e5ea5c15117e" + }, + "$databaseId": { + "type": "string", + "description": "Database ID.", + "x-example": "5e5ea5c15117e" + }, + "$createdAt": { + "type": "string", + "description": "Document creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Document update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Document permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + } + }, + "additionalProperties": true, + "required": [ + "$id", + "$sequence", + "$collectionId", + "$databaseId", + "$createdAt", + "$updatedAt", + "$permissions" + ] + }, + "log": { + "description": "Log", + "type": "object", + "properties": { + "event": { + "type": "string", + "description": "Event name.", + "x-example": "account.sessions.create" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "610fc2f985ee0" + }, + "userEmail": { + "type": "string", + "description": "User Email.", + "x-example": "john@appwrite.io" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "John Doe" + }, + "mode": { + "type": "string", + "description": "API mode when event triggered.", + "x-example": "admin" + }, + "ip": { + "type": "string", + "description": "IP session in use when the session was created.", + "x-example": "127.0.0.1" + }, + "time": { + "type": "string", + "description": "Log creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "event", + "userId", + "userEmail", + "userName", + "mode", + "ip", + "time", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName" + ] + }, + "user": { + "description": "User", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "User creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "User update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "User name.", + "x-example": "John Doe" + }, + "password": { + "type": "string", + "description": "Hashed user password.", + "x-example": "$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L\/4LdgrVRXxE", + "x-nullable": true + }, + "hash": { + "type": "string", + "description": "Password hashing algorithm.", + "x-example": "argon2", + "x-nullable": true + }, + "hashOptions": { + "type": "object", + "description": "Password hashing algorithm configuration.", + "x-example": {}, + "items": { + "x-oneOf": [ + { + "$ref": "#\/definitions\/algoArgon2" + }, + { + "$ref": "#\/definitions\/algoScrypt" + }, + { + "$ref": "#\/definitions\/algoScryptModified" + }, + { + "$ref": "#\/definitions\/algoBcrypt" + }, + { + "$ref": "#\/definitions\/algoPhpass" + }, + { + "$ref": "#\/definitions\/algoSha" + }, + { + "$ref": "#\/definitions\/algoMd5" + } + ] + }, + "x-nullable": true + }, + "registration": { + "type": "string", + "description": "User registration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "status": { + "type": "boolean", + "description": "User status. Pass `true` for enabled and `false` for disabled.", + "x-example": true + }, + "labels": { + "type": "array", + "description": "Labels for the user.", + "items": { + "type": "string" + }, + "x-example": [ + "vip" + ] + }, + "passwordUpdate": { + "type": "string", + "description": "Password update time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "email": { + "type": "string", + "description": "User email address.", + "x-example": "john@appwrite.io" + }, + "phone": { + "type": "string", + "description": "User phone number in E.164 format.", + "x-example": "+4930901820" + }, + "emailVerification": { + "type": "boolean", + "description": "Email verification status.", + "x-example": true + }, + "phoneVerification": { + "type": "boolean", + "description": "Phone verification status.", + "x-example": true + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status.", + "x-example": true + }, + "prefs": { + "type": "object", + "description": "User preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/preferences" + } + }, + "targets": { + "type": "array", + "description": "A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.", + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + }, + "x-example": [] + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "registration", + "status", + "labels", + "passwordUpdate", + "email", + "phone", + "emailVerification", + "phoneVerification", + "mfa", + "prefs", + "targets", + "accessedAt" + ] + }, + "algoMd5": { + "description": "AlgoMD5", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "md5" + } + }, + "required": [ + "type" + ] + }, + "algoSha": { + "description": "AlgoSHA", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "sha" + } + }, + "required": [ + "type" + ] + }, + "algoPhpass": { + "description": "AlgoPHPass", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "phpass" + } + }, + "required": [ + "type" + ] + }, + "algoBcrypt": { + "description": "AlgoBcrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "bcrypt" + } + }, + "required": [ + "type" + ] + }, + "algoScrypt": { + "description": "AlgoScrypt", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scrypt" + }, + "costCpu": { + "type": "integer", + "description": "CPU complexity of computed hash.", + "x-example": 8, + "format": "int32" + }, + "costMemory": { + "type": "integer", + "description": "Memory complexity of computed hash.", + "x-example": 14, + "format": "int32" + }, + "costParallel": { + "type": "integer", + "description": "Parallelization of computed hash.", + "x-example": 1, + "format": "int32" + }, + "length": { + "type": "integer", + "description": "Length used to compute hash.", + "x-example": 64, + "format": "int32" + } + }, + "required": [ + "type", + "costCpu", + "costMemory", + "costParallel", + "length" + ] + }, + "algoScryptModified": { + "description": "AlgoScryptModified", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "scryptMod" + }, + "salt": { + "type": "string", + "description": "Salt used to compute hash.", + "x-example": "UxLMreBr6tYyjQ==" + }, + "saltSeparator": { + "type": "string", + "description": "Separator used to compute hash.", + "x-example": "Bw==" + }, + "signerKey": { + "type": "string", + "description": "Key used to compute hash.", + "x-example": "XyEKE9RcTDeLEsL\/RjwPDBv\/RqDl8fb3gpYEOQaPihbxf1ZAtSOHCjuAAa7Q3oHpCYhXSN9tizHgVOwn6krflQ==" + } + }, + "required": [ + "type", + "salt", + "saltSeparator", + "signerKey" + ] + }, + "algoArgon2": { + "description": "AlgoArgon2", + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Algo type.", + "x-example": "argon2" + }, + "memoryCost": { + "type": "integer", + "description": "Memory used to compute hash.", + "x-example": 65536, + "format": "int32" + }, + "timeCost": { + "type": "integer", + "description": "Amount of time consumed to compute hash", + "x-example": 4, + "format": "int32" + }, + "threads": { + "type": "integer", + "description": "Number of threads used to compute hash.", + "x-example": 3, + "format": "int32" + } + }, + "required": [ + "type", + "memoryCost", + "timeCost", + "threads" + ] + }, + "preferences": { + "description": "Preferences", + "type": "object", + "additionalProperties": true + }, + "session": { + "description": "Session", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Session ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Session creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Session update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "expire": { + "type": "string", + "description": "Session expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "provider": { + "type": "string", + "description": "Session Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "Session Provider User ID.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Session Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Session Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "ip": { + "type": "string", + "description": "IP in use when the session was created.", + "x-example": "127.0.0.1" + }, + "osCode": { + "type": "string", + "description": "Operating system code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/os.json).", + "x-example": "Mac" + }, + "osName": { + "type": "string", + "description": "Operating system name.", + "x-example": "Mac" + }, + "osVersion": { + "type": "string", + "description": "Operating system version.", + "x-example": "Mac" + }, + "clientType": { + "type": "string", + "description": "Client type.", + "x-example": "browser" + }, + "clientCode": { + "type": "string", + "description": "Client code name. View list of [available options](https:\/\/github.com\/appwrite\/appwrite\/blob\/master\/docs\/lists\/clients.json).", + "x-example": "CM" + }, + "clientName": { + "type": "string", + "description": "Client name.", + "x-example": "Chrome Mobile iOS" + }, + "clientVersion": { + "type": "string", + "description": "Client version.", + "x-example": "84.0" + }, + "clientEngine": { + "type": "string", + "description": "Client engine name.", + "x-example": "WebKit" + }, + "clientEngineVersion": { + "type": "string", + "description": "Client engine name.", + "x-example": "605.1.15" + }, + "deviceName": { + "type": "string", + "description": "Device name.", + "x-example": "smartphone" + }, + "deviceBrand": { + "type": "string", + "description": "Device brand name.", + "x-example": "Google" + }, + "deviceModel": { + "type": "string", + "description": "Device model name.", + "x-example": "Nexus 5" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "current": { + "type": "boolean", + "description": "Returns true if this the current user session.", + "x-example": true + }, + "factors": { + "type": "array", + "description": "Returns a list of active session factors.", + "items": { + "type": "string" + }, + "x-example": [ + "email" + ] + }, + "secret": { + "type": "string", + "description": "Secret used to authenticate the user. Only included if the request was made with an API key", + "x-example": "5e5bb8c16897e" + }, + "mfaUpdatedAt": { + "type": "string", + "description": "Most recent date in ISO 8601 format when the session successfully passed MFA challenge.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "expire", + "provider", + "providerUid", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken", + "ip", + "osCode", + "osName", + "osVersion", + "clientType", + "clientCode", + "clientName", + "clientVersion", + "clientEngine", + "clientEngineVersion", + "deviceName", + "deviceBrand", + "deviceModel", + "countryCode", + "countryName", + "current", + "factors", + "secret", + "mfaUpdatedAt" + ] + }, + "identity": { + "description": "Identity", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Identity ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Identity creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Identity update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5bb8c16897e" + }, + "provider": { + "type": "string", + "description": "Identity Provider.", + "x-example": "email" + }, + "providerUid": { + "type": "string", + "description": "ID of the User in the Identity Provider.", + "x-example": "5e5bb8c16897e" + }, + "providerEmail": { + "type": "string", + "description": "Email of the User in the Identity Provider.", + "x-example": "user@example.com" + }, + "providerAccessToken": { + "type": "string", + "description": "Identity Provider Access Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + }, + "providerAccessTokenExpiry": { + "type": "string", + "description": "The date of when the access token expires in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerRefreshToken": { + "type": "string", + "description": "Identity Provider Refresh Token.", + "x-example": "MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "provider", + "providerUid", + "providerEmail", + "providerAccessToken", + "providerAccessTokenExpiry", + "providerRefreshToken" + ] + }, + "token": { + "description": "Token", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "secret": { + "type": "string", + "description": "Token secret key. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "phrase": { + "type": "string", + "description": "Security phrase of a token. Empty if security phrase was not requested when creating a token. It includes randomly generated phrase which is also sent in the external resource such as email.", + "x-example": "Golden Fox" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "secret", + "expire", + "phrase" + ] + }, + "jwt": { + "description": "JWT", + "type": "object", + "properties": { + "jwt": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + } + }, + "required": [ + "jwt" + ] + }, + "locale": { + "description": "Locale", + "type": "object", + "properties": { + "ip": { + "type": "string", + "description": "User IP address.", + "x-example": "127.0.0.1" + }, + "countryCode": { + "type": "string", + "description": "Country code in [ISO 3166-1](http:\/\/en.wikipedia.org\/wiki\/ISO_3166-1) two-character format", + "x-example": "US" + }, + "country": { + "type": "string", + "description": "Country name. This field support localization.", + "x-example": "United States" + }, + "continentCode": { + "type": "string", + "description": "Continent code. A two character continent code \"AF\" for Africa, \"AN\" for Antarctica, \"AS\" for Asia, \"EU\" for Europe, \"NA\" for North America, \"OC\" for Oceania, and \"SA\" for South America.", + "x-example": "NA" + }, + "continent": { + "type": "string", + "description": "Continent name. This field support localization.", + "x-example": "North America" + }, + "eu": { + "type": "boolean", + "description": "True if country is part of the European Union.", + "x-example": false + }, + "currency": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format", + "x-example": "USD" + } + }, + "required": [ + "ip", + "countryCode", + "country", + "continentCode", + "continent", + "eu", + "currency" + ] + }, + "localeCode": { + "description": "LocaleCode", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Locale codes in [ISO 639-1](https:\/\/en.wikipedia.org\/wiki\/List_of_ISO_639-1_codes)", + "x-example": "en-us" + }, + "name": { + "type": "string", + "description": "Locale name", + "x-example": "US" + } + }, + "required": [ + "code", + "name" + ] + }, + "file": { + "description": "File", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "File ID.", + "x-example": "5e5ea5c16897e" + }, + "bucketId": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "File creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "File update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "File permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "name": { + "type": "string", + "description": "File name.", + "x-example": "Pink.png" + }, + "signature": { + "type": "string", + "description": "File MD5 signature.", + "x-example": "5d529fd02b544198ae075bd57c1762bb" + }, + "mimeType": { + "type": "string", + "description": "File mime type.", + "x-example": "image\/png" + }, + "sizeOriginal": { + "type": "integer", + "description": "File original size in bytes.", + "x-example": 17890, + "format": "int32" + }, + "chunksTotal": { + "type": "integer", + "description": "Total number of chunks available", + "x-example": 17890, + "format": "int32" + }, + "chunksUploaded": { + "type": "integer", + "description": "Total number of chunks uploaded", + "x-example": 17890, + "format": "int32" + } + }, + "required": [ + "$id", + "bucketId", + "$createdAt", + "$updatedAt", + "$permissions", + "name", + "signature", + "mimeType", + "sizeOriginal", + "chunksTotal", + "chunksUploaded" + ] + }, + "bucket": { + "description": "Bucket", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Bucket ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Bucket creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Bucket update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Bucket permissions. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "items": { + "type": "string" + }, + "x-example": [ + "read(\"any\")" + ] + }, + "fileSecurity": { + "type": "boolean", + "description": "Whether file-level security is enabled. [Learn more about permissions](https:\/\/appwrite.io\/docs\/permissions).", + "x-example": true + }, + "name": { + "type": "string", + "description": "Bucket name.", + "x-example": "Documents" + }, + "enabled": { + "type": "boolean", + "description": "Bucket enabled.", + "x-example": false + }, + "maximumFileSize": { + "type": "integer", + "description": "Maximum file size supported.", + "x-example": 100, + "format": "int32" + }, + "allowedFileExtensions": { + "type": "array", + "description": "Allowed file extensions.", + "items": { + "type": "string" + }, + "x-example": [ + "jpg", + "png" + ] + }, + "compression": { + "type": "string", + "description": "Compression algorithm choosen for compression. Will be one of none, [gzip](https:\/\/en.wikipedia.org\/wiki\/Gzip), or [zstd](https:\/\/en.wikipedia.org\/wiki\/Zstd).", + "x-example": "gzip" + }, + "encryption": { + "type": "boolean", + "description": "Bucket is encrypted.", + "x-example": false + }, + "antivirus": { + "type": "boolean", + "description": "Virus scanning is enabled.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "fileSecurity", + "name", + "enabled", + "maximumFileSize", + "allowedFileExtensions", + "compression", + "encryption", + "antivirus" + ] + }, + "resourceToken": { + "description": "ResourceToken", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea5c168bb8:5e5ea5c168bb8" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "files" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "secret": { + "type": "string", + "description": "JWT encoded string.", + "x-example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" + }, + "accessedAt": { + "type": "string", + "description": "Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "resourceId", + "resourceType", + "expire", + "secret", + "accessedAt" + ] + }, + "team": { + "description": "Team", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Team creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Team update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "total": { + "type": "integer", + "description": "Total number of team members.", + "x-example": 7, + "format": "int32" + }, + "prefs": { + "type": "object", + "description": "Team preferences as a key-value object", + "x-example": { + "theme": "pink", + "timezone": "UTC" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/preferences" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "total", + "prefs" + ] + }, + "membership": { + "description": "Membership", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Membership ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Membership creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Membership update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User name. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "John Doe" + }, + "userEmail": { + "type": "string", + "description": "User email address. Hide this attribute by toggling membership privacy in the Console.", + "x-example": "john@appwrite.io" + }, + "teamId": { + "type": "string", + "description": "Team ID.", + "x-example": "5e5ea5c16897e" + }, + "teamName": { + "type": "string", + "description": "Team name.", + "x-example": "VIP" + }, + "invited": { + "type": "string", + "description": "Date, the user has been invited to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "joined": { + "type": "string", + "description": "Date, the user has accepted the invitation to join the team in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "confirm": { + "type": "boolean", + "description": "User confirmation status, true if the user has joined the team or false otherwise.", + "x-example": false + }, + "mfa": { + "type": "boolean", + "description": "Multi factor authentication status, true if the user has MFA enabled or false otherwise. Hide this attribute by toggling membership privacy in the Console.", + "x-example": false + }, + "roles": { + "type": "array", + "description": "User list of roles", + "items": { + "type": "string" + }, + "x-example": [ + "owner" + ] + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "userId", + "userName", + "userEmail", + "teamId", + "teamName", + "invited", + "joined", + "confirm", + "mfa", + "roles" + ] + }, + "site": { + "description": "Site", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Site ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Site creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Site update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Site name.", + "x-example": "My Site" + }, + "enabled": { + "type": "boolean", + "description": "Site enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.", + "x-example": false + }, + "framework": { + "type": "string", + "description": "Site framework.", + "x-example": "react" + }, + "deploymentId": { + "type": "string", + "description": "Site's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "deploymentScreenshotLight": { + "type": "string", + "description": "Screenshot of active deployment with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentScreenshotDark": { + "type": "string", + "description": "Screenshot of active deployment with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentId": { + "type": "string", + "description": "Site's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "vars": { + "type": "array", + "description": "Site variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/variable" + }, + "x-example": [] + }, + "timeout": { + "type": "integer", + "description": "Site request timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "installCommand": { + "type": "string", + "description": "The install command used to install the site dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "The build command used to build the site.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "The directory where the site build output is located.", + "x-example": "build" + }, + "installationId": { + "type": "string", + "description": "Site VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to site in VCS (Version Control System) repository", + "x-example": "sites\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + }, + "buildRuntime": { + "type": "string", + "description": "Site build runtime.", + "x-example": "node-22" + }, + "adapter": { + "type": "string", + "description": "Site framework adapter.", + "x-example": "static" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "enabled", + "live", + "logging", + "framework", + "deploymentId", + "deploymentCreatedAt", + "deploymentScreenshotLight", + "deploymentScreenshotDark", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "vars", + "timeout", + "installCommand", + "buildCommand", + "outputDirectory", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification", + "buildRuntime", + "adapter", + "fallbackFile" + ] + }, + "function": { + "description": "Function", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Function creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Function update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "execute": { + "type": "array", + "description": "Execution permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + }, + "name": { + "type": "string", + "description": "Function name.", + "x-example": "My Function" + }, + "enabled": { + "type": "boolean", + "description": "Function enabled.", + "x-example": false + }, + "live": { + "type": "boolean", + "description": "Is the function deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the function to update it with the latest configuration.", + "x-example": false + }, + "logging": { + "type": "boolean", + "description": "When disabled, executions will exclude logs and errors, and will be slightly faster.", + "x-example": false + }, + "runtime": { + "type": "string", + "description": "Function execution and build runtime.", + "x-example": "python-3.8" + }, + "deploymentId": { + "type": "string", + "description": "Function's active deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "deploymentCreatedAt": { + "type": "string", + "description": "Active deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentId": { + "type": "string", + "description": "Function's latest deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "latestDeploymentCreatedAt": { + "type": "string", + "description": "Latest deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "latestDeploymentStatus": { + "type": "string", + "description": "Status of latest deployment. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "scopes": { + "type": "array", + "description": "Allowed permission scopes.", + "items": { + "type": "string" + }, + "x-example": "users.read" + }, + "vars": { + "type": "array", + "description": "Function variables.", + "items": { + "type": "object", + "$ref": "#\/definitions\/variable" + }, + "x-example": [] + }, + "events": { + "type": "array", + "description": "Function trigger events.", + "items": { + "type": "string" + }, + "x-example": "account.create" + }, + "schedule": { + "type": "string", + "description": "Function execution schedule in CRON format.", + "x-example": "5 4 * * *" + }, + "timeout": { + "type": "integer", + "description": "Function execution timeout in seconds.", + "x-example": 300, + "format": "int32" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file used to execute the deployment.", + "x-example": "index.js" + }, + "commands": { + "type": "string", + "description": "The build command used to build the deployment.", + "x-example": "npm install" + }, + "version": { + "type": "string", + "description": "Version of Open Runtimes used for the function.", + "x-example": "v2" + }, + "installationId": { + "type": "string", + "description": "Function VCS (Version Control System) installation id.", + "x-example": "6m40at4ejk5h2u9s1hboo" + }, + "providerRepositoryId": { + "type": "string", + "description": "VCS (Version Control System) Repository ID", + "x-example": "appwrite" + }, + "providerBranch": { + "type": "string", + "description": "VCS (Version Control System) branch name", + "x-example": "main" + }, + "providerRootDirectory": { + "type": "string", + "description": "Path to function in VCS (Version Control System) repository", + "x-example": "functions\/helloWorld" + }, + "providerSilentMode": { + "type": "boolean", + "description": "Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests", + "x-example": false + }, + "specification": { + "type": "string", + "description": "Machine specification for builds and executions.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "execute", + "name", + "enabled", + "live", + "logging", + "runtime", + "deploymentId", + "deploymentCreatedAt", + "latestDeploymentId", + "latestDeploymentCreatedAt", + "latestDeploymentStatus", + "scopes", + "vars", + "events", + "schedule", + "timeout", + "entrypoint", + "commands", + "version", + "installationId", + "providerRepositoryId", + "providerBranch", + "providerRootDirectory", + "providerSilentMode", + "specification" + ] + }, + "runtime": { + "description": "Runtime", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Runtime ID.", + "x-example": "python-3.8" + }, + "key": { + "type": "string", + "description": "Parent runtime key.", + "x-example": "python" + }, + "name": { + "type": "string", + "description": "Runtime Name.", + "x-example": "Python" + }, + "version": { + "type": "string", + "description": "Runtime version.", + "x-example": "3.8" + }, + "base": { + "type": "string", + "description": "Base Docker image used to build the runtime.", + "x-example": "python:3.8-alpine" + }, + "image": { + "type": "string", + "description": "Image name of Docker Hub.", + "x-example": "appwrite\\\/runtime-for-python:3.8" + }, + "logo": { + "type": "string", + "description": "Name of the logo image.", + "x-example": "python.png" + }, + "supports": { + "type": "array", + "description": "List of supported architectures.", + "items": { + "type": "string" + }, + "x-example": "amd64" + } + }, + "required": [ + "$id", + "key", + "name", + "version", + "base", + "image", + "logo", + "supports" + ] + }, + "framework": { + "description": "Framework", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Framework key.", + "x-example": "sveltekit" + }, + "name": { + "type": "string", + "description": "Framework Name.", + "x-example": "SvelteKit" + }, + "buildRuntime": { + "type": "string", + "description": "Default runtime version.", + "x-example": "node-22" + }, + "runtimes": { + "type": "array", + "description": "List of supported runtime versions.", + "items": { + "type": "string" + }, + "x-example": [ + "static-1", + "node-22" + ] + }, + "adapters": { + "type": "array", + "description": "List of supported adapters.", + "items": { + "type": "object", + "$ref": "#\/definitions\/frameworkAdapter" + }, + "x-example": [ + { + "key": "static", + "buildRuntime": "node-22", + "buildCommand": "npm run build", + "installCommand": "npm install", + "outputDirectory": ".\/dist" + } + ] + } + }, + "required": [ + "key", + "name", + "buildRuntime", + "runtimes", + "adapters" + ] + }, + "frameworkAdapter": { + "description": "Framework Adapter", + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Adapter key.", + "x-example": "static" + }, + "installCommand": { + "type": "string", + "description": "Default command to download dependencies.", + "x-example": "npm install" + }, + "buildCommand": { + "type": "string", + "description": "Default command to build site into output directory.", + "x-example": "npm run build" + }, + "outputDirectory": { + "type": "string", + "description": "Default output directory of build.", + "x-example": ".\/dist" + }, + "fallbackFile": { + "type": "string", + "description": "Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.", + "x-example": "index.html" + } + }, + "required": [ + "key", + "installCommand", + "buildCommand", + "outputDirectory", + "fallbackFile" + ] + }, + "deployment": { + "description": "Deployment", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Deployment ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Deployment creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Deployment update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "type": { + "type": "string", + "description": "Type of deployment.", + "x-example": "vcs" + }, + "resourceId": { + "type": "string", + "description": "Resource ID.", + "x-example": "5e5ea6g16897e" + }, + "resourceType": { + "type": "string", + "description": "Resource type.", + "x-example": "functions" + }, + "entrypoint": { + "type": "string", + "description": "The entrypoint file to use to execute the deployment code.", + "x-example": "index.js" + }, + "sourceSize": { + "type": "integer", + "description": "The code size in bytes.", + "x-example": 128, + "format": "int32" + }, + "buildSize": { + "type": "integer", + "description": "The build output size in bytes.", + "x-example": 128, + "format": "int32" + }, + "totalSize": { + "type": "integer", + "description": "The total size in bytes (source and build output).", + "x-example": 128, + "format": "int32" + }, + "buildId": { + "type": "string", + "description": "The current build ID.", + "x-example": "5e5ea5c16897e" + }, + "activate": { + "type": "boolean", + "description": "Whether the deployment should be automatically activated.", + "x-example": true + }, + "screenshotLight": { + "type": "string", + "description": "Screenshot with light theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "screenshotDark": { + "type": "string", + "description": "Screenshot with dark theme preference file ID.", + "x-example": "5e5ea5c16897e" + }, + "status": { + "type": "string", + "description": "The deployment status. Possible values are \"waiting\", \"processing\", \"building\", \"ready\", and \"failed\".", + "x-example": "ready" + }, + "buildLogs": { + "type": "string", + "description": "The build logs.", + "x-example": "Compiling source files..." + }, + "buildDuration": { + "type": "integer", + "description": "The current build time in seconds.", + "x-example": 128, + "format": "int32" + }, + "providerRepositoryName": { + "type": "string", + "description": "The name of the vcs provider repository", + "x-example": "database" + }, + "providerRepositoryOwner": { + "type": "string", + "description": "The name of the vcs provider repository owner", + "x-example": "utopia" + }, + "providerRepositoryUrl": { + "type": "string", + "description": "The url of the vcs provider repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function" + }, + "providerBranch": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "0.7.x" + }, + "providerCommitHash": { + "type": "string", + "description": "The commit hash of the vcs commit", + "x-example": "7c3f25d" + }, + "providerCommitAuthorUrl": { + "type": "string", + "description": "The url of vcs commit author", + "x-example": "https:\/\/github.com\/vermakhushboo" + }, + "providerCommitAuthor": { + "type": "string", + "description": "The name of vcs commit author", + "x-example": "Khushboo Verma" + }, + "providerCommitMessage": { + "type": "string", + "description": "The commit message", + "x-example": "Update index.js" + }, + "providerCommitUrl": { + "type": "string", + "description": "The url of the vcs commit", + "x-example": "https:\/\/github.com\/vermakhushboo\/g4-node-function\/commit\/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb" + }, + "providerBranchUrl": { + "type": "string", + "description": "The branch of the vcs repository", + "x-example": "https:\/\/github.com\/vermakhushboo\/appwrite\/tree\/0.7.x" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "type", + "resourceId", + "resourceType", + "entrypoint", + "sourceSize", + "buildSize", + "totalSize", + "buildId", + "activate", + "screenshotLight", + "screenshotDark", + "status", + "buildLogs", + "buildDuration", + "providerRepositoryName", + "providerRepositoryOwner", + "providerRepositoryUrl", + "providerBranch", + "providerCommitHash", + "providerCommitAuthorUrl", + "providerCommitAuthor", + "providerCommitMessage", + "providerCommitUrl", + "providerBranchUrl" + ] + }, + "execution": { + "description": "Execution", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Execution ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Execution creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Execution upate date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$permissions": { + "type": "array", + "description": "Execution roles.", + "items": { + "type": "string" + }, + "x-example": [ + "any" + ] + }, + "functionId": { + "type": "string", + "description": "Function ID.", + "x-example": "5e5ea6g16897e" + }, + "trigger": { + "type": "string", + "description": "The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.", + "x-example": "http" + }, + "status": { + "type": "string", + "description": "The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`.", + "x-example": "processing" + }, + "requestMethod": { + "type": "string", + "description": "HTTP request method type.", + "x-example": "GET" + }, + "requestPath": { + "type": "string", + "description": "HTTP request path and query.", + "x-example": "\/articles?id=5" + }, + "requestHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "type": "object", + "$ref": "#\/definitions\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "responseStatusCode": { + "type": "integer", + "description": "HTTP response status code.", + "x-example": 200, + "format": "int32" + }, + "responseBody": { + "type": "string", + "description": "HTTP response body. This will return empty unless execution is created as synchronous.", + "x-example": "" + }, + "responseHeaders": { + "type": "array", + "description": "HTTP response headers as a key-value object. This will return only whitelisted headers. All headers are returned if execution is created as synchronous.", + "items": { + "type": "object", + "$ref": "#\/definitions\/headers" + }, + "x-example": [ + { + "Content-Type": "application\/json" + } + ] + }, + "logs": { + "type": "string", + "description": "Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "errors": { + "type": "string", + "description": "Function errors. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.", + "x-example": "" + }, + "duration": { + "type": "number", + "description": "Resource(function\/site) execution duration in seconds.", + "x-example": 0.4, + "format": "double" + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for execution. If left empty, execution will be queued immediately.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "$permissions", + "functionId", + "trigger", + "status", + "requestMethod", + "requestPath", + "requestHeaders", + "responseStatusCode", + "responseBody", + "responseHeaders", + "logs", + "errors", + "duration" + ] + }, + "variable": { + "description": "Variable", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Variable ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Variable creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "key": { + "type": "string", + "description": "Variable key.", + "x-example": "API_KEY" + }, + "value": { + "type": "string", + "description": "Variable value.", + "x-example": "myPa$$word1" + }, + "secret": { + "type": "boolean", + "description": "Variable secret flag. Secret variables can only be updated or deleted, but never read.", + "x-example": false + }, + "resourceType": { + "type": "string", + "description": "Service to which the variable belongs. Possible values are \"project\", \"function\"", + "x-example": "function" + }, + "resourceId": { + "type": "string", + "description": "ID of resource to which the variable belongs. If resourceType is \"project\", it is empty. If resourceType is \"function\", it is ID of the function.", + "x-example": "myAwesomeFunction" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "key", + "value", + "secret", + "resourceType", + "resourceId" + ] + }, + "country": { + "description": "Country", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + }, + "code": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + } + }, + "required": [ + "name", + "code" + ] + }, + "continent": { + "description": "Continent", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Continent name.", + "x-example": "Europe" + }, + "code": { + "type": "string", + "description": "Continent two letter code.", + "x-example": "EU" + } + }, + "required": [ + "name", + "code" + ] + }, + "language": { + "description": "Language", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Language name.", + "x-example": "Italian" + }, + "code": { + "type": "string", + "description": "Language two-character ISO 639-1 codes.", + "x-example": "it" + }, + "nativeName": { + "type": "string", + "description": "Language native name.", + "x-example": "Italiano" + } + }, + "required": [ + "name", + "code", + "nativeName" + ] + }, + "currency": { + "description": "Currency", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "Currency symbol.", + "x-example": "$" + }, + "name": { + "type": "string", + "description": "Currency name.", + "x-example": "US dollar" + }, + "symbolNative": { + "type": "string", + "description": "Currency native symbol.", + "x-example": "$" + }, + "decimalDigits": { + "type": "integer", + "description": "Number of decimal digits.", + "x-example": 2, + "format": "int32" + }, + "rounding": { + "type": "number", + "description": "Currency digit rounding.", + "x-example": 0, + "format": "double" + }, + "code": { + "type": "string", + "description": "Currency code in [ISO 4217-1](http:\/\/en.wikipedia.org\/wiki\/ISO_4217) three-character format.", + "x-example": "USD" + }, + "namePlural": { + "type": "string", + "description": "Currency plural name", + "x-example": "US dollars" + } + }, + "required": [ + "symbol", + "name", + "symbolNative", + "decimalDigits", + "rounding", + "code", + "namePlural" + ] + }, + "phone": { + "description": "Phone", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Phone code.", + "x-example": "+1" + }, + "countryCode": { + "type": "string", + "description": "Country two-character ISO 3166-1 alpha code.", + "x-example": "US" + }, + "countryName": { + "type": "string", + "description": "Country name.", + "x-example": "United States" + } + }, + "required": [ + "code", + "countryCode", + "countryName" + ] + }, + "healthAntivirus": { + "description": "Health Antivirus", + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Antivirus version.", + "x-example": "1.0.0" + }, + "status": { + "type": "string", + "description": "Antivirus status. Possible values can are: `disabled`, `offline`, `online`", + "x-example": "online" + } + }, + "required": [ + "version", + "status" + ] + }, + "healthQueue": { + "description": "Health Queue", + "type": "object", + "properties": { + "size": { + "type": "integer", + "description": "Amount of actions in the queue.", + "x-example": 8, + "format": "int32" + } + }, + "required": [ + "size" + ] + }, + "healthStatus": { + "description": "Health Status", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the service.", + "x-example": "database" + }, + "ping": { + "type": "integer", + "description": "Duration in milliseconds how long the health check took.", + "x-example": 128, + "format": "int32" + }, + "status": { + "type": "string", + "description": "Service status. Possible values can are: `pass`, `fail`", + "x-example": "pass" + } + }, + "required": [ + "name", + "ping", + "status" + ] + }, + "healthCertificate": { + "description": "Health Certificate", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Certificate name", + "x-example": "\/CN=www.google.com" + }, + "subjectSN": { + "type": "string", + "description": "Subject SN", + "x-example": "" + }, + "issuerOrganisation": { + "type": "string", + "description": "Issuer organisation", + "x-example": "" + }, + "validFrom": { + "type": "string", + "description": "Valid from", + "x-example": "1704200998" + }, + "validTo": { + "type": "string", + "description": "Valid to", + "x-example": "1711458597" + }, + "signatureTypeSN": { + "type": "string", + "description": "Signature type SN", + "x-example": "RSA-SHA256" + } + }, + "required": [ + "name", + "subjectSN", + "issuerOrganisation", + "validFrom", + "validTo", + "signatureTypeSN" + ] + }, + "healthTime": { + "description": "Health Time", + "type": "object", + "properties": { + "remoteTime": { + "type": "integer", + "description": "Current unix timestamp on trustful remote server.", + "x-example": 1639490751, + "format": "int32" + }, + "localTime": { + "type": "integer", + "description": "Current unix timestamp of local server where Appwrite runs.", + "x-example": 1639490844, + "format": "int32" + }, + "diff": { + "type": "integer", + "description": "Difference of unix remote and local timestamps in milliseconds.", + "x-example": 93, + "format": "int32" + } + }, + "required": [ + "remoteTime", + "localTime", + "diff" + ] + }, + "headers": { + "description": "Headers", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Header name.", + "x-example": "Content-Type" + }, + "value": { + "type": "string", + "description": "Header value.", + "x-example": "application\/json" + } + }, + "required": [ + "name", + "value" + ] + }, + "specification": { + "description": "Specification", + "type": "object", + "properties": { + "memory": { + "type": "integer", + "description": "Memory size in MB.", + "x-example": 512, + "format": "int32" + }, + "cpus": { + "type": "number", + "description": "Number of CPUs.", + "x-example": 1, + "format": "double" + }, + "enabled": { + "type": "boolean", + "description": "Is size enabled.", + "x-example": true + }, + "slug": { + "type": "string", + "description": "Size slug.", + "x-example": "s-1vcpu-512mb" + } + }, + "required": [ + "memory", + "cpus", + "enabled", + "slug" + ] + }, + "mfaChallenge": { + "description": "MFA Challenge", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Token ID.", + "x-example": "bb8ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Token creation date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "5e5ea5c168bb8" + }, + "expire": { + "type": "string", + "description": "Token expiration date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + } + }, + "required": [ + "$id", + "$createdAt", + "userId", + "expire" + ] + }, + "mfaRecoveryCodes": { + "description": "MFA Recovery Codes", + "type": "object", + "properties": { + "recoveryCodes": { + "type": "array", + "description": "Recovery codes.", + "items": { + "type": "string" + }, + "x-example": [ + "a3kf0-s0cl2", + "s0co1-as98s" + ] + } + }, + "required": [ + "recoveryCodes" + ] + }, + "mfaType": { + "description": "MFAType", + "type": "object", + "properties": { + "secret": { + "type": "string", + "description": "Secret token used for TOTP factor.", + "x-example": true + }, + "uri": { + "type": "string", + "description": "URI for authenticator apps.", + "x-example": true + } + }, + "required": [ + "secret", + "uri" + ] + }, + "mfaFactors": { + "description": "MFAFactors", + "type": "object", + "properties": { + "totp": { + "type": "boolean", + "description": "Can TOTP be used for MFA challenge for this account.", + "x-example": true + }, + "phone": { + "type": "boolean", + "description": "Can phone (SMS) be used for MFA challenge for this account.", + "x-example": true + }, + "email": { + "type": "boolean", + "description": "Can email be used for MFA challenge for this account.", + "x-example": true + }, + "recoveryCode": { + "type": "boolean", + "description": "Can recovery code be used for MFA challenge for this account.", + "x-example": true + } + }, + "required": [ + "totp", + "phone", + "email", + "recoveryCode" + ] + }, + "provider": { + "description": "Provider", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Provider ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Provider creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Provider update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name for the provider instance.", + "x-example": "Mailgun" + }, + "provider": { + "type": "string", + "description": "The name of the provider service.", + "x-example": "mailgun" + }, + "enabled": { + "type": "boolean", + "description": "Is provider enabled?", + "x-example": true + }, + "type": { + "type": "string", + "description": "Type of provider.", + "x-example": "sms" + }, + "credentials": { + "type": "object", + "additionalProperties": true, + "description": "Provider credentials.", + "x-example": { + "key": "123456789" + } + }, + "options": { + "type": "object", + "additionalProperties": true, + "description": "Provider options.", + "x-example": { + "from": "sender-email@mydomain" + } + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "provider", + "enabled", + "type", + "credentials" + ] + }, + "message": { + "description": "Message", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Message ID.", + "x-example": "5e5ea5c16897e" + }, + "$createdAt": { + "type": "string", + "description": "Message creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Message update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "providerType": { + "type": "string", + "description": "Message provider type.", + "x-example": "email" + }, + "topics": { + "type": "array", + "description": "Topic IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "users": { + "type": "array", + "description": "User IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "targets": { + "type": "array", + "description": "Target IDs set as recipients.", + "items": { + "type": "string" + }, + "x-example": [ + "5e5ea5c16897e" + ] + }, + "scheduledAt": { + "type": "string", + "description": "The scheduled time for message.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + }, + "deliveredAt": { + "type": "string", + "description": "The time when the message was delivered.", + "x-example": "2020-10-15T06:38:00.000+00:00", + "x-nullable": true + }, + "deliveryErrors": { + "type": "array", + "description": "Delivery errors if any.", + "items": { + "type": "string" + }, + "x-example": [ + "Failed to send message to target 5e5ea5c16897e: Credentials not valid." + ], + "x-nullable": true + }, + "deliveredTotal": { + "type": "integer", + "description": "Number of recipients the message was delivered to.", + "x-example": 1, + "format": "int32" + }, + "data": { + "type": "object", + "additionalProperties": true, + "description": "Data of the message.", + "x-example": { + "subject": "Welcome to Appwrite", + "content": "Hi there, welcome to Appwrite family." + } + }, + "status": { + "type": "string", + "description": "Status of delivery.", + "x-example": "Message status can be one of the following: draft, processing, scheduled, sent, or failed." + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "providerType", + "topics", + "users", + "targets", + "deliveredTotal", + "data", + "status" + ] + }, + "topic": { + "description": "Topic", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Topic creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Topic update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "The name of the topic.", + "x-example": "events" + }, + "emailTotal": { + "type": "integer", + "description": "Total count of email subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "smsTotal": { + "type": "integer", + "description": "Total count of SMS subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "pushTotal": { + "type": "integer", + "description": "Total count of push subscribers subscribed to the topic.", + "x-example": 100, + "format": "int32" + }, + "subscribe": { + "type": "array", + "description": "Subscribe permissions.", + "items": { + "type": "string" + }, + "x-example": "users" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "emailTotal", + "smsTotal", + "pushTotal", + "subscribe" + ] + }, + "subscriber": { + "description": "Subscriber", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Subscriber ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Subscriber creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Subscriber update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "targetId": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "target": { + "type": "object", + "description": "Target.", + "x-example": { + "$id": "259125845563242502", + "$createdAt": "2020-10-15T06:38:00.000+00:00", + "$updatedAt": "2020-10-15T06:38:00.000+00:00", + "providerType": "email", + "providerId": "259125845563242502", + "name": "ageon-app-email", + "identifier": "random-mail@email.org", + "userId": "5e5ea5c16897e" + }, + "items": { + "type": "object", + "$ref": "#\/definitions\/target" + } + }, + "userId": { + "type": "string", + "description": "Topic ID.", + "x-example": "5e5ea5c16897e" + }, + "userName": { + "type": "string", + "description": "User Name.", + "x-example": "Aegon Targaryen" + }, + "topicId": { + "type": "string", + "description": "Topic ID.", + "x-example": "259125845563242502" + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "targetId", + "target", + "userId", + "userName", + "topicId", + "providerType" + ] + }, + "target": { + "description": "Target", + "type": "object", + "properties": { + "$id": { + "type": "string", + "description": "Target ID.", + "x-example": "259125845563242502" + }, + "$createdAt": { + "type": "string", + "description": "Target creation time in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "$updatedAt": { + "type": "string", + "description": "Target update date in ISO 8601 format.", + "x-example": "2020-10-15T06:38:00.000+00:00" + }, + "name": { + "type": "string", + "description": "Target Name.", + "x-example": "Apple iPhone 12" + }, + "userId": { + "type": "string", + "description": "User ID.", + "x-example": "259125845563242502" + }, + "providerId": { + "type": "string", + "description": "Provider ID.", + "x-example": "259125845563242502", + "x-nullable": true + }, + "providerType": { + "type": "string", + "description": "The target provider type. Can be one of the following: `email`, `sms` or `push`.", + "x-example": "email" + }, + "identifier": { + "type": "string", + "description": "The target identifier.", + "x-example": "token" + }, + "expired": { + "type": "boolean", + "description": "Is the target expired.", + "x-example": false + } + }, + "required": [ + "$id", + "$createdAt", + "$updatedAt", + "name", + "userId", + "providerType", + "identifier", + "expired" + ] + } + }, + "externalDocs": { + "description": "Full API docs, specs and tutorials", + "url": "https:\/\/appwrite.io\/docs" + } +} \ No newline at end of file diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index d2bc6d2e7e..c3353e157f 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -3451,7 +3451,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3576,7 +3575,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3707,7 +3705,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3770,7 +3767,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4257,7 +4253,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4340,7 +4335,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4431,7 +4425,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4522,7 +4515,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4603,8 +4595,8 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", - "server", "server" ], "packaging": false, @@ -4612,6 +4604,7 @@ { "name": "createDocument", "auth": { + "Admin": [], "Session": [], "Key": [], "JWT": [] @@ -4636,29 +4629,6 @@ } ], "description": "Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." - }, - { - "name": "createDocuments", - "auth": { - "Key": [] - }, - "parameters": [ - "databaseId", - "collectionId", - "documents" - ], - "required": [ - "databaseId", - "collectionId", - "documents" - ], - "responses": [ - { - "code": 201, - "model": "#\/definitions\/documentList" - } - ], - "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nCreate new Documents. Before using this route, you should create a new collection resource using either a [server integration](https:\/\/appwrite.io\/docs\/server\/databases#databasesCreateCollection) API or directly from your database console." } ], "auth": { @@ -4766,7 +4736,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4856,7 +4825,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4961,7 +4929,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5046,7 +5013,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -5058,7 +5025,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5101,6 +5067,222 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, "\/functions\/{functionId}\/executions": { "get": { "summary": "List executions", @@ -5124,7 +5306,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -5136,7 +5318,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5198,7 +5379,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -5210,7 +5391,6 @@ "scope": "execution.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5315,7 +5495,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -5327,7 +5507,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5387,7 +5566,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -5399,8 +5578,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -5461,7 +5639,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 306, "cookies": false, "type": "graphql", "deprecated": false, @@ -5473,8 +5651,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -5533,7 +5710,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -5545,7 +5722,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5585,7 +5761,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -5597,7 +5773,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5637,7 +5812,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -5649,7 +5824,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5689,7 +5863,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -5701,7 +5875,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5741,7 +5914,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -5753,7 +5926,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5793,7 +5965,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -5805,7 +5977,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5845,7 +6016,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -5857,7 +6028,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5897,7 +6067,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -5909,7 +6079,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -5951,7 +6120,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -5964,8 +6133,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -6036,7 +6204,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -6049,8 +6217,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -6107,7 +6274,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -6119,7 +6286,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6190,7 +6356,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -6202,7 +6368,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6280,7 +6445,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -6292,7 +6457,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6350,7 +6514,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -6362,7 +6526,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6439,7 +6602,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -6451,7 +6614,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6509,7 +6671,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -6521,7 +6683,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6588,7 +6749,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -6600,7 +6761,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6752,7 +6912,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -6794,7 +6955,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -6806,7 +6967,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6873,7 +7033,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -6885,7 +7045,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -6948,7 +7107,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -6960,7 +7119,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7038,7 +7196,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -7050,7 +7208,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7100,7 +7257,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -7112,7 +7269,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7175,7 +7331,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -7187,7 +7343,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7237,7 +7392,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -7249,7 +7404,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7320,7 +7474,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -7332,7 +7486,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7433,7 +7586,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -7445,7 +7598,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7503,7 +7655,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -7515,7 +7667,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7589,7 +7740,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -7601,7 +7752,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7661,7 +7811,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -7755,7 +7905,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -7816,7 +7966,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -8308,6 +8458,12 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, "$collectionId": { "type": "string", "description": "Collection ID.", @@ -8342,6 +8498,7 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 249769e186..4fa839aa39 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -3466,7 +3466,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3591,7 +3590,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3722,7 +3720,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3785,7 +3782,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4272,7 +4268,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4355,7 +4350,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4446,7 +4440,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4527,7 +4520,7 @@ "x-appwrite": { "method": "chat", "group": "console", - "weight": 308, + "weight": 309, "cookies": false, "type": "", "deprecated": false, @@ -4590,7 +4583,7 @@ "x-appwrite": { "method": "getResource", "group": null, - "weight": 432, + "weight": 433, "cookies": false, "type": "", "deprecated": false, @@ -4661,7 +4654,7 @@ "x-appwrite": { "method": "variables", "group": "console", - "weight": 307, + "weight": 308, "cookies": false, "type": "", "deprecated": false, @@ -4863,7 +4856,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 119, + "weight": 121, "cookies": false, "type": "", "deprecated": false, @@ -8064,7 +8057,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8145,8 +8137,8 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", - "server", "server" ], "packaging": false, @@ -8154,6 +8146,7 @@ { "name": "createDocument", "auth": { + "Admin": [], "Session": [], "Key": [], "JWT": [] @@ -8182,6 +8175,7 @@ { "name": "createDocuments", "auth": { + "Admin": [], "Key": [] }, "parameters": [ @@ -8296,7 +8290,7 @@ "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -8307,6 +8301,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8346,13 +8341,16 @@ "documents": { "type": "array", "description": "Array of document data as JSON objects. May contain partial documents.", - "default": [], + "default": null, "x-example": null, "items": { "type": "object" } } - } + }, + "required": [ + "documents" + ] } } ] @@ -8369,7 +8367,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nUpdate all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -8381,7 +8379,7 @@ "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -8392,6 +8390,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8472,7 +8471,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -8483,6 +8482,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8569,7 +8569,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8659,7 +8658,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8764,7 +8762,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8849,7 +8846,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -8861,7 +8858,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8990,6 +8986,222 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -9440,7 +9652,7 @@ "x-appwrite": { "method": "getCollectionUsage", "group": null, - "weight": 121, + "weight": 123, "cookies": false, "type": "", "deprecated": false, @@ -9596,7 +9808,7 @@ "x-appwrite": { "method": "getDatabaseUsage", "group": null, - "weight": 120, + "weight": 122, "cookies": false, "type": "", "deprecated": false, @@ -9674,7 +9886,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -9746,7 +9958,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -9832,6 +10044,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9857,7 +10070,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9995,7 +10209,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -10044,7 +10258,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -10094,7 +10308,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 402, + "weight": 403, "cookies": false, "type": "", "deprecated": false, @@ -10188,7 +10402,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 401, + "weight": 402, "cookies": false, "type": "", "deprecated": false, @@ -10246,7 +10460,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 395, + "weight": 396, "cookies": false, "type": "", "deprecated": false, @@ -10316,7 +10530,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -10375,7 +10589,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -10463,6 +10677,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -10488,7 +10703,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -10620,7 +10836,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -10681,7 +10897,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -10758,7 +10974,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -10838,7 +11054,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 381, "cookies": false, "type": "upload", "deprecated": false, @@ -10930,7 +11146,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -11015,7 +11231,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -11121,7 +11337,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -11217,7 +11433,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -11279,7 +11495,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -11346,7 +11562,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 388, "cookies": false, "type": "location", "deprecated": false, @@ -11357,7 +11573,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "functions.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -11432,7 +11647,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -11499,7 +11714,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -11511,7 +11726,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -11573,7 +11787,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -11585,7 +11799,6 @@ "scope": "execution.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -11690,7 +11903,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -11702,7 +11915,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -11755,7 +11967,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -11822,7 +12034,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 394, + "weight": 395, "cookies": false, "type": "", "deprecated": false, @@ -11900,7 +12112,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -11959,7 +12171,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -12049,7 +12261,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -12116,7 +12328,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -12208,7 +12420,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -12277,7 +12489,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -12289,8 +12501,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -12351,7 +12562,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 306, "cookies": false, "type": "graphql", "deprecated": false, @@ -12363,8 +12574,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -12423,7 +12633,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -12472,7 +12682,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -12521,7 +12731,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -12570,7 +12780,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -12628,7 +12838,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -12677,7 +12887,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -12726,7 +12936,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -12786,7 +12996,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -12846,7 +13056,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -12915,7 +13125,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -12975,7 +13185,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -13059,7 +13269,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -13119,7 +13329,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -13179,7 +13389,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -13239,7 +13449,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -13299,7 +13509,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -13359,7 +13569,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -13419,7 +13629,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -13479,7 +13689,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -13539,7 +13749,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -13588,7 +13798,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -13637,7 +13847,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -13686,7 +13896,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -13698,7 +13908,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13738,7 +13947,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -13750,7 +13959,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13790,7 +13998,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -13802,7 +14010,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13842,7 +14049,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -13854,7 +14061,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13894,7 +14100,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -13906,7 +14112,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13946,7 +14151,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -13958,7 +14163,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -13998,7 +14202,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -14010,7 +14214,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -14050,7 +14253,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -14062,7 +14265,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -14102,7 +14304,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -14177,7 +14379,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -14335,7 +14537,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -14490,7 +14692,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -14685,7 +14887,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -14879,7 +15081,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -14997,7 +15199,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -15111,7 +15313,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -15166,7 +15368,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -15226,7 +15428,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -15298,7 +15500,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -15370,7 +15572,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -15445,7 +15647,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -15560,7 +15762,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -15673,7 +15875,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -15764,7 +15966,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -15853,7 +16055,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 323, "cookies": false, "type": "", "deprecated": false, @@ -15980,7 +16182,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -16105,7 +16307,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -16208,7 +16410,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -16309,7 +16511,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -16424,7 +16626,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -16537,7 +16739,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -16696,7 +16898,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -16852,7 +17054,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -16955,7 +17157,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -17056,7 +17258,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -17159,7 +17361,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -17260,7 +17462,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -17363,7 +17565,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -17464,7 +17666,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -17567,7 +17769,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -17666,7 +17868,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -17721,7 +17923,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -17781,7 +17983,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -17853,7 +18055,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -17925,7 +18127,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -17998,7 +18200,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -18086,7 +18288,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -18146,7 +18348,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -18225,7 +18427,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -18285,7 +18487,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -18357,7 +18559,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -18438,7 +18640,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -18451,8 +18653,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -18526,7 +18727,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -18589,7 +18790,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -18602,8 +18803,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -18660,7 +18860,7 @@ "x-appwrite": { "method": "list", "group": null, - "weight": 314, + "weight": 315, "cookies": false, "type": "", "deprecated": false, @@ -18733,7 +18933,7 @@ "x-appwrite": { "method": "createAppwriteMigration", "group": null, - "weight": 309, + "weight": 310, "cookies": false, "type": "", "deprecated": false, @@ -18825,7 +19025,7 @@ "x-appwrite": { "method": "getAppwriteReport", "group": null, - "weight": 316, + "weight": 317, "cookies": false, "type": "", "deprecated": false, @@ -18913,7 +19113,7 @@ "x-appwrite": { "method": "createCsvMigration", "group": null, - "weight": 313, + "weight": 314, "cookies": false, "type": "", "deprecated": false, @@ -18997,7 +19197,7 @@ "x-appwrite": { "method": "createFirebaseMigration", "group": null, - "weight": 310, + "weight": 311, "cookies": false, "type": "", "deprecated": false, @@ -19075,7 +19275,7 @@ "x-appwrite": { "method": "getFirebaseReport", "group": null, - "weight": 317, + "weight": 318, "cookies": false, "type": "", "deprecated": false, @@ -19146,7 +19346,7 @@ "x-appwrite": { "method": "createNHostMigration", "group": null, - "weight": 312, + "weight": 313, "cookies": false, "type": "", "deprecated": false, @@ -19265,7 +19465,7 @@ "x-appwrite": { "method": "getNHostReport", "group": null, - "weight": 319, + "weight": 320, "cookies": false, "type": "", "deprecated": false, @@ -19385,7 +19585,7 @@ "x-appwrite": { "method": "createSupabaseMigration", "group": null, - "weight": 311, + "weight": 312, "cookies": false, "type": "", "deprecated": false, @@ -19497,7 +19697,7 @@ "x-appwrite": { "method": "getSupabaseReport", "group": null, - "weight": 318, + "weight": 319, "cookies": false, "type": "", "deprecated": false, @@ -19608,7 +19808,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 315, + "weight": 316, "cookies": false, "type": "", "deprecated": false, @@ -19666,7 +19866,7 @@ "x-appwrite": { "method": "retry", "group": null, - "weight": 320, + "weight": 321, "cookies": false, "type": "", "deprecated": false, @@ -19719,7 +19919,7 @@ "x-appwrite": { "method": "delete", "group": null, - "weight": 321, + "weight": 322, "cookies": false, "type": "", "deprecated": false, @@ -19777,7 +19977,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 200, + "weight": 202, "cookies": false, "type": "", "deprecated": false, @@ -19859,7 +20059,7 @@ "x-appwrite": { "method": "listVariables", "group": null, - "weight": 202, + "weight": 204, "cookies": false, "type": "", "deprecated": false, @@ -19907,7 +20107,7 @@ "x-appwrite": { "method": "createVariable", "group": null, - "weight": 201, + "weight": 203, "cookies": false, "type": "", "deprecated": false, @@ -19988,7 +20188,7 @@ "x-appwrite": { "method": "getVariable", "group": null, - "weight": 203, + "weight": 205, "cookies": false, "type": "", "deprecated": false, @@ -20046,7 +20246,7 @@ "x-appwrite": { "method": "updateVariable", "group": null, - "weight": 204, + "weight": 206, "cookies": false, "type": "", "deprecated": false, @@ -20129,7 +20329,7 @@ "x-appwrite": { "method": "deleteVariable", "group": null, - "weight": 205, + "weight": 207, "cookies": false, "type": "", "deprecated": false, @@ -20187,7 +20387,7 @@ "x-appwrite": { "method": "list", "group": "projects", - "weight": 155, + "weight": 157, "cookies": false, "type": "", "deprecated": false, @@ -20258,7 +20458,7 @@ "x-appwrite": { "method": "create", "group": "projects", - "weight": 154, + "weight": 156, "cookies": false, "type": "", "deprecated": false, @@ -20405,7 +20605,7 @@ "x-appwrite": { "method": "get", "group": "projects", - "weight": 156, + "weight": 158, "cookies": false, "type": "", "deprecated": false, @@ -20463,7 +20663,7 @@ "x-appwrite": { "method": "update", "group": "projects", - "weight": 157, + "weight": 159, "cookies": false, "type": "", "deprecated": false, @@ -20588,7 +20788,7 @@ "x-appwrite": { "method": "delete", "group": "projects", - "weight": 174, + "weight": 176, "cookies": false, "type": "", "deprecated": false, @@ -20648,7 +20848,7 @@ "x-appwrite": { "method": "updateApiStatus", "group": "projects", - "weight": 161, + "weight": 163, "cookies": false, "type": "", "deprecated": false, @@ -20740,7 +20940,7 @@ "x-appwrite": { "method": "updateApiStatusAll", "group": "projects", - "weight": 162, + "weight": 164, "cookies": false, "type": "", "deprecated": false, @@ -20818,7 +21018,7 @@ "x-appwrite": { "method": "updateAuthDuration", "group": "auth", - "weight": 167, + "weight": 169, "cookies": false, "type": "", "deprecated": false, @@ -20896,7 +21096,7 @@ "x-appwrite": { "method": "updateAuthLimit", "group": "auth", - "weight": 166, + "weight": 168, "cookies": false, "type": "", "deprecated": false, @@ -20974,7 +21174,7 @@ "x-appwrite": { "method": "updateAuthSessionsLimit", "group": "auth", - "weight": 172, + "weight": 174, "cookies": false, "type": "", "deprecated": false, @@ -21052,7 +21252,7 @@ "x-appwrite": { "method": "updateMembershipsPrivacy", "group": "auth", - "weight": 165, + "weight": 167, "cookies": false, "type": "", "deprecated": false, @@ -21144,7 +21344,7 @@ "x-appwrite": { "method": "updateMockNumbers", "group": "auth", - "weight": 173, + "weight": 175, "cookies": false, "type": "", "deprecated": false, @@ -21225,7 +21425,7 @@ "x-appwrite": { "method": "updateAuthPasswordDictionary", "group": "auth", - "weight": 170, + "weight": 172, "cookies": false, "type": "", "deprecated": false, @@ -21303,7 +21503,7 @@ "x-appwrite": { "method": "updateAuthPasswordHistory", "group": "auth", - "weight": 169, + "weight": 171, "cookies": false, "type": "", "deprecated": false, @@ -21381,7 +21581,7 @@ "x-appwrite": { "method": "updatePersonalDataCheck", "group": "auth", - "weight": 171, + "weight": 173, "cookies": false, "type": "", "deprecated": false, @@ -21459,7 +21659,7 @@ "x-appwrite": { "method": "updateSessionAlerts", "group": "auth", - "weight": 164, + "weight": 166, "cookies": false, "type": "", "deprecated": false, @@ -21537,7 +21737,7 @@ "x-appwrite": { "method": "updateAuthStatus", "group": "auth", - "weight": 168, + "weight": 170, "cookies": false, "type": "", "deprecated": false, @@ -21632,7 +21832,7 @@ "x-appwrite": { "method": "listDevKeys", "group": "devKeys", - "weight": 371, + "weight": 372, "cookies": false, "type": "", "deprecated": false, @@ -21702,7 +21902,7 @@ "x-appwrite": { "method": "createDevKey", "group": "devKeys", - "weight": 368, + "weight": 369, "cookies": false, "type": "", "deprecated": false, @@ -21785,7 +21985,7 @@ "x-appwrite": { "method": "getDevKey", "group": "devKeys", - "weight": 370, + "weight": 371, "cookies": false, "type": "", "deprecated": false, @@ -21851,7 +22051,7 @@ "x-appwrite": { "method": "updateDevKey", "group": "devKeys", - "weight": 369, + "weight": 370, "cookies": false, "type": "", "deprecated": false, @@ -21937,7 +22137,7 @@ "x-appwrite": { "method": "deleteDevKey", "group": "devKeys", - "weight": 372, + "weight": 373, "cookies": false, "type": "", "deprecated": false, @@ -22005,7 +22205,7 @@ "x-appwrite": { "method": "createJWT", "group": "auth", - "weight": 186, + "weight": 188, "cookies": false, "type": "", "deprecated": false, @@ -22090,7 +22290,7 @@ "x-appwrite": { "method": "listKeys", "group": "keys", - "weight": 182, + "weight": 184, "cookies": false, "type": "", "deprecated": false, @@ -22148,7 +22348,7 @@ "x-appwrite": { "method": "createKey", "group": "keys", - "weight": 181, + "weight": 183, "cookies": false, "type": "", "deprecated": false, @@ -22240,7 +22440,7 @@ "x-appwrite": { "method": "getKey", "group": "keys", - "weight": 183, + "weight": 185, "cookies": false, "type": "", "deprecated": false, @@ -22306,7 +22506,7 @@ "x-appwrite": { "method": "updateKey", "group": "keys", - "weight": 184, + "weight": 186, "cookies": false, "type": "", "deprecated": false, @@ -22401,7 +22601,7 @@ "x-appwrite": { "method": "deleteKey", "group": "keys", - "weight": 185, + "weight": 187, "cookies": false, "type": "", "deprecated": false, @@ -22469,7 +22669,7 @@ "x-appwrite": { "method": "updateOAuth2", "group": "auth", - "weight": 163, + "weight": 165, "cookies": false, "type": "", "deprecated": false, @@ -22607,7 +22807,7 @@ "x-appwrite": { "method": "listPlatforms", "group": "platforms", - "weight": 188, + "weight": 190, "cookies": false, "type": "", "deprecated": false, @@ -22665,7 +22865,7 @@ "x-appwrite": { "method": "createPlatform", "group": "platforms", - "weight": 187, + "weight": 189, "cookies": false, "type": "", "deprecated": false, @@ -22785,7 +22985,7 @@ "x-appwrite": { "method": "getPlatform", "group": "platforms", - "weight": 189, + "weight": 191, "cookies": false, "type": "", "deprecated": false, @@ -22851,7 +23051,7 @@ "x-appwrite": { "method": "updatePlatform", "group": "platforms", - "weight": 190, + "weight": 192, "cookies": false, "type": "", "deprecated": false, @@ -22948,7 +23148,7 @@ "x-appwrite": { "method": "deletePlatform", "group": "platforms", - "weight": 191, + "weight": 193, "cookies": false, "type": "", "deprecated": false, @@ -23016,7 +23216,7 @@ "x-appwrite": { "method": "updateServiceStatus", "group": "projects", - "weight": 159, + "weight": 161, "cookies": false, "type": "", "deprecated": false, @@ -23117,7 +23317,7 @@ "x-appwrite": { "method": "updateServiceStatusAll", "group": "projects", - "weight": 160, + "weight": 162, "cookies": false, "type": "", "deprecated": false, @@ -23195,7 +23395,7 @@ "x-appwrite": { "method": "updateSmtp", "group": "templates", - "weight": 192, + "weight": 194, "cookies": false, "type": "", "deprecated": false, @@ -23324,7 +23524,7 @@ "x-appwrite": { "method": "createSmtpTest", "group": "templates", - "weight": 193, + "weight": 195, "cookies": false, "type": "", "deprecated": false, @@ -23462,7 +23662,7 @@ "x-appwrite": { "method": "updateTeam", "group": "projects", - "weight": 158, + "weight": 160, "cookies": false, "type": "", "deprecated": false, @@ -23538,7 +23738,7 @@ "x-appwrite": { "method": "getEmailTemplate", "group": "templates", - "weight": 195, + "weight": 197, "cookies": false, "type": "", "deprecated": false, @@ -23758,7 +23958,7 @@ "x-appwrite": { "method": "updateEmailTemplate", "group": "templates", - "weight": 197, + "weight": 199, "cookies": false, "type": "", "deprecated": false, @@ -24021,7 +24221,7 @@ "x-appwrite": { "method": "deleteEmailTemplate", "group": "templates", - "weight": 199, + "weight": 201, "cookies": false, "type": "", "deprecated": false, @@ -24241,7 +24441,7 @@ "x-appwrite": { "method": "getSmsTemplate", "group": "templates", - "weight": 194, + "weight": 196, "cookies": false, "type": "", "deprecated": false, @@ -24458,7 +24658,7 @@ "x-appwrite": { "method": "updateSmsTemplate", "group": "templates", - "weight": 196, + "weight": 198, "cookies": false, "type": "", "deprecated": false, @@ -24693,7 +24893,7 @@ "x-appwrite": { "method": "deleteSmsTemplate", "group": "templates", - "weight": 198, + "weight": 200, "cookies": false, "type": "", "deprecated": false, @@ -24910,7 +25110,7 @@ "x-appwrite": { "method": "listWebhooks", "group": "webhooks", - "weight": 176, + "weight": 178, "cookies": false, "type": "", "deprecated": false, @@ -24968,7 +25168,7 @@ "x-appwrite": { "method": "createWebhook", "group": "webhooks", - "weight": 175, + "weight": 177, "cookies": false, "type": "", "deprecated": false, @@ -25086,7 +25286,7 @@ "x-appwrite": { "method": "getWebhook", "group": "webhooks", - "weight": 177, + "weight": 179, "cookies": false, "type": "", "deprecated": false, @@ -25152,7 +25352,7 @@ "x-appwrite": { "method": "updateWebhook", "group": "webhooks", - "weight": 178, + "weight": 180, "cookies": false, "type": "", "deprecated": false, @@ -25273,7 +25473,7 @@ "x-appwrite": { "method": "deleteWebhook", "group": "webhooks", - "weight": 180, + "weight": 182, "cookies": false, "type": "", "deprecated": false, @@ -25341,7 +25541,7 @@ "x-appwrite": { "method": "updateWebhookSignature", "group": "webhooks", - "weight": 179, + "weight": 181, "cookies": false, "type": "", "deprecated": false, @@ -25407,7 +25607,7 @@ "x-appwrite": { "method": "listRules", "group": null, - "weight": 292, + "weight": 294, "cookies": false, "type": "", "deprecated": false, @@ -25480,7 +25680,7 @@ "x-appwrite": { "method": "createAPIRule", "group": null, - "weight": 433, + "weight": 434, "cookies": false, "type": "", "deprecated": false, @@ -25550,7 +25750,7 @@ "x-appwrite": { "method": "createFunctionRule", "group": null, - "weight": 435, + "weight": 436, "cookies": false, "type": "", "deprecated": false, @@ -25633,7 +25833,7 @@ "x-appwrite": { "method": "createRedirectRule", "group": null, - "weight": 436, + "weight": 437, "cookies": false, "type": "", "deprecated": false, @@ -25693,12 +25893,35 @@ "Temporary Redirect 307", "Permanent Redirect 308" ] + }, + "resourceId": { + "type": "string", + "description": "ID of parent resource.", + "default": null, + "x-example": "<RESOURCE_ID>" + }, + "resourceType": { + "type": "string", + "description": "Type of parent resource.", + "default": null, + "x-example": "site", + "enum": [ + "site", + "function" + ], + "x-enum-name": "ProxyResourceType", + "x-enum-keys": [ + "Site", + "Function" + ] } }, "required": [ "domain", "url", - "statusCode" + "statusCode", + "resourceId", + "resourceType" ] } } @@ -25730,7 +25953,7 @@ "x-appwrite": { "method": "createSiteRule", "group": null, - "weight": 434, + "weight": 435, "cookies": false, "type": "", "deprecated": false, @@ -25811,7 +26034,7 @@ "x-appwrite": { "method": "getRule", "group": null, - "weight": 293, + "weight": 295, "cookies": false, "type": "", "deprecated": false, @@ -25864,7 +26087,7 @@ "x-appwrite": { "method": "deleteRule", "group": null, - "weight": 294, + "weight": 296, "cookies": false, "type": "", "deprecated": false, @@ -25924,7 +26147,7 @@ "x-appwrite": { "method": "updateRuleVerification", "group": null, - "weight": 295, + "weight": 297, "cookies": false, "type": "", "deprecated": false, @@ -25982,7 +26205,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -26054,7 +26277,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -26200,6 +26423,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -26225,7 +26449,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26319,7 +26544,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -26368,7 +26593,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -26418,7 +26643,7 @@ "x-appwrite": { "method": "listTemplates", "group": "templates", - "weight": 427, + "weight": 428, "cookies": false, "type": "", "deprecated": false, @@ -26512,7 +26737,7 @@ "x-appwrite": { "method": "getTemplate", "group": "templates", - "weight": 428, + "weight": 429, "cookies": false, "type": "", "deprecated": false, @@ -26570,7 +26795,7 @@ "x-appwrite": { "method": "listUsage", "group": null, - "weight": 429, + "weight": 430, "cookies": false, "type": "", "deprecated": false, @@ -26640,7 +26865,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -26699,7 +26924,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -26847,6 +27072,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -26872,7 +27098,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -26959,7 +27186,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -27020,7 +27247,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -27097,7 +27324,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -27177,7 +27404,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 410, "cookies": false, "type": "upload", "deprecated": false, @@ -27277,7 +27504,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -27356,7 +27583,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -27462,7 +27689,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -27559,7 +27786,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -27621,7 +27848,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -27688,7 +27915,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 417, "cookies": false, "type": "location", "deprecated": false, @@ -27699,7 +27926,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "sites.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -27774,7 +28000,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -27841,7 +28067,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -27912,7 +28138,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -27976,7 +28202,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -28043,7 +28269,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 430, + "weight": 431, "cookies": false, "type": "", "deprecated": false, @@ -28121,7 +28347,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -28180,7 +28406,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -28270,7 +28496,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -28337,7 +28563,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -28429,7 +28655,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -28496,7 +28722,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -28568,7 +28794,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -28705,7 +28931,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -28764,7 +28990,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -28897,7 +29123,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 212, "cookies": false, "type": "", "deprecated": false, @@ -28956,7 +29182,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -28968,7 +29194,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29039,7 +29264,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -29051,7 +29276,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29129,7 +29353,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -29141,7 +29365,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29199,7 +29422,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -29211,7 +29434,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29288,7 +29510,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -29300,7 +29522,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29358,7 +29579,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -29370,7 +29591,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29437,7 +29657,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -29449,7 +29669,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29601,7 +29820,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -29643,7 +29863,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -29655,7 +29875,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29722,7 +29941,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 220, + "weight": 222, "cookies": false, "type": "", "deprecated": false, @@ -29792,7 +30011,7 @@ "x-appwrite": { "method": "getBucketUsage", "group": null, - "weight": 221, + "weight": 223, "cookies": false, "type": "", "deprecated": false, @@ -29870,7 +30089,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -29882,7 +30101,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -29945,7 +30163,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -29957,7 +30175,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30035,7 +30252,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -30047,7 +30264,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30097,7 +30313,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -30109,7 +30325,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30172,7 +30387,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -30184,7 +30399,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30234,7 +30448,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 235, + "weight": 237, "cookies": false, "type": "", "deprecated": false, @@ -30304,7 +30518,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -30316,7 +30530,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30387,7 +30600,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -30399,7 +30612,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30500,7 +30712,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -30512,7 +30724,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30570,7 +30781,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -30582,7 +30793,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30656,7 +30866,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -30668,7 +30878,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -30728,7 +30937,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -30821,7 +31030,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -30881,7 +31090,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -30959,7 +31168,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 440, "cookies": false, "type": "", "deprecated": false, @@ -31039,7 +31248,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 438, "cookies": false, "type": "", "deprecated": false, @@ -31123,7 +31332,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 439, "cookies": false, "type": "", "deprecated": false, @@ -31183,7 +31392,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 441, "cookies": false, "type": "", "deprecated": false, @@ -31254,7 +31463,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 442, "cookies": false, "type": "", "deprecated": false, @@ -31314,7 +31523,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -31386,7 +31595,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -31481,7 +31690,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -31572,7 +31781,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -31661,7 +31870,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -31730,7 +31939,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -31791,7 +32000,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -31882,7 +32091,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -31973,7 +32182,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -32099,7 +32308,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -32211,7 +32420,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -32321,7 +32530,7 @@ "x-appwrite": { "method": "getUsage", "group": null, - "weight": 278, + "weight": 280, "cookies": false, "type": "", "deprecated": false, @@ -32391,7 +32600,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -32445,7 +32654,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -32506,7 +32715,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -32585,7 +32794,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -32667,7 +32876,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -32747,7 +32956,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -32818,7 +33027,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -32900,7 +33109,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -32974,7 +33183,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -33046,7 +33255,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -33105,7 +33314,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -33164,7 +33373,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -33223,7 +33432,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -33284,7 +33493,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -33363,7 +33572,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -33442,7 +33651,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -33519,7 +33728,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -33578,7 +33787,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -33655,7 +33864,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -33714,7 +33923,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -33768,7 +33977,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -33824,7 +34033,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -33893,7 +34102,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -33970,7 +34179,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -34006,7 +34215,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "type": "array", "collectionFormat": "multi", @@ -34042,7 +34251,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -34153,7 +34362,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -34221,7 +34430,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -34311,7 +34520,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, @@ -34381,7 +34590,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -34463,7 +34672,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -34542,7 +34751,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -34621,7 +34830,7 @@ "x-appwrite": { "method": "createRepositoryDetection", "group": "repositories", - "weight": 282, + "weight": 284, "cookies": false, "type": "", "deprecated": false, @@ -34716,7 +34925,7 @@ "x-appwrite": { "method": "listRepositories", "group": "repositories", - "weight": 283, + "weight": 285, "cookies": false, "type": "", "deprecated": false, @@ -34797,7 +35006,7 @@ "x-appwrite": { "method": "createRepository", "group": "repositories", - "weight": 284, + "weight": 286, "cookies": false, "type": "", "deprecated": false, @@ -34880,7 +35089,7 @@ "x-appwrite": { "method": "getRepository", "group": "repositories", - "weight": 285, + "weight": 287, "cookies": false, "type": "", "deprecated": false, @@ -34946,7 +35155,7 @@ "x-appwrite": { "method": "listRepositoryBranches", "group": "repositories", - "weight": 286, + "weight": 288, "cookies": false, "type": "", "deprecated": false, @@ -35000,7 +35209,7 @@ "tags": [ "vcs" ], - "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.\n", + "description": "Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.", "responses": { "200": { "description": "VCS Content List", @@ -35012,7 +35221,7 @@ "x-appwrite": { "method": "getRepositoryContents", "group": "repositories", - "weight": 281, + "weight": 283, "cookies": false, "type": "", "deprecated": false, @@ -35060,6 +35269,15 @@ "x-example": "<PROVIDER_ROOT_DIRECTORY>", "default": "", "in": "query" + }, + { + "name": "providerReference", + "description": "Git reference (branch, tag, commit) to get contents from", + "required": false, + "type": "string", + "x-example": "<PROVIDER_REFERENCE>", + "default": "", + "in": "query" } ] } @@ -35086,7 +35304,7 @@ "x-appwrite": { "method": "updateExternalDeployments", "group": "repositories", - "weight": 291, + "weight": 293, "cookies": false, "type": "", "deprecated": false, @@ -35170,7 +35388,7 @@ "x-appwrite": { "method": "listInstallations", "group": "installations", - "weight": 288, + "weight": 290, "cookies": false, "type": "", "deprecated": false, @@ -35241,7 +35459,7 @@ "x-appwrite": { "method": "getInstallation", "group": "installations", - "weight": 289, + "weight": 291, "cookies": false, "type": "", "deprecated": false, @@ -35294,7 +35512,7 @@ "x-appwrite": { "method": "deleteInstallation", "group": "installations", - "weight": 290, + "weight": 292, "cookies": false, "type": "", "deprecated": false, @@ -37573,6 +37791,12 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, "$collectionId": { "type": "string", "description": "Collection ID.", @@ -37607,6 +37831,7 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 2bce9b4d7d..5dc7b6d925 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -3142,7 +3142,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3269,7 +3268,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3402,7 +3400,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3467,7 +3464,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -3956,7 +3952,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4041,7 +4036,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -4134,7 +4128,6 @@ "scope": "avatars.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7533,7 +7526,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -7616,8 +7608,8 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "client", - "server", "server" ], "packaging": false, @@ -7625,6 +7617,7 @@ { "name": "createDocument", "auth": { + "Admin": [], "Session": [], "Key": [], "JWT": [] @@ -7653,6 +7646,7 @@ { "name": "createDocuments", "auth": { + "Admin": [], "Key": [] }, "parameters": [ @@ -7769,7 +7763,7 @@ "x-appwrite": { "method": "upsertDocuments", "group": "documents", - "weight": 116, + "weight": 118, "cookies": false, "type": "", "deprecated": false, @@ -7780,6 +7774,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -7820,13 +7815,16 @@ "documents": { "type": "array", "description": "Array of document data as JSON objects. May contain partial documents.", - "default": [], + "default": null, "x-example": null, "items": { "type": "object" } } - } + }, + "required": [ + "documents" + ] } } ] @@ -7843,7 +7841,7 @@ "tags": [ "databases" ], - "description": "Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", + "description": "**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.\n\nUpdate all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.", "responses": { "200": { "description": "Documents List", @@ -7855,7 +7853,7 @@ "x-appwrite": { "method": "updateDocuments", "group": "documents", - "weight": 115, + "weight": 117, "cookies": false, "type": "", "deprecated": false, @@ -7866,6 +7864,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -7947,7 +7946,7 @@ "x-appwrite": { "method": "deleteDocuments", "group": "documents", - "weight": 118, + "weight": 120, "cookies": false, "type": "", "deprecated": false, @@ -7958,6 +7957,7 @@ "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", "scope": "documents.write", "platforms": [ + "console", "server" ], "packaging": false, @@ -8045,7 +8045,6 @@ "scope": "documents.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8137,7 +8136,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8244,7 +8242,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8331,7 +8328,7 @@ "x-appwrite": { "method": "deleteDocument", "group": "documents", - "weight": 117, + "weight": 119, "cookies": false, "type": "", "deprecated": false, @@ -8343,7 +8340,6 @@ "scope": "documents.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -8388,6 +8384,226 @@ ] } }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/decrement": { + "patch": { + "summary": "Decrement document attribute", + "operationId": "databasesDecrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Decrement a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "decrementDocumentAttribute", + "group": "documents", + "weight": 116, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/decrement-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/decrement-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to decrement the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "min": { + "type": "number", + "description": "Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, + "\/databases\/{databaseId}\/collections\/{collectionId}\/documents\/{documentId}\/{attribute}\/increment": { + "patch": { + "summary": "Increment document attribute", + "operationId": "databasesIncrementDocumentAttribute", + "consumes": [ + "application\/json" + ], + "produces": [ + "application\/json" + ], + "tags": [ + "databases" + ], + "description": "Increment a specific attribute of a document by a given value.", + "responses": { + "200": { + "description": "Document", + "schema": { + "$ref": "#\/definitions\/document" + } + } + }, + "x-appwrite": { + "method": "incrementDocumentAttribute", + "group": "documents", + "weight": 115, + "cookies": false, + "type": "", + "deprecated": false, + "demo": "databases\/increment-document-attribute.md", + "edit": "https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/databases\/increment-document-attribute.md", + "rate-limit": 120, + "rate-time": 60, + "rate-key": "ip:{ip},method:{method},url:{url},userId:{userId}", + "scope": "documents.write", + "platforms": [ + "console", + "server", + "client" + ], + "packaging": false, + "auth": { + "Project": [], + "Key": [] + } + }, + "security": [ + { + "Project": [], + "Key": [], + "Session": [], + "JWT": [] + } + ], + "parameters": [ + { + "name": "databaseId", + "description": "Database ID.", + "required": true, + "type": "string", + "x-example": "<DATABASE_ID>", + "in": "path" + }, + { + "name": "collectionId", + "description": "Collection ID.", + "required": true, + "type": "string", + "x-example": "<COLLECTION_ID>", + "in": "path" + }, + { + "name": "documentId", + "description": "Document ID.", + "required": true, + "type": "string", + "x-example": "<DOCUMENT_ID>", + "in": "path" + }, + { + "name": "attribute", + "description": "Attribute key.", + "required": true, + "type": "string", + "in": "path" + }, + { + "name": "payload", + "in": "body", + "schema": { + "type": "object", + "properties": { + "value": { + "type": "number", + "description": "Value to increment the attribute by. The value must be a number.", + "default": 1, + "x-example": null + }, + "max": { + "type": "number", + "description": "Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.", + "default": null, + "x-example": null + } + } + } + } + ] + } + }, "\/databases\/{databaseId}\/collections\/{collectionId}\/indexes": { "get": { "summary": "List indexes", @@ -8764,7 +8980,7 @@ "x-appwrite": { "method": "list", "group": "functions", - "weight": 376, + "weight": 377, "cookies": false, "type": "", "deprecated": false, @@ -8837,7 +9053,7 @@ "x-appwrite": { "method": "create", "group": "functions", - "weight": 373, + "weight": 374, "cookies": false, "type": "", "deprecated": false, @@ -8924,6 +9140,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -8949,7 +9166,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9087,7 +9305,7 @@ "x-appwrite": { "method": "listRuntimes", "group": "runtimes", - "weight": 378, + "weight": 379, "cookies": false, "type": "", "deprecated": false, @@ -9137,7 +9355,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "runtimes", - "weight": 379, + "weight": 380, "cookies": false, "type": "", "deprecated": false, @@ -9188,7 +9406,7 @@ "x-appwrite": { "method": "get", "group": "functions", - "weight": 374, + "weight": 375, "cookies": false, "type": "", "deprecated": false, @@ -9248,7 +9466,7 @@ "x-appwrite": { "method": "update", "group": "functions", - "weight": 375, + "weight": 376, "cookies": false, "type": "", "deprecated": false, @@ -9337,6 +9555,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -9362,7 +9581,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -9494,7 +9714,7 @@ "x-appwrite": { "method": "delete", "group": "functions", - "weight": 377, + "weight": 378, "cookies": false, "type": "", "deprecated": false, @@ -9556,7 +9776,7 @@ "x-appwrite": { "method": "updateFunctionDeployment", "group": "functions", - "weight": 382, + "weight": 383, "cookies": false, "type": "", "deprecated": false, @@ -9634,7 +9854,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 383, + "weight": 384, "cookies": false, "type": "", "deprecated": false, @@ -9715,7 +9935,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 380, + "weight": 381, "cookies": false, "type": "upload", "deprecated": false, @@ -9808,7 +10028,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 388, + "weight": 389, "cookies": false, "type": "", "deprecated": false, @@ -9894,7 +10114,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 385, + "weight": 386, "cookies": false, "type": "", "deprecated": false, @@ -10001,7 +10221,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 386, + "weight": 387, "cookies": false, "type": "", "deprecated": false, @@ -10098,7 +10318,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 381, + "weight": 382, "cookies": false, "type": "", "deprecated": false, @@ -10161,7 +10381,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 384, + "weight": 385, "cookies": false, "type": "", "deprecated": false, @@ -10229,7 +10449,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 387, + "weight": 388, "cookies": false, "type": "location", "deprecated": false, @@ -10240,7 +10460,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "functions.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -10316,7 +10535,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 389, + "weight": 390, "cookies": false, "type": "", "deprecated": false, @@ -10384,7 +10603,7 @@ "x-appwrite": { "method": "listExecutions", "group": "executions", - "weight": 392, + "weight": 393, "cookies": false, "type": "", "deprecated": false, @@ -10396,7 +10615,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -10460,7 +10678,7 @@ "x-appwrite": { "method": "createExecution", "group": "executions", - "weight": 390, + "weight": 391, "cookies": false, "type": "", "deprecated": false, @@ -10472,7 +10690,6 @@ "scope": "execution.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -10579,7 +10796,7 @@ "x-appwrite": { "method": "getExecution", "group": "executions", - "weight": 391, + "weight": 392, "cookies": false, "type": "", "deprecated": false, @@ -10591,7 +10808,6 @@ "scope": "execution.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -10646,7 +10862,7 @@ "x-appwrite": { "method": "deleteExecution", "group": "executions", - "weight": 393, + "weight": 394, "cookies": false, "type": "", "deprecated": false, @@ -10714,7 +10930,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 398, + "weight": 399, "cookies": false, "type": "", "deprecated": false, @@ -10774,7 +10990,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 396, + "weight": 397, "cookies": false, "type": "", "deprecated": false, @@ -10865,7 +11081,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 397, + "weight": 398, "cookies": false, "type": "", "deprecated": false, @@ -10933,7 +11149,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 399, + "weight": 400, "cookies": false, "type": "", "deprecated": false, @@ -11026,7 +11242,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 400, + "weight": 401, "cookies": false, "type": "", "deprecated": false, @@ -11096,7 +11312,7 @@ "x-appwrite": { "method": "query", "group": "graphql", - "weight": 306, + "weight": 307, "cookies": false, "type": "graphql", "deprecated": false, @@ -11108,8 +11324,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -11172,7 +11387,7 @@ "x-appwrite": { "method": "mutation", "group": "graphql", - "weight": 305, + "weight": 306, "cookies": false, "type": "graphql", "deprecated": false, @@ -11184,8 +11399,7 @@ "scope": "graphql", "platforms": [ "server", - "client", - "server" + "client" ], "packaging": false, "auth": { @@ -11246,7 +11460,7 @@ "x-appwrite": { "method": "get", "group": "health", - "weight": 130, + "weight": 132, "cookies": false, "type": "", "deprecated": false, @@ -11296,7 +11510,7 @@ "x-appwrite": { "method": "getAntivirus", "group": "health", - "weight": 151, + "weight": 153, "cookies": false, "type": "", "deprecated": false, @@ -11346,7 +11560,7 @@ "x-appwrite": { "method": "getCache", "group": "health", - "weight": 133, + "weight": 135, "cookies": false, "type": "", "deprecated": false, @@ -11396,7 +11610,7 @@ "x-appwrite": { "method": "getCertificate", "group": "health", - "weight": 138, + "weight": 140, "cookies": false, "type": "", "deprecated": false, @@ -11455,7 +11669,7 @@ "x-appwrite": { "method": "getDB", "group": "health", - "weight": 132, + "weight": 134, "cookies": false, "type": "", "deprecated": false, @@ -11505,7 +11719,7 @@ "x-appwrite": { "method": "getPubSub", "group": "health", - "weight": 134, + "weight": 136, "cookies": false, "type": "", "deprecated": false, @@ -11555,7 +11769,7 @@ "x-appwrite": { "method": "getQueueBuilds", "group": "queue", - "weight": 140, + "weight": 142, "cookies": false, "type": "", "deprecated": false, @@ -11616,7 +11830,7 @@ "x-appwrite": { "method": "getQueueCertificates", "group": "queue", - "weight": 139, + "weight": 141, "cookies": false, "type": "", "deprecated": false, @@ -11677,7 +11891,7 @@ "x-appwrite": { "method": "getQueueDatabases", "group": "queue", - "weight": 141, + "weight": 143, "cookies": false, "type": "", "deprecated": false, @@ -11747,7 +11961,7 @@ "x-appwrite": { "method": "getQueueDeletes", "group": "queue", - "weight": 142, + "weight": 144, "cookies": false, "type": "", "deprecated": false, @@ -11808,7 +12022,7 @@ "x-appwrite": { "method": "getFailedJobs", "group": "queue", - "weight": 152, + "weight": 154, "cookies": false, "type": "", "deprecated": false, @@ -11893,7 +12107,7 @@ "x-appwrite": { "method": "getQueueFunctions", "group": "queue", - "weight": 146, + "weight": 148, "cookies": false, "type": "", "deprecated": false, @@ -11954,7 +12168,7 @@ "x-appwrite": { "method": "getQueueLogs", "group": "queue", - "weight": 137, + "weight": 139, "cookies": false, "type": "", "deprecated": false, @@ -12015,7 +12229,7 @@ "x-appwrite": { "method": "getQueueMails", "group": "queue", - "weight": 143, + "weight": 145, "cookies": false, "type": "", "deprecated": false, @@ -12076,7 +12290,7 @@ "x-appwrite": { "method": "getQueueMessaging", "group": "queue", - "weight": 144, + "weight": 146, "cookies": false, "type": "", "deprecated": false, @@ -12137,7 +12351,7 @@ "x-appwrite": { "method": "getQueueMigrations", "group": "queue", - "weight": 145, + "weight": 147, "cookies": false, "type": "", "deprecated": false, @@ -12198,7 +12412,7 @@ "x-appwrite": { "method": "getQueueStatsResources", "group": "queue", - "weight": 147, + "weight": 149, "cookies": false, "type": "", "deprecated": false, @@ -12259,7 +12473,7 @@ "x-appwrite": { "method": "getQueueUsage", "group": "queue", - "weight": 148, + "weight": 150, "cookies": false, "type": "", "deprecated": false, @@ -12320,7 +12534,7 @@ "x-appwrite": { "method": "getQueueWebhooks", "group": "queue", - "weight": 136, + "weight": 138, "cookies": false, "type": "", "deprecated": false, @@ -12381,7 +12595,7 @@ "x-appwrite": { "method": "getStorage", "group": "storage", - "weight": 150, + "weight": 152, "cookies": false, "type": "", "deprecated": false, @@ -12431,7 +12645,7 @@ "x-appwrite": { "method": "getStorageLocal", "group": "storage", - "weight": 149, + "weight": 151, "cookies": false, "type": "", "deprecated": false, @@ -12481,7 +12695,7 @@ "x-appwrite": { "method": "getTime", "group": "health", - "weight": 135, + "weight": 137, "cookies": false, "type": "", "deprecated": false, @@ -12531,7 +12745,7 @@ "x-appwrite": { "method": "get", "group": null, - "weight": 122, + "weight": 124, "cookies": false, "type": "", "deprecated": false, @@ -12543,7 +12757,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12585,7 +12798,7 @@ "x-appwrite": { "method": "listCodes", "group": null, - "weight": 123, + "weight": 125, "cookies": false, "type": "", "deprecated": false, @@ -12597,7 +12810,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12639,7 +12851,7 @@ "x-appwrite": { "method": "listContinents", "group": null, - "weight": 127, + "weight": 129, "cookies": false, "type": "", "deprecated": false, @@ -12651,7 +12863,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12693,7 +12904,7 @@ "x-appwrite": { "method": "listCountries", "group": null, - "weight": 124, + "weight": 126, "cookies": false, "type": "", "deprecated": false, @@ -12705,7 +12916,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12747,7 +12957,7 @@ "x-appwrite": { "method": "listCountriesEU", "group": null, - "weight": 125, + "weight": 127, "cookies": false, "type": "", "deprecated": false, @@ -12759,7 +12969,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12801,7 +13010,7 @@ "x-appwrite": { "method": "listCountriesPhones", "group": null, - "weight": 126, + "weight": 128, "cookies": false, "type": "", "deprecated": false, @@ -12813,7 +13022,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12855,7 +13063,7 @@ "x-appwrite": { "method": "listCurrencies", "group": null, - "weight": 128, + "weight": 130, "cookies": false, "type": "", "deprecated": false, @@ -12867,7 +13075,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12909,7 +13116,7 @@ "x-appwrite": { "method": "listLanguages", "group": null, - "weight": 129, + "weight": 131, "cookies": false, "type": "", "deprecated": false, @@ -12921,7 +13128,6 @@ "scope": "locale.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -12963,7 +13169,7 @@ "x-appwrite": { "method": "listMessages", "group": "messages", - "weight": 360, + "weight": 361, "cookies": false, "type": "", "deprecated": false, @@ -13039,7 +13245,7 @@ "x-appwrite": { "method": "createEmail", "group": "messages", - "weight": 357, + "weight": 358, "cookies": false, "type": "", "deprecated": false, @@ -13198,7 +13404,7 @@ "x-appwrite": { "method": "updateEmail", "group": "messages", - "weight": 364, + "weight": 365, "cookies": false, "type": "", "deprecated": false, @@ -13354,7 +13560,7 @@ "x-appwrite": { "method": "createPush", "group": "messages", - "weight": 359, + "weight": 360, "cookies": false, "type": "", "deprecated": false, @@ -13550,7 +13756,7 @@ "x-appwrite": { "method": "updatePush", "group": "messages", - "weight": 366, + "weight": 367, "cookies": false, "type": "", "deprecated": false, @@ -13745,7 +13951,7 @@ "x-appwrite": { "method": "createSms", "group": "messages", - "weight": 358, + "weight": 359, "cookies": false, "type": "", "deprecated": false, @@ -13864,7 +14070,7 @@ "x-appwrite": { "method": "updateSms", "group": "messages", - "weight": 365, + "weight": 366, "cookies": false, "type": "", "deprecated": false, @@ -13979,7 +14185,7 @@ "x-appwrite": { "method": "getMessage", "group": "messages", - "weight": 363, + "weight": 364, "cookies": false, "type": "", "deprecated": false, @@ -14035,7 +14241,7 @@ "x-appwrite": { "method": "delete", "group": "messages", - "weight": 367, + "weight": 368, "cookies": false, "type": "", "deprecated": false, @@ -14096,7 +14302,7 @@ "x-appwrite": { "method": "listMessageLogs", "group": "logs", - "weight": 361, + "weight": 362, "cookies": false, "type": "", "deprecated": false, @@ -14169,7 +14375,7 @@ "x-appwrite": { "method": "listTargets", "group": "messages", - "weight": 362, + "weight": 363, "cookies": false, "type": "", "deprecated": false, @@ -14242,7 +14448,7 @@ "x-appwrite": { "method": "listProviders", "group": "providers", - "weight": 332, + "weight": 333, "cookies": false, "type": "", "deprecated": false, @@ -14318,7 +14524,7 @@ "x-appwrite": { "method": "createApnsProvider", "group": "providers", - "weight": 331, + "weight": 332, "cookies": false, "type": "", "deprecated": false, @@ -14434,7 +14640,7 @@ "x-appwrite": { "method": "updateApnsProvider", "group": "providers", - "weight": 344, + "weight": 345, "cookies": false, "type": "", "deprecated": false, @@ -14548,7 +14754,7 @@ "x-appwrite": { "method": "createFcmProvider", "group": "providers", - "weight": 330, + "weight": 331, "cookies": false, "type": "", "deprecated": false, @@ -14640,7 +14846,7 @@ "x-appwrite": { "method": "updateFcmProvider", "group": "providers", - "weight": 343, + "weight": 344, "cookies": false, "type": "", "deprecated": false, @@ -14730,7 +14936,7 @@ "x-appwrite": { "method": "createMailgunProvider", "group": "providers", - "weight": 322, + "weight": 323, "cookies": false, "type": "", "deprecated": false, @@ -14858,7 +15064,7 @@ "x-appwrite": { "method": "updateMailgunProvider", "group": "providers", - "weight": 335, + "weight": 336, "cookies": false, "type": "", "deprecated": false, @@ -14984,7 +15190,7 @@ "x-appwrite": { "method": "createMsg91Provider", "group": "providers", - "weight": 325, + "weight": 326, "cookies": false, "type": "", "deprecated": false, @@ -15088,7 +15294,7 @@ "x-appwrite": { "method": "updateMsg91Provider", "group": "providers", - "weight": 338, + "weight": 339, "cookies": false, "type": "", "deprecated": false, @@ -15190,7 +15396,7 @@ "x-appwrite": { "method": "createSendgridProvider", "group": "providers", - "weight": 323, + "weight": 324, "cookies": false, "type": "", "deprecated": false, @@ -15306,7 +15512,7 @@ "x-appwrite": { "method": "updateSendgridProvider", "group": "providers", - "weight": 336, + "weight": 337, "cookies": false, "type": "", "deprecated": false, @@ -15420,7 +15626,7 @@ "x-appwrite": { "method": "createSmtpProvider", "group": "providers", - "weight": 324, + "weight": 325, "cookies": false, "type": "", "deprecated": false, @@ -15580,7 +15786,7 @@ "x-appwrite": { "method": "updateSmtpProvider", "group": "providers", - "weight": 337, + "weight": 338, "cookies": false, "type": "", "deprecated": false, @@ -15737,7 +15943,7 @@ "x-appwrite": { "method": "createTelesignProvider", "group": "providers", - "weight": 326, + "weight": 327, "cookies": false, "type": "", "deprecated": false, @@ -15841,7 +16047,7 @@ "x-appwrite": { "method": "updateTelesignProvider", "group": "providers", - "weight": 339, + "weight": 340, "cookies": false, "type": "", "deprecated": false, @@ -15943,7 +16149,7 @@ "x-appwrite": { "method": "createTextmagicProvider", "group": "providers", - "weight": 327, + "weight": 328, "cookies": false, "type": "", "deprecated": false, @@ -16047,7 +16253,7 @@ "x-appwrite": { "method": "updateTextmagicProvider", "group": "providers", - "weight": 340, + "weight": 341, "cookies": false, "type": "", "deprecated": false, @@ -16149,7 +16355,7 @@ "x-appwrite": { "method": "createTwilioProvider", "group": "providers", - "weight": 328, + "weight": 329, "cookies": false, "type": "", "deprecated": false, @@ -16253,7 +16459,7 @@ "x-appwrite": { "method": "updateTwilioProvider", "group": "providers", - "weight": 341, + "weight": 342, "cookies": false, "type": "", "deprecated": false, @@ -16355,7 +16561,7 @@ "x-appwrite": { "method": "createVonageProvider", "group": "providers", - "weight": 329, + "weight": 330, "cookies": false, "type": "", "deprecated": false, @@ -16459,7 +16665,7 @@ "x-appwrite": { "method": "updateVonageProvider", "group": "providers", - "weight": 342, + "weight": 343, "cookies": false, "type": "", "deprecated": false, @@ -16559,7 +16765,7 @@ "x-appwrite": { "method": "getProvider", "group": "providers", - "weight": 334, + "weight": 335, "cookies": false, "type": "", "deprecated": false, @@ -16615,7 +16821,7 @@ "x-appwrite": { "method": "deleteProvider", "group": "providers", - "weight": 345, + "weight": 346, "cookies": false, "type": "", "deprecated": false, @@ -16676,7 +16882,7 @@ "x-appwrite": { "method": "listProviderLogs", "group": "providers", - "weight": 333, + "weight": 334, "cookies": false, "type": "", "deprecated": false, @@ -16749,7 +16955,7 @@ "x-appwrite": { "method": "listSubscriberLogs", "group": "subscribers", - "weight": 354, + "weight": 355, "cookies": false, "type": "", "deprecated": false, @@ -16822,7 +17028,7 @@ "x-appwrite": { "method": "listTopics", "group": "topics", - "weight": 347, + "weight": 348, "cookies": false, "type": "", "deprecated": false, @@ -16896,7 +17102,7 @@ "x-appwrite": { "method": "createTopic", "group": "topics", - "weight": 346, + "weight": 347, "cookies": false, "type": "", "deprecated": false, @@ -16985,7 +17191,7 @@ "x-appwrite": { "method": "getTopic", "group": "topics", - "weight": 349, + "weight": 350, "cookies": false, "type": "", "deprecated": false, @@ -17046,7 +17252,7 @@ "x-appwrite": { "method": "updateTopic", "group": "topics", - "weight": 350, + "weight": 351, "cookies": false, "type": "", "deprecated": false, @@ -17126,7 +17332,7 @@ "x-appwrite": { "method": "deleteTopic", "group": "topics", - "weight": 351, + "weight": 352, "cookies": false, "type": "", "deprecated": false, @@ -17187,7 +17393,7 @@ "x-appwrite": { "method": "listTopicLogs", "group": "topics", - "weight": 348, + "weight": 349, "cookies": false, "type": "", "deprecated": false, @@ -17260,7 +17466,7 @@ "x-appwrite": { "method": "listSubscribers", "group": "subscribers", - "weight": 353, + "weight": 354, "cookies": false, "type": "", "deprecated": false, @@ -17342,7 +17548,7 @@ "x-appwrite": { "method": "createSubscriber", "group": "subscribers", - "weight": 352, + "weight": 353, "cookies": false, "type": "", "deprecated": false, @@ -17355,8 +17561,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -17432,7 +17637,7 @@ "x-appwrite": { "method": "getSubscriber", "group": "subscribers", - "weight": 355, + "weight": 356, "cookies": false, "type": "", "deprecated": false, @@ -17496,7 +17701,7 @@ "x-appwrite": { "method": "deleteSubscriber", "group": "subscribers", - "weight": 356, + "weight": 357, "cookies": false, "type": "", "deprecated": false, @@ -17509,8 +17714,7 @@ "platforms": [ "server", "client", - "console", - "server" + "console" ], "packaging": false, "auth": { @@ -17569,7 +17773,7 @@ "x-appwrite": { "method": "list", "group": "sites", - "weight": 405, + "weight": 406, "cookies": false, "type": "", "deprecated": false, @@ -17642,7 +17846,7 @@ "x-appwrite": { "method": "create", "group": "sites", - "weight": 403, + "weight": 404, "cookies": false, "type": "", "deprecated": false, @@ -17789,6 +17993,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -17814,7 +18019,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -17908,7 +18114,7 @@ "x-appwrite": { "method": "listFrameworks", "group": "frameworks", - "weight": 408, + "weight": 409, "cookies": false, "type": "", "deprecated": false, @@ -17958,7 +18164,7 @@ "x-appwrite": { "method": "listSpecifications", "group": "frameworks", - "weight": 431, + "weight": 432, "cookies": false, "type": "", "deprecated": false, @@ -18009,7 +18215,7 @@ "x-appwrite": { "method": "get", "group": "sites", - "weight": 404, + "weight": 405, "cookies": false, "type": "", "deprecated": false, @@ -18069,7 +18275,7 @@ "x-appwrite": { "method": "update", "group": "sites", - "weight": 406, + "weight": 407, "cookies": false, "type": "", "deprecated": false, @@ -18218,6 +18424,7 @@ "dart-3.1", "dart-3.3", "dart-3.5", + "dart-3.8", "dotnet-6.0", "dotnet-7.0", "dotnet-8.0", @@ -18243,7 +18450,8 @@ "static-1", "flutter-3.24", "flutter-3.27", - "flutter-3.29" + "flutter-3.29", + "flutter-3.32" ], "x-enum-name": null, "x-enum-keys": [] @@ -18330,7 +18538,7 @@ "x-appwrite": { "method": "delete", "group": "sites", - "weight": 407, + "weight": 408, "cookies": false, "type": "", "deprecated": false, @@ -18392,7 +18600,7 @@ "x-appwrite": { "method": "updateSiteDeployment", "group": "sites", - "weight": 414, + "weight": 415, "cookies": false, "type": "", "deprecated": false, @@ -18470,7 +18678,7 @@ "x-appwrite": { "method": "listDeployments", "group": "deployments", - "weight": 413, + "weight": 414, "cookies": false, "type": "", "deprecated": false, @@ -18551,7 +18759,7 @@ "x-appwrite": { "method": "createDeployment", "group": "deployments", - "weight": 409, + "weight": 410, "cookies": false, "type": "upload", "deprecated": false, @@ -18652,7 +18860,7 @@ "x-appwrite": { "method": "createDuplicateDeployment", "group": "deployments", - "weight": 417, + "weight": 418, "cookies": false, "type": "", "deprecated": false, @@ -18732,7 +18940,7 @@ "x-appwrite": { "method": "createTemplateDeployment", "group": "deployments", - "weight": 410, + "weight": 411, "cookies": false, "type": "", "deprecated": false, @@ -18839,7 +19047,7 @@ "x-appwrite": { "method": "createVcsDeployment", "group": "deployments", - "weight": 411, + "weight": 412, "cookies": false, "type": "", "deprecated": false, @@ -18937,7 +19145,7 @@ "x-appwrite": { "method": "getDeployment", "group": "deployments", - "weight": 412, + "weight": 413, "cookies": false, "type": "", "deprecated": false, @@ -19000,7 +19208,7 @@ "x-appwrite": { "method": "deleteDeployment", "group": "deployments", - "weight": 415, + "weight": 416, "cookies": false, "type": "", "deprecated": false, @@ -19068,7 +19276,7 @@ "x-appwrite": { "method": "getDeploymentDownload", "group": "deployments", - "weight": 416, + "weight": 417, "cookies": false, "type": "location", "deprecated": false, @@ -19079,7 +19287,6 @@ "rate-key": "url:{url},ip:{ip}", "scope": "sites.read", "platforms": [ - "server", "server" ], "packaging": false, @@ -19155,7 +19362,7 @@ "x-appwrite": { "method": "updateDeploymentStatus", "group": "deployments", - "weight": 418, + "weight": 419, "cookies": false, "type": "", "deprecated": false, @@ -19223,7 +19430,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 420, + "weight": 421, "cookies": false, "type": "", "deprecated": false, @@ -19295,7 +19502,7 @@ "x-appwrite": { "method": "getLog", "group": "logs", - "weight": 419, + "weight": 420, "cookies": false, "type": "", "deprecated": false, @@ -19360,7 +19567,7 @@ "x-appwrite": { "method": "deleteLog", "group": "logs", - "weight": 421, + "weight": 422, "cookies": false, "type": "", "deprecated": false, @@ -19428,7 +19635,7 @@ "x-appwrite": { "method": "listVariables", "group": "variables", - "weight": 424, + "weight": 425, "cookies": false, "type": "", "deprecated": false, @@ -19488,7 +19695,7 @@ "x-appwrite": { "method": "createVariable", "group": "variables", - "weight": 422, + "weight": 423, "cookies": false, "type": "", "deprecated": false, @@ -19579,7 +19786,7 @@ "x-appwrite": { "method": "getVariable", "group": "variables", - "weight": 423, + "weight": 424, "cookies": false, "type": "", "deprecated": false, @@ -19647,7 +19854,7 @@ "x-appwrite": { "method": "updateVariable", "group": "variables", - "weight": 425, + "weight": 426, "cookies": false, "type": "", "deprecated": false, @@ -19740,7 +19947,7 @@ "x-appwrite": { "method": "deleteVariable", "group": "variables", - "weight": 426, + "weight": 427, "cookies": false, "type": "", "deprecated": false, @@ -19808,7 +20015,7 @@ "x-appwrite": { "method": "listBuckets", "group": "buckets", - "weight": 207, + "weight": 209, "cookies": false, "type": "", "deprecated": false, @@ -19881,7 +20088,7 @@ "x-appwrite": { "method": "createBucket", "group": "buckets", - "weight": 206, + "weight": 208, "cookies": false, "type": "", "deprecated": false, @@ -20019,7 +20226,7 @@ "x-appwrite": { "method": "getBucket", "group": "buckets", - "weight": 208, + "weight": 210, "cookies": false, "type": "", "deprecated": false, @@ -20079,7 +20286,7 @@ "x-appwrite": { "method": "updateBucket", "group": "buckets", - "weight": 209, + "weight": 211, "cookies": false, "type": "", "deprecated": false, @@ -20213,7 +20420,7 @@ "x-appwrite": { "method": "deleteBucket", "group": "buckets", - "weight": 210, + "weight": 212, "cookies": false, "type": "", "deprecated": false, @@ -20273,7 +20480,7 @@ "x-appwrite": { "method": "listFiles", "group": "files", - "weight": 212, + "weight": 214, "cookies": false, "type": "", "deprecated": false, @@ -20285,7 +20492,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20358,7 +20564,7 @@ "x-appwrite": { "method": "createFile", "group": "files", - "weight": 211, + "weight": 213, "cookies": false, "type": "upload", "deprecated": false, @@ -20370,7 +20576,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20450,7 +20655,7 @@ "x-appwrite": { "method": "getFile", "group": "files", - "weight": 213, + "weight": 215, "cookies": false, "type": "", "deprecated": false, @@ -20462,7 +20667,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20522,7 +20726,7 @@ "x-appwrite": { "method": "updateFile", "group": "files", - "weight": 218, + "weight": 220, "cookies": false, "type": "", "deprecated": false, @@ -20534,7 +20738,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20613,7 +20816,7 @@ "x-appwrite": { "method": "deleteFile", "group": "files", - "weight": 219, + "weight": 221, "cookies": false, "type": "", "deprecated": false, @@ -20625,7 +20828,6 @@ "scope": "files.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20685,7 +20887,7 @@ "x-appwrite": { "method": "getFileDownload", "group": "files", - "weight": 215, + "weight": 217, "cookies": false, "type": "location", "deprecated": false, @@ -20697,7 +20899,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20766,7 +20967,7 @@ "x-appwrite": { "method": "getFilePreview", "group": "files", - "weight": 214, + "weight": 216, "cookies": false, "type": "location", "deprecated": false, @@ -20778,7 +20979,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -20932,7 +21132,8 @@ "png", "webp", "heic", - "avif" + "avif", + "gif" ], "x-enum-name": "ImageFormat", "x-enum-keys": [], @@ -20974,7 +21175,7 @@ "x-appwrite": { "method": "getFileView", "group": "files", - "weight": 216, + "weight": 218, "cookies": false, "type": "location", "deprecated": false, @@ -20986,7 +21187,6 @@ "scope": "files.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21055,7 +21255,7 @@ "x-appwrite": { "method": "list", "group": "teams", - "weight": 223, + "weight": 225, "cookies": false, "type": "", "deprecated": false, @@ -21067,7 +21267,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21132,7 +21331,7 @@ "x-appwrite": { "method": "create", "group": "teams", - "weight": 222, + "weight": 224, "cookies": false, "type": "", "deprecated": false, @@ -21144,7 +21343,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21224,7 +21422,7 @@ "x-appwrite": { "method": "get", "group": "teams", - "weight": 224, + "weight": 226, "cookies": false, "type": "", "deprecated": false, @@ -21236,7 +21434,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21288,7 +21485,7 @@ "x-appwrite": { "method": "updateName", "group": "teams", - "weight": 226, + "weight": 228, "cookies": false, "type": "", "deprecated": false, @@ -21300,7 +21497,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21365,7 +21561,7 @@ "x-appwrite": { "method": "delete", "group": "teams", - "weight": 228, + "weight": 230, "cookies": false, "type": "", "deprecated": false, @@ -21377,7 +21573,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21429,7 +21624,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 230, + "weight": 232, "cookies": false, "type": "", "deprecated": false, @@ -21441,7 +21636,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21514,7 +21708,7 @@ "x-appwrite": { "method": "createMembership", "group": "memberships", - "weight": 229, + "weight": 231, "cookies": false, "type": "", "deprecated": false, @@ -21526,7 +21720,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21629,7 +21822,7 @@ "x-appwrite": { "method": "getMembership", "group": "memberships", - "weight": 231, + "weight": 233, "cookies": false, "type": "", "deprecated": false, @@ -21641,7 +21834,6 @@ "scope": "teams.read", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21701,7 +21893,7 @@ "x-appwrite": { "method": "updateMembership", "group": "memberships", - "weight": 232, + "weight": 234, "cookies": false, "type": "", "deprecated": false, @@ -21713,7 +21905,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21789,7 +21980,7 @@ "x-appwrite": { "method": "deleteMembership", "group": "memberships", - "weight": 234, + "weight": 236, "cookies": false, "type": "", "deprecated": false, @@ -21801,7 +21992,6 @@ "scope": "teams.write", "platforms": [ "client", - "server", "server" ], "packaging": false, @@ -21863,7 +22053,7 @@ "x-appwrite": { "method": "updateMembershipStatus", "group": "memberships", - "weight": 233, + "weight": 235, "cookies": false, "type": "", "deprecated": false, @@ -21958,7 +22148,7 @@ "x-appwrite": { "method": "getPrefs", "group": "teams", - "weight": 225, + "weight": 227, "cookies": false, "type": "", "deprecated": false, @@ -22020,7 +22210,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "teams", - "weight": 227, + "weight": 229, "cookies": false, "type": "", "deprecated": false, @@ -22100,7 +22290,7 @@ "x-appwrite": { "method": "list", "group": "files", - "weight": 439, + "weight": 440, "cookies": false, "type": "", "deprecated": false, @@ -22181,7 +22371,7 @@ "x-appwrite": { "method": "createFileToken", "group": "files", - "weight": 437, + "weight": 438, "cookies": false, "type": "", "deprecated": false, @@ -22266,7 +22456,7 @@ "x-appwrite": { "method": "get", "group": "tokens", - "weight": 438, + "weight": 439, "cookies": false, "type": "", "deprecated": false, @@ -22327,7 +22517,7 @@ "x-appwrite": { "method": "update", "group": "tokens", - "weight": 440, + "weight": 441, "cookies": false, "type": "", "deprecated": false, @@ -22399,7 +22589,7 @@ "x-appwrite": { "method": "delete", "group": "tokens", - "weight": 441, + "weight": 442, "cookies": false, "type": "", "deprecated": false, @@ -22460,7 +22650,7 @@ "x-appwrite": { "method": "list", "group": "users", - "weight": 245, + "weight": 247, "cookies": false, "type": "", "deprecated": false, @@ -22533,7 +22723,7 @@ "x-appwrite": { "method": "create", "group": "users", - "weight": 236, + "weight": 238, "cookies": false, "type": "", "deprecated": false, @@ -22629,7 +22819,7 @@ "x-appwrite": { "method": "createArgon2User", "group": "users", - "weight": 239, + "weight": 241, "cookies": false, "type": "", "deprecated": false, @@ -22721,7 +22911,7 @@ "x-appwrite": { "method": "createBcryptUser", "group": "users", - "weight": 237, + "weight": 239, "cookies": false, "type": "", "deprecated": false, @@ -22811,7 +23001,7 @@ "x-appwrite": { "method": "listIdentities", "group": "identities", - "weight": 253, + "weight": 255, "cookies": false, "type": "", "deprecated": false, @@ -22881,7 +23071,7 @@ "x-appwrite": { "method": "deleteIdentity", "group": "identities", - "weight": 276, + "weight": 278, "cookies": false, "type": "", "deprecated": false, @@ -22943,7 +23133,7 @@ "x-appwrite": { "method": "createMD5User", "group": "users", - "weight": 238, + "weight": 240, "cookies": false, "type": "", "deprecated": false, @@ -23035,7 +23225,7 @@ "x-appwrite": { "method": "createPHPassUser", "group": "users", - "weight": 241, + "weight": 243, "cookies": false, "type": "", "deprecated": false, @@ -23127,7 +23317,7 @@ "x-appwrite": { "method": "createScryptUser", "group": "users", - "weight": 242, + "weight": 244, "cookies": false, "type": "", "deprecated": false, @@ -23254,7 +23444,7 @@ "x-appwrite": { "method": "createScryptModifiedUser", "group": "users", - "weight": 243, + "weight": 245, "cookies": false, "type": "", "deprecated": false, @@ -23367,7 +23557,7 @@ "x-appwrite": { "method": "createSHAUser", "group": "users", - "weight": 240, + "weight": 242, "cookies": false, "type": "", "deprecated": false, @@ -23478,7 +23668,7 @@ "x-appwrite": { "method": "get", "group": "users", - "weight": 246, + "weight": 248, "cookies": false, "type": "", "deprecated": false, @@ -23533,7 +23723,7 @@ "x-appwrite": { "method": "delete", "group": "users", - "weight": 274, + "weight": 276, "cookies": false, "type": "", "deprecated": false, @@ -23595,7 +23785,7 @@ "x-appwrite": { "method": "updateEmail", "group": "users", - "weight": 259, + "weight": 261, "cookies": false, "type": "", "deprecated": false, @@ -23675,7 +23865,7 @@ "x-appwrite": { "method": "createJWT", "group": "sessions", - "weight": 277, + "weight": 279, "cookies": false, "type": "", "deprecated": false, @@ -23758,7 +23948,7 @@ "x-appwrite": { "method": "updateLabels", "group": "users", - "weight": 255, + "weight": 257, "cookies": false, "type": "", "deprecated": false, @@ -23839,7 +24029,7 @@ "x-appwrite": { "method": "listLogs", "group": "logs", - "weight": 251, + "weight": 253, "cookies": false, "type": "", "deprecated": false, @@ -23911,7 +24101,7 @@ "x-appwrite": { "method": "listMemberships", "group": "memberships", - "weight": 250, + "weight": 252, "cookies": false, "type": "", "deprecated": false, @@ -23994,7 +24184,7 @@ "x-appwrite": { "method": "updateMfa", "group": "users", - "weight": 264, + "weight": 266, "cookies": false, "type": "", "deprecated": false, @@ -24069,7 +24259,7 @@ "x-appwrite": { "method": "deleteMfaAuthenticator", "group": "mfa", - "weight": 269, + "weight": 271, "cookies": false, "type": "", "deprecated": false, @@ -24142,7 +24332,7 @@ "x-appwrite": { "method": "listMfaFactors", "group": "mfa", - "weight": 265, + "weight": 267, "cookies": false, "type": "", "deprecated": false, @@ -24202,7 +24392,7 @@ "x-appwrite": { "method": "getMfaRecoveryCodes", "group": "mfa", - "weight": 266, + "weight": 268, "cookies": false, "type": "", "deprecated": false, @@ -24262,7 +24452,7 @@ "x-appwrite": { "method": "updateMfaRecoveryCodes", "group": "mfa", - "weight": 268, + "weight": 270, "cookies": false, "type": "", "deprecated": false, @@ -24322,7 +24512,7 @@ "x-appwrite": { "method": "createMfaRecoveryCodes", "group": "mfa", - "weight": 267, + "weight": 269, "cookies": false, "type": "", "deprecated": false, @@ -24384,7 +24574,7 @@ "x-appwrite": { "method": "updateName", "group": "users", - "weight": 257, + "weight": 259, "cookies": false, "type": "", "deprecated": false, @@ -24464,7 +24654,7 @@ "x-appwrite": { "method": "updatePassword", "group": "users", - "weight": 258, + "weight": 260, "cookies": false, "type": "", "deprecated": false, @@ -24544,7 +24734,7 @@ "x-appwrite": { "method": "updatePhone", "group": "users", - "weight": 260, + "weight": 262, "cookies": false, "type": "", "deprecated": false, @@ -24622,7 +24812,7 @@ "x-appwrite": { "method": "getPrefs", "group": "users", - "weight": 247, + "weight": 249, "cookies": false, "type": "", "deprecated": false, @@ -24682,7 +24872,7 @@ "x-appwrite": { "method": "updatePrefs", "group": "users", - "weight": 262, + "weight": 264, "cookies": false, "type": "", "deprecated": false, @@ -24760,7 +24950,7 @@ "x-appwrite": { "method": "listSessions", "group": "sessions", - "weight": 249, + "weight": 251, "cookies": false, "type": "", "deprecated": false, @@ -24820,7 +25010,7 @@ "x-appwrite": { "method": "createSession", "group": "sessions", - "weight": 270, + "weight": 272, "cookies": false, "type": "", "deprecated": false, @@ -24875,7 +25065,7 @@ "x-appwrite": { "method": "deleteSessions", "group": "sessions", - "weight": 273, + "weight": 275, "cookies": false, "type": "", "deprecated": false, @@ -24932,7 +25122,7 @@ "x-appwrite": { "method": "deleteSession", "group": "sessions", - "weight": 272, + "weight": 274, "cookies": false, "type": "", "deprecated": false, @@ -25002,7 +25192,7 @@ "x-appwrite": { "method": "updateStatus", "group": "users", - "weight": 254, + "weight": 256, "cookies": false, "type": "", "deprecated": false, @@ -25080,7 +25270,7 @@ "x-appwrite": { "method": "listTargets", "group": "targets", - "weight": 252, + "weight": 254, "cookies": false, "type": "", "deprecated": false, @@ -25117,7 +25307,7 @@ }, { "name": "queries", - "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels", + "description": "Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https:\/\/appwrite.io\/docs\/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType", "required": false, "type": "array", "collectionFormat": "multi", @@ -25153,7 +25343,7 @@ "x-appwrite": { "method": "createTarget", "group": "targets", - "weight": 244, + "weight": 246, "cookies": false, "type": "", "deprecated": false, @@ -25265,7 +25455,7 @@ "x-appwrite": { "method": "getTarget", "group": "targets", - "weight": 248, + "weight": 250, "cookies": false, "type": "", "deprecated": false, @@ -25334,7 +25524,7 @@ "x-appwrite": { "method": "updateTarget", "group": "targets", - "weight": 263, + "weight": 265, "cookies": false, "type": "", "deprecated": false, @@ -25425,7 +25615,7 @@ "x-appwrite": { "method": "deleteTarget", "group": "targets", - "weight": 275, + "weight": 277, "cookies": false, "type": "", "deprecated": false, @@ -25496,7 +25686,7 @@ "x-appwrite": { "method": "createToken", "group": "sessions", - "weight": 271, + "weight": 273, "cookies": false, "type": "", "deprecated": false, @@ -25579,7 +25769,7 @@ "x-appwrite": { "method": "updateEmailVerification", "group": "users", - "weight": 261, + "weight": 263, "cookies": false, "type": "", "deprecated": false, @@ -25659,7 +25849,7 @@ "x-appwrite": { "method": "updatePhoneVerification", "group": "users", - "weight": 256, + "weight": 258, "cookies": false, "type": "", "deprecated": false, @@ -27608,6 +27798,12 @@ "description": "Document ID.", "x-example": "5e5ea5c16897e" }, + "$sequence": { + "type": "integer", + "description": "Document automatically incrementing ID.", + "x-example": 1, + "format": "int32" + }, "$collectionId": { "type": "string", "description": "Collection ID.", @@ -27642,6 +27838,7 @@ "additionalProperties": true, "required": [ "$id", + "$sequence", "$collectionId", "$databaseId", "$createdAt", diff --git a/app/config/storage/inputs.php b/app/config/storage/inputs.php index edcf667d86..a102dfdcf0 100644 --- a/app/config/storage/inputs.php +++ b/app/config/storage/inputs.php @@ -7,4 +7,5 @@ return [ "png" => "image/png", "heic" => "image/heic", "webp" => "image/webp", + "gif" => "image/gif", ]; diff --git a/app/config/storage/outputs.php b/app/config/storage/outputs.php index 519ff825fe..3e6fd45651 100644 --- a/app/config/storage/outputs.php +++ b/app/config/storage/outputs.php @@ -8,4 +8,5 @@ return [ "webp" => "image/webp", "heic" => "image/heic", "avif" => "image/avif", + "gif" => "image/gif", ]; diff --git a/app/config/storage/resource_limits.php b/app/config/storage/resource_limits.php new file mode 100644 index 0000000000..cfbcea5a47 --- /dev/null +++ b/app/config/storage/resource_limits.php @@ -0,0 +1,6 @@ +<?php + +use Utopia\Image\Image; +use Utopia\System\System; + +Image::setResourceLimit('memory', intval(System::getEnv('_APP_IMAGES_RESOURCE_LIMIT_MEMORY', 1024*1024*64))); diff --git a/app/config/template-runtimes.php b/app/config/template-runtimes.php index 8f1c0198c2..d1bb1a5b6a 100644 --- a/app/config/template-runtimes.php +++ b/app/config/template-runtimes.php @@ -14,7 +14,7 @@ return [ ], 'DART' => [ 'name' => 'dart', - 'versions' => ['3.5', '3.3', '3.1', '3.0', '2.19', '2.18', '2.17', '2.16'] + 'versions' => ['3.8', '3.5', '3.3', '3.1', '3.0', '2.19', '2.18', '2.17', '2.16'] ], 'GO' => [ 'name' => 'go', @@ -38,6 +38,6 @@ return [ ], 'FLUTTER' => [ 'name' => 'flutter', - 'versions' => ['3.24'] + 'versions' => ['3.32', '3.24'] ], ]; diff --git a/app/config/templates/site.php b/app/config/templates/site.php index a853955a97..4ae6f61607 100644 --- a/app/config/templates/site.php +++ b/app/config/templates/site.php @@ -6,13 +6,8 @@ use Utopia\System\System; * List of Appwrite Sites templates */ -$protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; -$hostname = System::getEnv('_APP_DOMAIN'); - -// TODO: Development override -if (System::getEnv('_APP_ENV') === 'development') { - $hostname = 'localhost'; -} +$protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; +$hostname = System::getEnv('_APP_DOMAIN', ''); $url = $protocol . '://' . $hostname; diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index ab68bf9f02..6de91f23cc 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -21,6 +21,7 @@ use Appwrite\Event\StatsUsage; use Appwrite\Extend\Exception; use Appwrite\Hooks\Hooks; use Appwrite\Network\Validator\Email; +use Appwrite\Network\Validator\Redirect; use Appwrite\OpenSSL\OpenSSL; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; @@ -60,7 +61,6 @@ use Utopia\System\System; use Utopia\Validator\ArrayList; use Utopia\Validator\Assoc; use Utopia\Validator\Boolean; -use Utopia\Validator\Host; use Utopia\Validator\Text; use Utopia\Validator\URL; use Utopia\Validator\WhiteList; @@ -190,7 +190,7 @@ $createSession = function (string $userId, string $secret, Request $request, Res [ '$id' => ID::unique(), 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'provider' => Auth::getSessionProviderByTokenType($verifiedToken->getAttribute('type')), 'secret' => Auth::hash($sessionSecret), // One way hash encryption to protect DB leak 'userAgent' => $request->getUserAgent('UNKNOWN'), @@ -387,7 +387,7 @@ App::post('/v1/account') 'search' => implode(' ', [$userId, $email, $name]), 'accessedAt' => DateTime::now(), ]); - $user->removeAttribute('$internalId'); + $user->removeAttribute('$sequence'); $user = Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); try { $target = Authorization::skip(fn () => $dbForProject->createDocument('targets', new Document([ @@ -397,7 +397,7 @@ App::post('/v1/account') Permission::delete(Role::user($user->getId())), ], 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'providerType' => MESSAGE_TYPE_EMAIL, 'identifier' => $email, ]))); @@ -907,7 +907,7 @@ App::post('/v1/account/sessions/email') [ '$id' => ID::unique(), 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'provider' => Auth::SESSION_PROVIDER_EMAIL, 'providerUid' => $email, 'secret' => Auth::hash($secret), // One way hash encryption to protect DB leak @@ -1056,7 +1056,7 @@ App::post('/v1/account/sessions/anonymous') 'search' => $userId, 'accessedAt' => DateTime::now(), ]); - $user->removeAttribute('$internalId'); + $user->removeAttribute('$sequence'); Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); // Create session token @@ -1069,7 +1069,7 @@ App::post('/v1/account/sessions/anonymous') [ '$id' => ID::unique(), 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'provider' => Auth::SESSION_PROVIDER_ANONYMOUS, 'secret' => Auth::hash($secret), // One way hash encryption to protect DB leak 'userAgent' => $request->getUserAgent('UNKNOWN'), @@ -1182,16 +1182,23 @@ App::get('/v1/account/sessions/oauth2/:provider') ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'OAuth2 Provider. Currently, supported providers are: ' . \implode(', ', \array_keys(\array_filter(Config::getParam('oAuthProviders'), fn ($node) => (!$node['mock'])))) . '.') - ->param('success', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project\'s 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', 'devKey']) - ->param('failure', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project\'s 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', 'devKey']) + ->param('success', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), 'URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project\'s 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, ['platforms', 'devKey']) + ->param('failure', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), 'URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project\'s 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, ['platforms', 'devKey']) ->param('scopes', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) ->inject('request') ->inject('response') ->inject('project') ->action(function (string $provider, string $success, string $failure, array $scopes, Request $request, Response $response, Document $project) use ($oauthDefaultSuccess, $oauthDefaultFailure) { - $protocol = $request->getProtocol(); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $port = $request->getPort(); + $callbackBase = $protocol . '://' . $request->getHostname(); + if ($protocol === 'https' && $port !== '443') { + $callbackBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $callbackBase .= ':' . $port; + } - $callback = $protocol . '://' . $request->getHostname() . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId(); + $callback = $callbackBase . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId(); $providerEnabled = $project->getAttribute('oAuthProviders', [])[$provider . 'Enabled'] ?? false; if (!$providerEnabled) { @@ -1216,12 +1223,20 @@ App::get('/v1/account/sessions/oauth2/:provider') throw new Exception(Exception::PROJECT_PROVIDER_UNSUPPORTED); } + $host = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); + $redirectBase = $protocol . '://' . $host; + if ($protocol === 'https' && $port !== '443') { + $redirectBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $redirectBase .= ':' . $port; + } + if (empty($success)) { - $success = $protocol . '://' . $request->getHostname() . $oauthDefaultSuccess; + $success = $redirectBase . $oauthDefaultSuccess; } if (empty($failure)) { - $failure = $protocol . '://' . $request->getHostname() . $oauthDefaultFailure; + $failure = $redirectBase . $oauthDefaultFailure; } $oauth2 = new $className($appId, $appSecret, $callback, [ @@ -1251,9 +1266,14 @@ App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId') ->inject('request') ->inject('response') ->action(function (string $projectId, string $provider, string $code, string $state, string $error, string $error_description, Request $request, Response $response) { - - $domain = $request->getHostname(); - $protocol = $request->getProtocol(); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $port = $request->getPort(); + $callbackBase = $protocol . '://' . $request->getHostname(); + if ($protocol === 'https' && $port !== '443') { + $callbackBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $callbackBase .= ':' . $port; + } $params = $request->getParams(); $params['project'] = $projectId; @@ -1262,7 +1282,7 @@ App::get('/v1/account/sessions/oauth2/callback/:provider/:projectId') $response ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') ->addHeader('Pragma', 'no-cache') - ->redirect($protocol . '://' . $domain . '/v1/account/sessions/oauth2/' . $provider . '/redirect?' + ->redirect($callbackBase . '/v1/account/sessions/oauth2/' . $provider . '/redirect?' . \http_build_query($params)); }); @@ -1282,9 +1302,14 @@ App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId') ->inject('request') ->inject('response') ->action(function (string $projectId, string $provider, string $code, string $state, string $error, string $error_description, Request $request, Response $response) { - - $domain = $request->getHostname(); - $protocol = $request->getProtocol(); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $port = $request->getPort(); + $callbackBase = $protocol . '://' . $request->getHostname(); + if ($protocol === 'https' && $port !== '443') { + $callbackBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $callbackBase .= ':' . $port; + } $params = $request->getParams(); $params['project'] = $projectId; @@ -1293,7 +1318,7 @@ App::post('/v1/account/sessions/oauth2/callback/:provider/:projectId') $response ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') ->addHeader('Pragma', 'no-cache') - ->redirect($protocol . '://' . $domain . '/v1/account/sessions/oauth2/' . $provider . '/redirect?' + ->redirect($callbackBase . '/v1/account/sessions/oauth2/' . $provider . '/redirect?' . \http_build_query($params)); }); @@ -1317,15 +1342,24 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') ->inject('request') ->inject('response') ->inject('project') + ->inject('platforms') + ->inject('devKey') ->inject('user') ->inject('dbForProject') ->inject('geodb') ->inject('queueForEvents') - ->action(function (string $provider, string $code, string $state, string $error, string $error_description, Request $request, Response $response, Document $project, Document $user, Database $dbForProject, Reader $geodb, Event $queueForEvents) use ($oauthDefaultSuccess) { - $protocol = $request->getProtocol(); - $callback = $protocol . '://' . $request->getHostname() . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId(); + ->action(function (string $provider, string $code, string $state, string $error, string $error_description, Request $request, Response $response, Document $project, array $platforms, Document $devKey, Document $user, Database $dbForProject, Reader $geodb, Event $queueForEvents) use ($oauthDefaultSuccess) { + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $port = $request->getPort(); + $callbackBase = $protocol . '://' . $request->getHostname(); + if ($protocol === 'https' && $port !== '443') { + $callbackBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $callbackBase .= ':' . $port; + } + $callback = $callbackBase . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId(); $defaultState = ['success' => $project->getAttribute('url', ''), 'failure' => '']; - $validateURL = new URL(); + $redirect = new Redirect($platforms); $appId = $project->getAttribute('oAuthProviders', [])[$provider . 'Appid'] ?? ''; $appSecret = $project->getAttribute('oAuthProviders', [])[$provider . 'Secret'] ?? '{}'; $providerEnabled = $project->getAttribute('oAuthProviders', [])[$provider . 'Enabled'] ?? false; @@ -1352,11 +1386,11 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $state = $defaultState; } - if (!$validateURL->isValid($state['success'])) { + if ($devKey->isEmpty() && !$redirect->isValid($state['success'])) { throw new Exception(Exception::PROJECT_INVALID_SUCCESS_URL); } - if (!empty($state['failure']) && !$validateURL->isValid($state['failure'])) { + if ($devKey->isEmpty() && !empty($state['failure']) && !$redirect->isValid($state['failure'])) { throw new Exception(Exception::PROJECT_INVALID_FAILURE_URL); } $failure = []; @@ -1423,13 +1457,13 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $name = ''; $nameOAuth = $oauth2->getUserName($accessToken); - $userParam = \json_decode($request->getParam('user'), true); + $userParam = $request->getParam('user'); if (!empty($nameOAuth)) { $name = $nameOAuth; - } elseif (is_array($userParam)) { - $nameParam = $userParam['name']; - if (is_array($nameParam) && isset($nameParam['firstName']) && isset($nameParam['lastName'])) { - $name = $nameParam['firstName'] . ' ' . $nameParam['lastName']; + } elseif ($userParam !== null) { + $userDecoded = \json_decode($userParam, true); + if (isset($userDecoded['name']['firstName']) && isset($userDecoded['name']['lastName'])) { + $name = $userDecoded['name']['firstName'] . ' ' . $userDecoded['name']['lastName']; } } $email = $oauth2->getUserEmail($accessToken); @@ -1440,7 +1474,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $identityWithMatchingEmail = $dbForProject->findOne('identities', [ Query::equal('providerEmail', [$email]), - Query::notEqual('userInternalId', $user->getInternalId()), + Query::notEqual('userInternalId', $user->getSequence()), ]); if (!$identityWithMatchingEmail->isEmpty()) { $failureRedirect(Exception::USER_ALREADY_EXISTS); @@ -1554,7 +1588,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') 'search' => implode(' ', [$userId, $email, $name]), 'accessedAt' => DateTime::now(), ]); - $user->removeAttribute('$internalId'); + $user->removeAttribute('$sequence'); $userDoc = Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); $dbForProject->createDocument('targets', new Document([ '$permissions' => [ @@ -1563,7 +1597,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') Permission::delete(Role::user($user->getId())), ], 'userId' => $userDoc->getId(), - 'userInternalId' => $userDoc->getInternalId(), + 'userInternalId' => $userDoc->getSequence(), 'providerType' => MESSAGE_TYPE_EMAIL, 'identifier' => $email, ])); @@ -1582,7 +1616,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') } $identity = $dbForProject->findOne('identities', [ - Query::equal('userInternalId', [$user->getInternalId()]), + Query::equal('userInternalId', [$user->getSequence()]), Query::equal('provider', [$provider]), Query::equal('providerUid', [$oauth2ID]), ]); @@ -1592,7 +1626,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $identitiesWithMatchingEmail = $dbForProject->find('identities', [ Query::equal('providerEmail', [$email]), - Query::notEqual('userInternalId', $user->getInternalId()), + Query::notEqual('userInternalId', $user->getSequence()), ]); if (!empty($identitiesWithMatchingEmail)) { $failureRedirect(Exception::GENERAL_BAD_REQUEST); /** Return a generic bad request to prevent exposing existing accounts */ @@ -1605,7 +1639,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') Permission::update(Role::user($userId)), Permission::delete(Role::user($userId)), ], - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'userId' => $userId, 'provider' => $provider, 'providerUid' => $oauth2ID, @@ -1648,7 +1682,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $token = new Document([ '$id' => ID::unique(), 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'type' => Auth::TOKEN_TYPE_OAUTH2, 'secret' => Auth::hash($secret), // One way hash encryption to protect DB leak 'expire' => $expire, @@ -1683,7 +1717,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $session = new Document(array_merge([ '$id' => ID::unique(), 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'provider' => $provider, 'providerUid' => $oauth2ID, 'providerAccessToken' => $accessToken, @@ -1736,7 +1770,7 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $target ->setAttribute('sessionId', $session->getId()) - ->setAttribute('sessionInternalId', $session->getInternalId()); + ->setAttribute('sessionInternalId', $session->getSequence()); $dbForProject->updateDocument('targets', $target->getId(), $target); } @@ -1747,8 +1781,6 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $state['success']['query'] = URLParser::unparseQuery($query); $state['success'] = URLParser::unparse($state['success']); - $expire = DateTime::formatTz(DateTime::addSeconds(new \DateTime(), $duration)); - $response ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') ->addHeader('Pragma', 'no-cache') @@ -1779,16 +1811,23 @@ App::get('/v1/account/tokens/oauth2/:provider') ->label('abuse-limit', 50) ->label('abuse-key', 'ip:{ip}') ->param('provider', '', new WhiteList(\array_keys(Config::getParam('oAuthProviders')), true), 'OAuth2 Provider. Currently, supported providers are: ' . \implode(', ', \array_keys(\array_filter(Config::getParam('oAuthProviders'), fn ($node) => (!$node['mock'])))) . '.') - ->param('success', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project\'s 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', 'devKey']) - ->param('failure', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project\'s 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', 'devKey']) + ->param('success', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), 'URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project\'s 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, ['platforms', 'devKey']) + ->param('failure', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), 'URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project\'s 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, ['platforms', 'devKey']) ->param('scopes', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true) ->inject('request') ->inject('response') ->inject('project') ->action(function (string $provider, string $success, string $failure, array $scopes, Request $request, Response $response, Document $project) use ($oauthDefaultSuccess, $oauthDefaultFailure) { - $protocol = $request->getProtocol(); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $port = $request->getPort(); + $callbackBase = $protocol . '://' . $request->getHostname(); + if ($protocol === 'https' && $port !== '443') { + $callbackBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $callbackBase .= ':' . $port; + } - $callback = $protocol . '://' . $request->getHostname() . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId(); + $callback = $callbackBase . '/v1/account/sessions/oauth2/callback/' . $provider . '/' . $project->getId(); $providerEnabled = $project->getAttribute('oAuthProviders', [])[$provider . 'Enabled'] ?? false; if (!$providerEnabled) { @@ -1813,12 +1852,20 @@ App::get('/v1/account/tokens/oauth2/:provider') throw new Exception(Exception::PROJECT_PROVIDER_UNSUPPORTED); } + $host = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); + $redirectBase = $protocol . '://' . $host; + if ($protocol === 'https' && $port !== '443') { + $redirectBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $redirectBase .= ':' . $port; + } + if (empty($success)) { - $success = $protocol . '://' . $request->getHostname() . $oauthDefaultSuccess; + $success = $redirectBase . $oauthDefaultSuccess; } if (empty($failure)) { - $failure = $protocol . '://' . $request->getHostname() . $oauthDefaultFailure; + $failure = $redirectBase . $oauthDefaultFailure; } $oauth2 = new $className($appId, $appSecret, $callback, [ @@ -1860,7 +1907,7 @@ App::post('/v1/account/tokens/magic-url') ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) ->param('userId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') ->param('email', '', new Email(), 'User email.') - ->param('url', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect the user back to your app from the magic URL login. 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', 'devKey']) + ->param('url', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), 'URL to redirect the user back to your app from the magic URL login. 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, ['platforms', 'devKey']) ->param('phrase', false, new Boolean(), 'Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.', true) ->inject('request') ->inject('response') @@ -1931,7 +1978,7 @@ App::post('/v1/account/tokens/magic-url') 'accessedAt' => DateTime::now(), ]); - $user->removeAttribute('$internalId'); + $user->removeAttribute('$sequence'); Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); } @@ -1941,7 +1988,7 @@ App::post('/v1/account/tokens/magic-url') $token = new Document([ '$id' => ID::unique(), 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'type' => Auth::TOKEN_TYPE_MAGIC_URL, 'secret' => Auth::hash($tokenSecret), // One way hash encryption to protect DB leak 'expire' => $expire, @@ -1961,7 +2008,16 @@ App::post('/v1/account/tokens/magic-url') $dbForProject->purgeCachedDocument('users', $user->getId()); if (empty($url)) { - $url = $request->getProtocol() . '://' . $request->getHostname() . '/console/auth/magic-url'; + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $host = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); + $port = $request->getPort(); + $callbackBase = $protocol . '://' . $host; + if ($protocol === 'https' && $port !== '443') { + $callbackBase .= ':' . $port; + } elseif ($protocol === 'http' && $port !== '80') { + $callbackBase .= ':' . $port; + } + $url = $callbackBase . '/console/auth/magic-url'; } $url = Template::parseURL($url); @@ -2168,7 +2224,7 @@ App::post('/v1/account/tokens/email') 'accessedAt' => DateTime::now(), ]); - $user->removeAttribute('$internalId'); + $user->removeAttribute('$sequence'); Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); } @@ -2178,7 +2234,7 @@ App::post('/v1/account/tokens/email') $token = new Document([ '$id' => ID::unique(), 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'type' => Auth::TOKEN_TYPE_EMAIL, 'secret' => Auth::hash($tokenSecret), // One way hash encryption to protect DB leak 'expire' => $expire, @@ -2460,7 +2516,7 @@ App::post('/v1/account/tokens/phone') 'accessedAt' => DateTime::now(), ]); - $user->removeAttribute('$internalId'); + $user->removeAttribute('$sequence'); Authorization::skip(fn () => $dbForProject->createDocument('users', $user)); try { $target = Authorization::skip(fn () => $dbForProject->createDocument('targets', new Document([ @@ -2470,7 +2526,7 @@ App::post('/v1/account/tokens/phone') Permission::delete(Role::user($user->getId())), ], 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'providerType' => MESSAGE_TYPE_SMS, 'identifier' => $phone, ]))); @@ -2501,7 +2557,7 @@ App::post('/v1/account/tokens/phone') $token = new Document([ '$id' => ID::unique(), 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'type' => Auth::TOKEN_TYPE_PHONE, 'secret' => Auth::hash($secret), 'expire' => $expire, @@ -2703,7 +2759,7 @@ App::get('/v1/account/logs') $audit = new EventAudit($dbForProject); - $logs = $audit->getLogsByUser($user->getInternalId(), $queries); + $logs = $audit->getLogsByUser($user->getSequence(), $queries); $output = []; @@ -2732,7 +2788,7 @@ App::get('/v1/account/logs') } $response->dynamic(new Document([ - 'total' => $audit->countLogsByUser($user->getInternalId(), $queries), + 'total' => $audit->countLogsByUser($user->getSequence(), $queries), 'logs' => $output, ]), Response::MODEL_LOG_LIST); }); @@ -2900,7 +2956,7 @@ App::patch('/v1/account/email') // Makes sure this email is not already used in another identity $identityWithMatchingEmail = $dbForProject->findOne('identities', [ Query::equal('providerEmail', [$email]), - Query::notEqual('userInternalId', $user->getInternalId()), + Query::notEqual('userInternalId', $user->getSequence()), ]); if (!$identityWithMatchingEmail->isEmpty()) { throw new Exception(Exception::GENERAL_BAD_REQUEST); /** Return a generic bad request to prevent exposing existing accounts */ @@ -3146,7 +3202,7 @@ App::post('/v1/account/recovery') ->label('abuse-limit', 10) ->label('abuse-key', ['url:{url},email:{param-email}', 'url:{url},ip:{ip}']) ->param('email', '', new Email(), 'User email.') - ->param('url', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), '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', 'devKey']) + ->param('url', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), '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, ['platforms', 'devKey']) ->inject('request') ->inject('response') ->inject('user') @@ -3183,7 +3239,7 @@ App::post('/v1/account/recovery') $recovery = new Document([ '$id' => ID::unique(), 'userId' => $profile->getId(), - 'userInternalId' => $profile->getInternalId(), + 'userInternalId' => $profile->getSequence(), 'type' => Auth::TOKEN_TYPE_RECOVERY, 'secret' => Auth::hash($secret), // One way hash encryption to protect DB leak 'expire' => $expire, @@ -3217,6 +3273,7 @@ App::post('/v1/account/recovery') ->setParam('{{hello}}', $locale->getText("emails.recovery.hello")) ->setParam('{{footer}}', $locale->getText("emails.recovery.footer")) ->setParam('{{thanks}}', $locale->getText("emails.recovery.thanks")) + ->setParam('{{buttonText}}', $locale->getText("emails.recovery.buttonText")) ->setParam('{{signature}}', $locale->getText("emails.recovery.signature")); $body = $message->render(); @@ -3412,7 +3469,7 @@ App::post('/v1/account/verification') )) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},userId:{userId}') - ->param('url', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), '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.', false, ['clients', 'devKey']) // TODO add built-in confirm page + ->param('url', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), '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.', false, ['platforms', 'devKey']) // TODO add built-in confirm page ->inject('request') ->inject('response') ->inject('project') @@ -3438,7 +3495,7 @@ App::post('/v1/account/verification') $verification = new Document([ '$id' => ID::unique(), 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'type' => Auth::TOKEN_TYPE_VERIFICATION, 'secret' => Auth::hash($verificationSecret), // One way hash encryption to protect DB leak 'expire' => $expire, @@ -3472,6 +3529,7 @@ App::post('/v1/account/verification') ->setParam('{{hello}}', $locale->getText("emails.verification.hello")) ->setParam('{{footer}}', $locale->getText("emails.verification.footer")) ->setParam('{{thanks}}', $locale->getText("emails.verification.thanks")) + ->setParam('{{buttonText}}', $locale->getText("emails.verification.buttonText")) ->setParam('{{signature}}', $locale->getText("emails.verification.signature")); $body = $message->render(); @@ -3685,7 +3743,7 @@ App::post('/v1/account/verification/phone') $verification = new Document([ '$id' => ID::unique(), 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'type' => Auth::TOKEN_TYPE_PHONE, 'secret' => Auth::hash($secret), 'expire' => $expire, @@ -3880,7 +3938,7 @@ App::patch('/v1/account/mfa') if ($user->getAttribute('phone', false) && $user->getAttribute('phoneVerification', false)) { $factors[] = Type::PHONE; } - $factors = \array_unique($factors); + $factors = \array_values(\array_unique($factors)); $session->setAttribute('factors', $factors); $dbForProject->updateDocument('sessions', $session->getId(), $session); @@ -3979,7 +4037,7 @@ App::post('/v1/account/mfa/authenticators/:type') $authenticator = new Document([ '$id' => ID::unique(), 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'type' => Type::TOTP, 'verified' => false, 'data' => [ @@ -4065,7 +4123,7 @@ App::put('/v1/account/mfa/authenticators/:type') $factors = $session->getAttribute('factors', []); $factors[] = $type; - $factors = \array_unique($factors); + $factors = \array_values(\array_unique($factors)); $session->setAttribute('factors', $factors); $dbForProject->updateDocument('sessions', $session->getId(), $session); @@ -4292,7 +4350,7 @@ App::post('/v1/account/mfa/challenge') $code = Auth::codeGenerator(); $challenge = new Document([ 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'type' => $factor, 'token' => Auth::tokenGenerator(), 'code' => $code, @@ -4549,7 +4607,7 @@ App::put('/v1/account/mfa/challenge') $factors = $session->getAttribute('factors', []); $factors[] = $type; - $factors = \array_unique($factors); + $factors = \array_values(\array_unique($factors)); $session ->setAttribute('factors', $factors) @@ -4621,12 +4679,12 @@ App::post('/v1/account/targets/push') Permission::delete(Role::user($user->getId())), ], 'providerId' => !empty($providerId) ? $providerId : null, - 'providerInternalId' => !empty($providerId) ? $provider->getInternalId() : null, + 'providerInternalId' => !empty($providerId) ? $provider->getSequence() : null, 'providerType' => MESSAGE_TYPE_PUSH, 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'sessionId' => $session->getId(), - 'sessionInternalId' => $session->getInternalId(), + 'sessionInternalId' => $session->getSequence(), 'identifier' => $identifier, 'name' => "{$device['deviceBrand']} {$device['deviceModel']}" ])); @@ -4745,7 +4803,7 @@ App::delete('/v1/account/targets/:targetId/push') throw new Exception(Exception::USER_TARGET_NOT_FOUND); } - if ($user->getInternalId() !== $target->getAttribute('userInternalId')) { + if ($user->getSequence() !== $target->getAttribute('userInternalId')) { throw new Exception(Exception::USER_TARGET_NOT_FOUND); } @@ -4794,7 +4852,7 @@ App::get('/v1/account/identities') throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } - $queries[] = Query::equal('userInternalId', [$user->getInternalId()]); + $queries[] = Query::equal('userInternalId', [$user->getSequence()]); /** * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries diff --git a/app/controllers/api/avatars.php b/app/controllers/api/avatars.php index 779a188089..3a7b4aa582 100644 --- a/app/controllers/api/avatars.php +++ b/app/controllers/api/avatars.php @@ -669,7 +669,7 @@ App::get('/v1/cards/cloud') } } - $isPlatinum = $user->getInternalId() % 100 === 0; + $isPlatinum = $user->getSequence() % 100 === 0; } else { $name = $mock === 'normal-long' ? 'Sir First Walter O\'Brian Junior' : 'Walter O\'Brian'; $createdAt = new \DateTime('now'); @@ -859,7 +859,7 @@ App::get('/v1/cards/cloud-back') $isEmployee = \array_key_exists($email, $employees); $isGolden = $isEmployee || $isHero || $isContributor; - $isPlatinum = $user->getInternalId() % 100 === 0; + $isPlatinum = $user->getSequence() % 100 === 0; } else { $userId = '63e0bcf3c3eb803ba530'; @@ -926,9 +926,9 @@ App::get('/v1/cards/cloud-og') } if (!$mock) { - $internalId = $user->getInternalId(); - $bgVariation = $internalId % 3 === 0 ? '1' : ($internalId % 3 === 1 ? '2' : '3'); - $cardVariation = $internalId % 3 === 0 ? '1' : ($internalId % 3 === 1 ? '2' : '3'); + $sequence = $user->getSequence(); + $bgVariation = $sequence % 3 === 0 ? '1' : ($sequence % 3 === 1 ? '2' : '3'); + $cardVariation = $sequence % 3 === 0 ? '1' : ($sequence % 3 === 1 ? '2' : '3'); $name = $user->getAttribute('name', 'Anonymous'); $email = $user->getAttribute('email', ''); @@ -958,7 +958,7 @@ App::get('/v1/cards/cloud-og') } } - $isPlatinum = $user->getInternalId() % 100 === 0; + $isPlatinum = $user->getSequence() % 100 === 0; } else { $bgVariation = \str_ends_with($mock, '-bg2') ? '2' : (\str_ends_with($mock, '-bg3') ? '3' : '1'); $cardVariation = \str_ends_with($mock, '-right') ? '2' : (\str_ends_with($mock, '-middle') ? '3' : '1'); diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 04194c7efa..fb55aca844 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -38,6 +38,7 @@ use Utopia\Database\Exception\Relationship as RelationshipException; use Utopia\Database\Exception\Restricted as RestrictedException; use Utopia\Database\Exception\Structure as StructureException; use Utopia\Database\Exception\Truncate as TruncateException; +use Utopia\Database\Exception\Type as TypeException; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; @@ -62,6 +63,7 @@ use Utopia\Validator\Integer; use Utopia\Validator\IP; use Utopia\Validator\JSON; use Utopia\Validator\Nullable; +use Utopia\Validator\Numeric; use Utopia\Validator\Range; use Utopia\Validator\Text; use Utopia\Validator\URL; @@ -107,7 +109,7 @@ function createAttribute(string $databaseId, string $collectionId, Document $att throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); @@ -130,7 +132,7 @@ function createAttribute(string $databaseId, string $collectionId, Document $att if ($type === Database::VAR_RELATIONSHIP) { $options['side'] = Database::RELATION_SIDE_PARENT; - $relatedCollection = $dbForProject->getDocument('database_' . $database->getInternalId(), $options['relatedCollection'] ?? ''); + $relatedCollection = $dbForProject->getDocument('database_' . $database->getSequence(), $options['relatedCollection'] ?? ''); if ($relatedCollection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND, 'The related collection was not found.'); } @@ -138,11 +140,11 @@ function createAttribute(string $databaseId, string $collectionId, Document $att try { $attribute = new Document([ - '$id' => ID::custom($database->getInternalId() . '_' . $collection->getInternalId() . '_' . $key), + '$id' => ID::custom($database->getSequence() . '_' . $collection->getSequence() . '_' . $key), 'key' => $key, - 'databaseInternalId' => $database->getInternalId(), + 'databaseInternalId' => $database->getSequence(), 'databaseId' => $database->getId(), - 'collectionInternalId' => $collection->getInternalId(), + 'collectionInternalId' => $collection->getSequence(), 'collectionId' => $collectionId, 'type' => $type, 'status' => 'processing', // processing, available, failed, deleting, stuck @@ -164,13 +166,13 @@ function createAttribute(string $databaseId, string $collectionId, Document $att } catch (LimitException) { throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED); } catch (\Throwable $e) { - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); - $dbForProject->purgeCachedCollection('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId()); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); + $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); throw $e; } - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); - $dbForProject->purgeCachedCollection('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId()); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); + $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); if ($type === Database::VAR_RELATIONSHIP && $options['twoWay']) { $twoWayKey = $options['twoWayKey']; @@ -181,11 +183,11 @@ function createAttribute(string $databaseId, string $collectionId, Document $att try { try { $twoWayAttribute = new Document([ - '$id' => ID::custom($database->getInternalId() . '_' . $relatedCollection->getInternalId() . '_' . $twoWayKey), + '$id' => ID::custom($database->getSequence() . '_' . $relatedCollection->getSequence() . '_' . $twoWayKey), 'key' => $twoWayKey, - 'databaseInternalId' => $database->getInternalId(), + 'databaseInternalId' => $database->getSequence(), 'databaseId' => $database->getId(), - 'collectionInternalId' => $relatedCollection->getInternalId(), + 'collectionInternalId' => $relatedCollection->getSequence(), 'collectionId' => $relatedCollection->getId(), 'type' => $type, 'status' => 'processing', // processing, available, failed, deleting, stuck @@ -213,13 +215,13 @@ function createAttribute(string $databaseId, string $collectionId, Document $att $dbForProject->deleteDocument('attributes', $attribute->getId()); throw $e; } finally { - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); - $dbForProject->purgeCachedCollection('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId()); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); + $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); } // If operation succeeded, purge the cache for the related collection too - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $relatedCollection->getId()); - $dbForProject->purgeCachedCollection('database_' . $database->getInternalId() . '_collection_' . $relatedCollection->getInternalId()); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $relatedCollection->getId()); + $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence()); } $queueForDatabase @@ -262,12 +264,12 @@ function updateAttribute( throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } - $attribute = $dbForProject->getDocument('attributes', $database->getInternalId() . '_' . $collection->getInternalId() . '_' . $key); + $attribute = $dbForProject->getDocument('attributes', $database->getSequence() . '_' . $collection->getSequence() . '_' . $key); if ($attribute->isEmpty()) { throw new Exception(Exception::ATTRIBUTE_NOT_FOUND); } @@ -292,7 +294,7 @@ function updateAttribute( throw new Exception(Exception::ATTRIBUTE_DEFAULT_UNSUPPORTED, 'Cannot set default value for array attributes'); } - $collectionId = 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(); + $collectionId = 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(); $attribute ->setAttribute('default', $default) @@ -378,8 +380,8 @@ function updateAttribute( } if ($primaryDocumentOptions['twoWay']) { - $relatedCollection = $dbForProject->getDocument('database_' . $database->getInternalId(), $primaryDocumentOptions['relatedCollection']); - $relatedAttribute = $dbForProject->getDocument('attributes', $database->getInternalId() . '_' . $relatedCollection->getInternalId() . '_' . $primaryDocumentOptions['twoWayKey']); + $relatedCollection = $dbForProject->getDocument('database_' . $database->getSequence(), $primaryDocumentOptions['relatedCollection']); + $relatedAttribute = $dbForProject->getDocument('attributes', $database->getSequence() . '_' . $relatedCollection->getSequence() . '_' . $primaryDocumentOptions['twoWayKey']); if (!empty($newKey) && $newKey !== $key) { $options['twoWayKey'] = $newKey; @@ -389,8 +391,8 @@ function updateAttribute( $relatedAttribute->setAttribute('options', $relatedOptions); - $dbForProject->updateDocument('attributes', $database->getInternalId() . '_' . $relatedCollection->getInternalId() . '_' . $primaryDocumentOptions['twoWayKey'], $relatedAttribute); - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $relatedCollection->getId()); + $dbForProject->updateDocument('attributes', $database->getSequence() . '_' . $relatedCollection->getSequence() . '_' . $primaryDocumentOptions['twoWayKey'], $relatedAttribute); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $relatedCollection->getId()); } } else { try { @@ -418,7 +420,7 @@ function updateAttribute( $originalUid = $attribute->getId(); $attribute - ->setAttribute('$id', ID::custom($database->getInternalId() . '_' . $collection->getInternalId() . '_' . $newKey)) + ->setAttribute('$id', ID::custom($database->getSequence() . '_' . $collection->getSequence() . '_' . $newKey)) ->setAttribute('key', $newKey); try { @@ -444,10 +446,10 @@ function updateAttribute( } } } else { - $attribute = $dbForProject->updateDocument('attributes', $database->getInternalId() . '_' . $collection->getInternalId() . '_' . $key, $attribute); + $attribute = $dbForProject->updateDocument('attributes', $database->getSequence() . '_' . $collection->getSequence() . '_' . $key, $attribute); } - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collection->getId()); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collection->getId()); $queueForEvents ->setContext('collection', $collection) @@ -536,7 +538,7 @@ App::post('/v1/databases') } try { - $dbForProject->createCollection('database_' . $database->getInternalId(), $attributes, $indexes); + $dbForProject->createCollection('database_' . $database->getSequence(), $attributes, $indexes); } catch (DuplicateException) { throw new Exception(Exception::DATABASE_ALREADY_EXISTS); } catch (IndexException) { @@ -839,7 +841,7 @@ App::delete('/v1/databases/:databaseId') } $dbForProject->purgeCachedDocument('databases', $database->getId()); - $dbForProject->purgeCachedCollection('databases_' . $database->getInternalId()); + $dbForProject->purgeCachedCollection('database_' . $database->getSequence()); $queueForDatabase ->setType(DATABASE_TYPE_DELETE_DATABASE) @@ -899,9 +901,9 @@ App::post('/v1/databases/:databaseId/collections') $permissions = Permission::aggregate($permissions) ?? []; try { - $collection = $dbForProject->createDocument('database_' . $database->getInternalId(), new Document([ + $collection = $dbForProject->createDocument('database_' . $database->getSequence(), new Document([ '$id' => $collectionId, - 'databaseInternalId' => $database->getInternalId(), + 'databaseInternalId' => $database->getSequence(), 'databaseId' => $databaseId, '$permissions' => $permissions, 'documentSecurity' => $documentSecurity, @@ -919,7 +921,7 @@ App::post('/v1/databases/:databaseId/collections') try { $dbForProject->createCollection( - id: 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + id: 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), permissions: $permissions, documentSecurity: $documentSecurity ); @@ -1000,7 +1002,7 @@ App::get('/v1/databases/:databaseId/collections') $collectionId = $cursor->getValue(); - $cursorDocument = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $cursorDocument = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($cursorDocument->isEmpty()) { throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Collection '{$collectionId}' for the 'cursor' value not found."); @@ -1009,7 +1011,7 @@ App::get('/v1/databases/:databaseId/collections') $cursor->setValue($cursorDocument); } - $collectionId = 'database_' . $database->getInternalId(); + $collectionId = 'database_' . $database->getSequence(); try { $collections = $dbForProject->find($collectionId, $queries); @@ -1057,7 +1059,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId') throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); @@ -1100,8 +1102,8 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/logs') throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collectionDocument = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); - $collection = $dbForProject->getCollection('database_' . $database->getInternalId() . '_collection_' . $collectionDocument->getInternalId()); + $collectionDocument = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + $collection = $dbForProject->getCollection('database_' . $database->getSequence() . '_collection_' . $collectionDocument->getSequence()); if ($collectionDocument->isEmpty() || $collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); @@ -1215,7 +1217,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId') throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); @@ -1236,12 +1238,12 @@ App::put('/v1/databases/:databaseId/collections/:collectionId') ->setAttribute('search', \implode(' ', [$collectionId, $name])); $collection = $dbForProject->updateDocument( - 'database_' . $database->getInternalId(), + 'database_' . $database->getSequence(), $collectionId, $collection ); - $dbForProject->updateCollection('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $permissions, $documentSecurity); + $dbForProject->updateCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $permissions, $documentSecurity); $queueForEvents ->setContext('database', $database) @@ -1287,17 +1289,17 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId') throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } - if (!$dbForProject->deleteDocument('database_' . $database->getInternalId(), $collectionId)) { + if (!$dbForProject->deleteDocument('database_' . $database->getSequence(), $collectionId)) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove collection from DB'); } - $dbForProject->purgeCachedCollection('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId()); + $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); $queueForDatabase ->setType(DATABASE_TYPE_DELETE_COLLECTION) @@ -1349,7 +1351,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/string ->inject('queueForEvents') ->inject('plan') ->action(function (string $databaseId, string $collectionId, string $key, ?int $size, ?bool $required, ?string $default, bool $array, bool $encrypt, Response $response, Database $dbForProject, EventDatabase $queueForDatabase, Event $queueForEvents, array $plan) { - if ($encrypt && !empty($plan) && !($plan['databasesAllowEncrypt'] ?? false)) { + if (!App::isDevelopment() && $encrypt && !empty($plan) && !($plan['databasesAllowEncrypt'] ?? false)) { throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Encrypted string attributes are not available on your plan. Please upgrade to create encrypted string attributes.'); } if ($encrypt && $size < APP_DATABASE_ENCRYPT_SIZE_MIN) { @@ -1888,15 +1890,15 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/attributes/relati throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); - $collection = $dbForProject->getCollection('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId()); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + $collection = $dbForProject->getCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } - $relatedCollectionDocument = $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId); - $relatedCollection = $dbForProject->getCollection('database_' . $database->getInternalId() . '_collection_' . $relatedCollectionDocument->getInternalId()); + $relatedCollectionDocument = $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId); + $relatedCollection = $dbForProject->getCollection('database_' . $database->getSequence() . '_collection_' . $relatedCollectionDocument->getSequence()); if ($relatedCollection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); @@ -1997,7 +1999,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes') throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } @@ -2010,8 +2012,8 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes') \array_push( $queries, - Query::equal('databaseInternalId', [$database->getInternalId()]), - Query::equal('collectionInternalId', [$collection->getInternalId()]), + Query::equal('databaseInternalId', [$database->getSequence()]), + Query::equal('collectionInternalId', [$collection->getSequence()]), ); /** @@ -2033,8 +2035,8 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes') try { $cursorDocument = $dbForProject->findOne('attributes', [ - Query::equal('databaseInternalId', [$database->getInternalId()]), - Query::equal('collectionInternalId', [$collection->getInternalId()]), + Query::equal('databaseInternalId', [$database->getSequence()]), + Query::equal('collectionInternalId', [$collection->getSequence()]), Query::equal('key', [$attributeId]), ]); } catch (QueryException $e) { @@ -2112,13 +2114,13 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/attributes/:key') throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } - $attribute = $dbForProject->getDocument('attributes', $database->getInternalId() . '_' . $collection->getInternalId() . '_' . $key); + $attribute = $dbForProject->getDocument('attributes', $database->getSequence() . '_' . $collection->getSequence() . '_' . $key); if ($attribute->isEmpty()) { throw new Exception(Exception::ATTRIBUTE_NOT_FOUND); @@ -2725,13 +2727,13 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } - $attribute = $dbForProject->getDocument('attributes', $database->getInternalId() . '_' . $collection->getInternalId() . '_' . $key); + $attribute = $dbForProject->getDocument('attributes', $database->getSequence() . '_' . $collection->getSequence() . '_' . $key); if ($attribute->isEmpty()) { throw new Exception(Exception::ATTRIBUTE_NOT_FOUND); @@ -2754,19 +2756,19 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key $attribute = $dbForProject->updateDocument('attributes', $attribute->getId(), $attribute->setAttribute('status', 'deleting')); } - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); - $dbForProject->purgeCachedCollection('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId()); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); + $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); if ($attribute->getAttribute('type') === Database::VAR_RELATIONSHIP) { $options = $attribute->getAttribute('options'); if ($options['twoWay']) { - $relatedCollection = $dbForProject->getDocument('database_' . $database->getInternalId(), $options['relatedCollection']); + $relatedCollection = $dbForProject->getDocument('database_' . $database->getSequence(), $options['relatedCollection']); if ($relatedCollection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } - $relatedAttribute = $dbForProject->getDocument('attributes', $database->getInternalId() . '_' . $relatedCollection->getInternalId() . '_' . $options['twoWayKey']); + $relatedAttribute = $dbForProject->getDocument('attributes', $database->getSequence() . '_' . $relatedCollection->getSequence() . '_' . $options['twoWayKey']); if ($relatedAttribute->isEmpty()) { throw new Exception(Exception::ATTRIBUTE_NOT_FOUND); @@ -2776,8 +2778,8 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/attributes/:key $dbForProject->updateDocument('attributes', $relatedAttribute->getId(), $relatedAttribute->setAttribute('status', 'deleting')); } - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $options['relatedCollection']); - $dbForProject->purgeCachedCollection('database_' . $database->getInternalId() . '_collection_' . $relatedCollection->getInternalId()); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $options['relatedCollection']); + $dbForProject->purgeCachedCollection('database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence()); } } @@ -2847,7 +2849,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') ->param('type', null, new WhiteList([Database::INDEX_KEY, Database::INDEX_FULLTEXT, Database::INDEX_UNIQUE]), 'Index type.') ->param('attributes', null, new ArrayList(new Key(true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of attributes to index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' attributes are allowed, each 32 characters long.') ->param('orders', [], new ArrayList(new WhiteList(['ASC', 'DESC'], false, Database::VAR_STRING), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of index orders. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' orders are allowed.', true) - ->param('lengths', [], new ArrayList(new Nullable(new Integer()), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Length of index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE, optional:true) + ->param('lengths', [], new ArrayList(new Nullable(new Integer()), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Length of index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE, optional: true) ->inject('response') ->inject('dbForProject') ->inject('queueForDatabase') @@ -2859,7 +2861,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); @@ -2868,8 +2870,8 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') $limit = $dbForProject->getLimitForIndexes(); $count = $dbForProject->count('indexes', [ - Query::equal('collectionInternalId', [$collection->getInternalId()]), - Query::equal('databaseInternalId', [$database->getInternalId()]) + Query::equal('collectionInternalId', [$collection->getSequence()]), + Query::equal('databaseInternalId', [$database->getSequence()]) ], max: $limit); @@ -2939,12 +2941,12 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') } $index = new Document([ - '$id' => ID::custom($database->getInternalId() . '_' . $collection->getInternalId() . '_' . $key), + '$id' => ID::custom($database->getSequence() . '_' . $collection->getSequence() . '_' . $key), 'key' => $key, 'status' => 'processing', // processing, available, failed, deleting, stuck - 'databaseInternalId' => $database->getInternalId(), + 'databaseInternalId' => $database->getSequence(), 'databaseId' => $databaseId, - 'collectionInternalId' => $collection->getInternalId(), + 'collectionInternalId' => $collection->getSequence(), 'collectionId' => $collectionId, 'type' => $type, 'attributes' => $attributes, @@ -2968,7 +2970,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/indexes') throw new Exception(Exception::INDEX_ALREADY_EXISTS); } - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); $queueForDatabase ->setType(DATABASE_TYPE_CREATE_INDEX) @@ -3020,7 +3022,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes') throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); @@ -3051,8 +3053,8 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes') $indexId = $cursor->getValue(); $cursorDocument = Authorization::skip(fn () => $dbForProject->find('indexes', [ - Query::equal('collectionInternalId', [$collection->getInternalId()]), - Query::equal('databaseInternalId', [$database->getInternalId()]), + Query::equal('collectionInternalId', [$collection->getSequence()]), + Query::equal('databaseInternalId', [$database->getSequence()]), Query::equal('key', [$indexId]), Query::limit(1) ])); @@ -3111,7 +3113,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); @@ -3126,7 +3128,6 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') $response->dynamic($index, Response::MODEL_INDEX); }); - App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') ->alias('/v1/database/collections/:collectionId/indexes/:key') ->desc('Delete index') @@ -3164,13 +3165,13 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } - $index = $dbForProject->getDocument('indexes', $database->getInternalId() . '_' . $collection->getInternalId() . '_' . $key); + $index = $dbForProject->getDocument('indexes', $database->getSequence() . '_' . $collection->getSequence() . '_' . $key); if ($index->isEmpty()) { throw new Exception(Exception::INDEX_NOT_FOUND); @@ -3181,7 +3182,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/indexes/:key') $index = $dbForProject->updateDocument('indexes', $index->getId(), $index->setAttribute('status', 'deleting')); } - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); $queueForDatabase ->setType(DATABASE_TYPE_DELETE_INDEX) @@ -3220,7 +3221,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') group: 'documents', name: 'createDocument', description: '/docs/references/databases/create-document.md', - auth: [AuthType::SESSION, AuthType::KEY, AuthType::JWT], + auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT], responses: [ new SDKResponse( code: Response::STATUS_CODE_CREATED, @@ -3241,7 +3242,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') group: 'documents', name: 'createDocuments', description: '/docs/references/databases/create-documents.md', - auth: [AuthType::KEY], + auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( code: Response::STATUS_CODE_CREATED, @@ -3317,7 +3318,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId)); + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } @@ -3426,7 +3427,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $relatedCollectionId = $relationship->getAttribute('relatedCollection'); $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId) + fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) ); foreach ($relations as &$relation) { @@ -3440,7 +3441,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') } if ($relation instanceof Document) { $current = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getInternalId() . '_collection_' . $relatedCollection->getInternalId(), $relation->getId()) + fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence(), $relation->getId()) ); if ($current->isEmpty()) { @@ -3495,7 +3496,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') try { $dbForProject->createDocuments( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documents ); } catch (DuplicateException) { @@ -3537,7 +3538,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $relatedCollectionId = $relationship->getAttribute('relatedCollection'); $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId) + fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) ); foreach ($related as $relation) { @@ -3554,7 +3555,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents') $queueForStatsUsage ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); // per collection + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); // per collection $response->setStatusCode(Response::STATUS_CODE_CREATED); @@ -3612,7 +3613,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId)); + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } @@ -3640,7 +3641,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') $documentId = $cursor->getValue(); - $cursorDocument = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $documentId)); + $cursorDocument = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId)); if ($cursorDocument->isEmpty()) { throw new Exception(Exception::GENERAL_CURSOR_NOT_FOUND, "Document '{$documentId}' for the 'cursor' value not found."); @@ -3649,8 +3650,8 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') $cursor->setValue($cursorDocument); } try { - $documents = $dbForProject->find('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries); - $total = $dbForProject->count('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries, APP_LIMIT_COUNT); + $documents = $dbForProject->find('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $queries); + $total = $dbForProject->count('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $queries, APP_LIMIT_COUNT); } catch (OrderException $e) { throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); } catch (QueryException $e) { @@ -3694,7 +3695,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') $relatedCollectionId = $relationship->getAttribute('relatedCollection'); // todo: Use local cache for this getDocument - $relatedCollection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId)); + $relatedCollection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId)); foreach ($relations as $index => $doc) { if ($doc instanceof Document) { @@ -3720,7 +3721,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents') $queueForStatsUsage ->addMetric(METRIC_DATABASES_OPERATIONS_READS, \max(1, $operations)) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS), \max(1, $operations)); + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_READS), \max(1, $operations)); $select = \array_reduce($queries, function ($result, $query) { return $result || ($query->getMethod() === Query::TYPE_SELECT); @@ -3791,7 +3792,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId)); + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } @@ -3803,7 +3804,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen } try { - $document = $dbForProject->getDocument('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $documentId, $queries); + $document = $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId, $queries); } catch (QueryException $e) { throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } @@ -3847,7 +3848,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen $relatedCollectionId = $relationship->getAttribute('relatedCollection'); $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId) + fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) ); foreach ($related as $relation) { @@ -3862,7 +3863,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen $queueForStatsUsage ->addMetric(METRIC_DATABASES_OPERATIONS_READS, \max(1, $operations)) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS), \max(1, $operations)); + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_READS), \max(1, $operations)); $response->dynamic($document, Response::MODEL_DOCUMENT); }); @@ -3901,12 +3902,12 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents/:documen throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } - $document = $dbForProject->getDocument('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $documentId); + $document = $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId); if ($document->isEmpty()) { throw new Exception(Exception::DOCUMENT_NOT_FOUND); @@ -4030,13 +4031,13 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId)); + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } // Read permission should not be required for update - $document = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $documentId)); + $document = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId)); if ($document->isEmpty()) { throw new Exception(Exception::DOCUMENT_NOT_FOUND); } @@ -4105,7 +4106,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum $relatedCollectionId = $relationship->getAttribute('relatedCollection'); $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId) + fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) ); foreach ($relations as &$relation) { @@ -4120,7 +4121,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum } if ($relation instanceof Document) { $oldDocument = Authorization::skip(fn () => $dbForProject->getDocument( - 'database_' . $database->getInternalId() . '_collection_' . $relatedCollection->getInternalId(), + 'database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence(), $relation->getId() )); $relation->removeAttribute('$collectionId'); @@ -4128,7 +4129,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum // Attribute $collection is required for Utopia. $relation->setAttribute( '$collection', - 'database_' . $database->getInternalId() . '_collection_' . $relatedCollection->getInternalId() + 'database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence() ); if ($oldDocument->isEmpty()) { @@ -4152,11 +4153,11 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum $queueForStatsUsage ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); try { $document = $dbForProject->updateDocument( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $document->getId(), $newDocument ); @@ -4192,7 +4193,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:docum $relatedCollectionId = $relationship->getAttribute('relatedCollection'); $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId) + fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) ); foreach ($related as $relation) { @@ -4274,7 +4275,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId/documents/:documen throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId)); + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } @@ -4308,7 +4309,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId/documents/:documen } $data['$id'] = $documentId; - $data['$permissions'] = $permissions; + $data['$permissions'] = $permissions ?? []; $newDocument = new Document($data); $operations = 0; @@ -4339,7 +4340,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId/documents/:documen $relatedCollectionId = $relationship->getAttribute('relatedCollection'); $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId) + fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) ); foreach ($relations as &$relation) { @@ -4354,7 +4355,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId/documents/:documen } if ($relation instanceof Document) { $oldDocument = Authorization::skip(fn () => $dbForProject->getDocument( - 'database_' . $database->getInternalId() . '_collection_' . $relatedCollection->getInternalId(), + 'database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence(), $relation->getId() )); $relation->removeAttribute('$collectionId'); @@ -4362,7 +4363,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId/documents/:documen // Attribute $collection is required for Utopia. $relation->setAttribute( '$collection', - 'database_' . $database->getInternalId() . '_collection_' . $relatedCollection->getInternalId() + 'database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence() ); if ($oldDocument->isEmpty()) { @@ -4386,12 +4387,12 @@ App::put('/v1/databases/:databaseId/collections/:collectionId/documents/:documen $queueForStatsUsage ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); $upserted = []; try { $modified = $dbForProject->createOrUpdateDocuments( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), [$newDocument], onNext: function (Document $document) use (&$upserted) { $upserted[] = $document; @@ -4430,7 +4431,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId/documents/:documen $relatedCollectionId = $relationship->getAttribute('relatedCollection'); $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId) + fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) ); foreach ($related as $relation) { @@ -4462,6 +4463,160 @@ App::put('/v1/databases/:databaseId/collections/:collectionId/documents/:documen $response->dynamic($document, Response::MODEL_DOCUMENT); }); +App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId/:attribute/increment') + ->desc('Increment document attribute') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].increment') + ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'documents.increment') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', new Method( + namespace: 'databases', + group: 'documents', + name: 'incrementDocumentAttribute', + description: '/docs/references/databases/increment-document-attribute.md', + auth: [AuthType::ADMIN, AuthType::KEY, AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT, + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('documentId', '', new UID(), 'Document ID.') + ->param('attribute', '', new Key(), 'Attribute key.') + ->param('value', 1, new Numeric(), 'Value to increment the attribute by. The value must be a number.', true) + ->param('max', null, new Numeric(), 'Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->action(function (string $databaseId, string $collectionId, string $documentId, string $attribute, int|float $value, int|float|null $max, Response $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage) { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + if ($collection->isEmpty()) { + throw new Exception(Exception::COLLECTION_NOT_FOUND); + } + + try { + $document = $dbForProject->increaseDocumentAttribute( + collection: 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), + id: $documentId, + attribute: $attribute, + value: $value, + max: $max + ); + } catch (ConflictException) { + throw new Exception(Exception::DOCUMENT_UPDATE_CONFLICT); + } catch (NotFoundException) { + throw new Exception(Exception::ATTRIBUTE_NOT_FOUND); + } catch (LimitException) { + throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED, 'Attribute "' . $attribute . '" has reached the maximum value of ' . $max); + } catch (TypeException) { + throw new Exception(Exception::ATTRIBUTE_TYPE_INVALID, 'Attribute "' . $attribute . '" is not a number'); + } + + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, 1) + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), 1); + + $queueForEvents + ->setParam('databaseId', $databaseId) + ->setParam('collectionId', $collectionId) + ->setContext('collection', $collection) + ->setContext('database', $database); + + $response->dynamic($document, Response::MODEL_DOCUMENT); + }); + +App::patch('/v1/databases/:databaseId/collections/:collectionId/documents/:documentId/:attribute/decrement') + ->desc('Decrement document attribute') + ->groups(['api', 'database']) + ->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].decrement') + ->label('scope', 'documents.write') + ->label('resourceType', RESOURCE_TYPE_DATABASES) + ->label('audits.event', 'documents.decrement') + ->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}') + ->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}') + ->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2) + ->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT) + ->label('sdk', new Method( + namespace: 'databases', + group: 'documents', + name: 'decrementDocumentAttribute', + description: '/docs/references/databases/decrement-document-attribute.md', + auth: [AuthType::ADMIN, AuthType::KEY, AuthType::SESSION, AuthType::JWT], + responses: [ + new SDKResponse( + code: Response::STATUS_CODE_OK, + model: Response::MODEL_DOCUMENT, + ) + ], + contentType: ContentType::JSON + )) + ->param('databaseId', '', new UID(), 'Database ID.') + ->param('collectionId', '', new UID(), 'Collection ID.') + ->param('documentId', '', new UID(), 'Document ID.') + ->param('attribute', '', new Key(), 'Attribute key.') + ->param('value', 1, new Numeric(), 'Value to decrement the attribute by. The value must be a number.', true) + ->param('min', null, new Numeric(), 'Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.', true) + ->inject('response') + ->inject('dbForProject') + ->inject('queueForEvents') + ->inject('queueForStatsUsage') + ->action(function (string $databaseId, string $collectionId, string $documentId, string $attribute, int|float $value, int|float|null $min, Response $response, Database $dbForProject, Event $queueForEvents, StatsUsage $queueForStatsUsage) { + $database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId)); + if ($database->isEmpty()) { + throw new Exception(Exception::DATABASE_NOT_FOUND); + } + + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); + if ($collection->isEmpty()) { + throw new Exception(Exception::COLLECTION_NOT_FOUND); + } + + try { + $document = $dbForProject->decreaseDocumentAttribute( + collection: 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), + id: $documentId, + attribute: $attribute, + value: $value, + min: $min + ); + } catch (ConflictException) { + throw new Exception(Exception::DOCUMENT_UPDATE_CONFLICT); + } catch (NotFoundException) { + throw new Exception(Exception::ATTRIBUTE_NOT_FOUND); + } catch (LimitException) { + throw new Exception(Exception::ATTRIBUTE_LIMIT_EXCEEDED, 'Attribute "' . $attribute . '" has reached the minimum value of ' . $min); + } catch (TypeException) { + throw new Exception(Exception::ATTRIBUTE_TYPE_INVALID, 'Attribute "' . $attribute . '" is not a number'); + } + + $queueForStatsUsage + ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, 1) + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), 1); + + $queueForEvents + ->setParam('databaseId', $databaseId) + ->setParam('collectionId', $collectionId) + ->setContext('collection', $collection) + ->setContext('database', $database); + + $response->dynamic($document, Response::MODEL_DOCUMENT); + }); + App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') ->desc('Update documents') ->groups(['api', 'database']) @@ -4477,7 +4632,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') group: 'documents', name: 'updateDocuments', description: '/docs/references/databases/update-documents.md', - auth: [AuthType::KEY], + auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, @@ -4509,7 +4664,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } @@ -4540,7 +4695,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') try { $modified = $dbForProject->updateDocuments( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), new Document($data), $queries, onNext: function (Document $document) use ($plan, &$documents) { @@ -4564,7 +4719,7 @@ App::patch('/v1/databases/:databaseId/collections/:collectionId/documents') $queueForStatsUsage ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $modified)) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $modified)); + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $modified)); $response->dynamic(new Document([ 'total' => $modified, @@ -4587,7 +4742,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId/documents') group: 'documents', name: 'upsertDocuments', description: '/docs/references/databases/upsert-documents.md', - auth: [AuthType::KEY], + auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, @@ -4598,7 +4753,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId/documents') )) ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID.') - ->param('documents', [], fn (array $plan) => new ArrayList(new JSON(), $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH), 'Array of document data as JSON objects. May contain partial documents.', true, ['plan']) + ->param('documents', [], fn (array $plan) => new ArrayList(new JSON(), $plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH), 'Array of document data as JSON objects. May contain partial documents.', false, ['plan']) ->inject('response') ->inject('dbForProject') ->inject('queueForStatsUsage') @@ -4609,7 +4764,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } @@ -4631,7 +4786,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId/documents') try { $modified = $dbForProject->createOrUpdateDocuments( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documents, onNext: function (Document $document) use ($plan, &$upserted) { if (\count($upserted) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { @@ -4656,7 +4811,7 @@ App::put('/v1/databases/:databaseId/collections/:collectionId/documents') $queueForStatsUsage ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $modified)) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $modified)); + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $modified)); $response->dynamic(new Document([ 'total' => $modified, @@ -4707,20 +4862,20 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId)); + $collection = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId)); if ($collection->isEmpty() || (!$collection->getAttribute('enabled', false) && !$isAPIKey && !$isPrivilegedUser)) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } // Read permission should not be required for delete - $document = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $documentId)); + $document = Authorization::skip(fn () => $dbForProject->getDocument('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId)); if ($document->isEmpty()) { throw new Exception(Exception::DOCUMENT_NOT_FOUND); } try { $dbForProject->deleteDocument( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $documentId ); } catch (ConflictException) { @@ -4755,7 +4910,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu $relatedCollectionId = $relationship->getAttribute('relatedCollection'); $relatedCollection = Authorization::skip( - fn () => $dbForProject->getDocument('database_' . $database->getInternalId(), $relatedCollectionId) + fn () => $dbForProject->getDocument('database_' . $database->getSequence(), $relatedCollectionId) ); foreach ($related as $relation) { @@ -4770,7 +4925,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents/:docu $queueForStatsUsage ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $operations)) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $operations)); $relationships = \array_map( fn ($document) => $document->getAttribute('key'), @@ -4806,7 +4961,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') group: 'documents', name: 'deleteDocuments', description: '/docs/references/databases/delete-documents.md', - auth: [AuthType::KEY], + auth: [AuthType::ADMIN, AuthType::KEY], responses: [ new SDKResponse( code: Response::STATUS_CODE_OK, @@ -4829,7 +4984,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') throw new Exception(Exception::DATABASE_NOT_FOUND); } - $collection = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); + $collection = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); } @@ -4853,7 +5008,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') try { $modified = $dbForProject->deleteDocuments( - 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), + 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $queries, onNext: function (Document $document) use ($plan, &$documents) { if (\count($documents) < ($plan['databasesBatchSize'] ?? APP_LIMIT_DATABASE_BATCH)) { @@ -4874,7 +5029,7 @@ App::delete('/v1/databases/:databaseId/collections/:collectionId/documents') $queueForStatsUsage ->addMetric(METRIC_DATABASES_OPERATIONS_WRITES, \max(1, $modified)) - ->addMetric(str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $modified)); + ->addMetric(str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES), \max(1, $modified)); $response->dynamic(new Document([ 'total' => $modified, @@ -5010,11 +5165,11 @@ App::get('/v1/databases/:databaseId/usage') $stats = $usage = []; $days = $periods[$range]; $metrics = [ - str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_COLLECTIONS), - str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_DOCUMENTS), - str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_STORAGE), - str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_READS), - str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_OPERATIONS_WRITES) + str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_COLLECTIONS), + str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_DOCUMENTS), + str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_STORAGE), + str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_READS), + str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_OPERATIONS_WRITES) ]; Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { @@ -5103,8 +5258,8 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/usage') ->inject('dbForProject') ->action(function (string $databaseId, string $range, string $collectionId, Response $response, Database $dbForProject) { $database = $dbForProject->getDocument('databases', $databaseId); - $collectionDocument = $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId); - $collection = $dbForProject->getCollection('database_' . $database->getInternalId() . '_collection_' . $collectionDocument->getInternalId()); + $collectionDocument = $dbForProject->getDocument('database_' . $database->getSequence(), $collectionId); + $collection = $dbForProject->getCollection('database_' . $database->getSequence() . '_collection_' . $collectionDocument->getSequence()); if ($collection->isEmpty()) { throw new Exception(Exception::COLLECTION_NOT_FOUND); @@ -5114,7 +5269,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/usage') $stats = $usage = []; $days = $periods[$range]; $metrics = [ - str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collectionDocument->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS), + str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getSequence(), $collectionDocument->getSequence()], METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS), ]; Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index b95eb432a1..43368b8d3f 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -523,11 +523,16 @@ App::get('/v1/health/queue/databases') ->param('name', 'database_db_main', new Text(256), 'Queue name for which to check the queue size', true) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('publisher') + ->inject('publisherRedis') ->inject('response') - ->action(function (string $name, int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (string $name, int|string $threshold, Publisher $publisher, ?Publisher $publisherRedis, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue($name)); + $isRedisFallback = \str_contains(System::getEnv('_APP_WORKER_REDIS_FALLBACK', ''), 'databases'); + + $size = $isRedisFallback + ? $publisherRedis->getQueueSize(new Queue($name)) + : $publisher->getQueueSize(new Queue($name)); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -655,11 +660,16 @@ App::get('/v1/health/queue/migrations') )) ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) ->inject('publisher') + ->inject('publisherRedis') ->inject('response') - ->action(function (int|string $threshold, Publisher $publisher, Response $response) { + ->action(function (int|string $threshold, Publisher $publisher, ?Publisher $publisherRedis, Response $response) { $threshold = \intval($threshold); - $size = $publisher->getQueueSize(new Queue(Event::MIGRATIONS_QUEUE_NAME)); + $isRedisFallback = \str_contains(System::getEnv('_APP_WORKER_REDIS_FALLBACK', ''), 'migrations'); + + $size = $isRedisFallback + ? $publisherRedis->getQueueSize(new Queue(Event::MIGRATIONS_QUEUE_NAME)) + : $publisher->getQueueSize(new Queue(Event::MIGRATIONS_QUEUE_NAME)); if ($size >= $threshold) { throw new Exception(Exception::HEALTH_QUEUE_SIZE_EXCEEDED, "Queue size threshold hit. Current size is {$size} and threshold is {$threshold}."); @@ -845,15 +855,18 @@ App::get('/v1/health/storage') $checkStart = \microtime(true); foreach ($devices as $device) { - if (!$device->write($device->getPath('health.txt'), 'test', 'text/plain')) { + $uniqueFileName = \uniqid('health', true); + $filePath = $device->getPath($uniqueFileName); + + if (!$device->write($filePath, 'test', 'text/plain')) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed writing test file to ' . $device->getRoot()); } - if ($device->read($device->getPath('health.txt')) !== 'test') { + if ($device->read($filePath) !== 'test') { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed reading test file from ' . $device->getRoot()); } - if (!$device->delete($device->getPath('health.txt'))) { + if (!$device->delete($filePath)) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed deleting test file from ' . $device->getRoot()); } } diff --git a/app/controllers/api/messaging.php b/app/controllers/api/messaging.php index 1d11e6c392..0bc6f93787 100644 --- a/app/controllers/api/messaging.php +++ b/app/controllers/api/messaging.php @@ -2511,11 +2511,11 @@ App::post('/v1/messaging/topics/:topicId/subscribers') Permission::delete(Role::user($user->getId())), ], 'topicId' => $topicId, - 'topicInternalId' => $topic->getInternalId(), + 'topicInternalId' => $topic->getSequence(), 'targetId' => $targetId, - 'targetInternalId' => $target->getInternalId(), + 'targetInternalId' => $target->getSequence(), 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'providerType' => $target->getAttribute('providerType'), 'search' => implode(' ', [ $subscriberId, @@ -2597,7 +2597,7 @@ App::get('/v1/messaging/topics/:topicId/subscribers') throw new Exception(Exception::TOPIC_NOT_FOUND); } - $queries[] = Query::equal('topicInternalId', [$topic->getInternalId()]); + $queries[] = Query::equal('topicInternalId', [$topic->getSequence()]); /** * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries @@ -2947,7 +2947,7 @@ App::post('/v1/messaging/messages/email') throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); @@ -2989,7 +2989,7 @@ App::post('/v1/messaging/messages/email') 'region' => $project->getAttribute('region'), 'resourceType' => 'message', 'resourceId' => $message->getId(), - 'resourceInternalId' => $message->getInternalId(), + 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), 'projectId' => $project->getId(), 'schedule' => $scheduledAt, @@ -3112,7 +3112,7 @@ App::post('/v1/messaging/messages/sms') 'region' => $project->getAttribute('region'), 'resourceType' => 'message', 'resourceId' => $message->getId(), - 'resourceInternalId' => $message->getInternalId(), + 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), 'projectId' => $project->getId(), 'schedule' => $scheduledAt, @@ -3232,7 +3232,7 @@ App::post('/v1/messaging/messages/push') throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } @@ -3330,7 +3330,7 @@ App::post('/v1/messaging/messages/push') 'region' => $project->getAttribute('region'), 'resourceType' => 'message', 'resourceId' => $message->getId(), - 'resourceInternalId' => $message->getInternalId(), + 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), 'projectId' => $project->getId(), 'schedule' => $scheduledAt, @@ -3731,7 +3731,7 @@ App::patch('/v1/messaging/messages/email/:messageId') 'region' => $project->getAttribute('region'), 'resourceType' => 'message', 'resourceId' => $message->getId(), - 'resourceInternalId' => $message->getInternalId(), + 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), 'projectId' => $project->getId(), 'schedule' => $scheduledAt, @@ -3796,7 +3796,7 @@ App::patch('/v1/messaging/messages/email/:messageId') throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); @@ -3933,7 +3933,7 @@ App::patch('/v1/messaging/messages/sms/:messageId') 'region' => $project->getAttribute('region'), 'resourceType' => 'message', 'resourceId' => $message->getId(), - 'resourceInternalId' => $message->getInternalId(), + 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), 'projectId' => $project->getId(), 'schedule' => $scheduledAt, @@ -4107,7 +4107,7 @@ App::patch('/v1/messaging/messages/push/:messageId') 'region' => $project->getAttribute('region'), 'resourceType' => 'message', 'resourceId' => $message->getId(), - 'resourceInternalId' => $message->getInternalId(), + 'resourceInternalId' => $message->getSequence(), 'resourceUpdatedAt' => DateTime::now(), 'projectId' => $project->getId(), 'schedule' => $scheduledAt, @@ -4210,7 +4210,7 @@ App::patch('/v1/messaging/messages/push/:messageId') throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index 494ccfcaac..85751811ba 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -345,7 +345,7 @@ App::post('/v1/migrations/csv') throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } @@ -361,7 +361,7 @@ App::post('/v1/migrations/csv') $hasCompression = $compression !== Compression::NONE; $migrationId = ID::unique(); - $newPath = $deviceForImports->getPath('/' . $migrationId . '_' . $fileId . '.csv'); + $newPath = $deviceForImports->getPath($migrationId . '_' . $fileId . '.csv'); if ($hasEncryption || $hasCompression) { $source = $deviceForFiles->read($path); @@ -410,8 +410,8 @@ App::post('/v1/migrations/csv') 'resources' => $resources, 'resourceId' => $resourceId, 'resourceType' => Resource::TYPE_DATABASE, - 'statusCounters' => [], - 'resourceData' => [], + 'statusCounters' => '{}', + 'resourceData' => '{}', 'errors' => [], 'options' => [ 'path' => $newPath, diff --git a/app/controllers/api/project.php b/app/controllers/api/project.php index 047179b888..d09470ff39 100644 --- a/app/controllers/api/project.php +++ b/app/controllers/api/project.php @@ -150,7 +150,7 @@ App::get('/v1/project/usage') $executionsBreakdown = array_map(function ($function) use ($dbForProject) { $id = $function->getId(); $name = $function->getAttribute('name'); - $metric = str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS); + $metric = str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS); $value = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), Query::equal('period', ['inf']) @@ -166,7 +166,7 @@ App::get('/v1/project/usage') $executionsMbSecondsBreakdown = array_map(function ($function) use ($dbForProject) { $id = $function->getId(); $name = $function->getAttribute('name'); - $metric = str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS); + $metric = str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS); $value = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), Query::equal('period', ['inf']) @@ -182,7 +182,7 @@ App::get('/v1/project/usage') $buildsMbSecondsBreakdown = array_map(function ($function) use ($dbForProject) { $id = $function->getId(); $name = $function->getAttribute('name'); - $metric = str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_MB_SECONDS); + $metric = str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_MB_SECONDS); $value = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), Query::equal('period', ['inf']) @@ -198,7 +198,7 @@ App::get('/v1/project/usage') $bucketsBreakdown = array_map(function ($bucket) use ($dbForProject) { $id = $bucket->getId(); $name = $bucket->getAttribute('name'); - $metric = str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES_STORAGE); + $metric = str_replace('{bucketInternalId}', $bucket->getSequence(), METRIC_BUCKET_ID_FILES_STORAGE); $value = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), Query::equal('period', ['inf']) @@ -214,7 +214,7 @@ App::get('/v1/project/usage') $databasesStorageBreakdown = array_map(function ($database) use ($dbForProject) { $id = $database->getId(); $name = $database->getAttribute('name'); - $metric = str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_STORAGE); + $metric = str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_STORAGE); $value = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), @@ -231,13 +231,13 @@ App::get('/v1/project/usage') $functionsStorageBreakdown = array_map(function ($function) use ($dbForProject) { $id = $function->getId(); $name = $function->getAttribute('name'); - $deploymentMetric = str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS_STORAGE); + $deploymentMetric = str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS_STORAGE); $deploymentValue = $dbForProject->findOne('stats', [ Query::equal('metric', [$deploymentMetric]), Query::equal('period', ['inf']) ]); - $buildMetric = str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE); + $buildMetric = str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE); $buildValue = $dbForProject->findOne('stats', [ Query::equal('metric', [$buildMetric]), Query::equal('period', ['inf']) @@ -255,7 +255,7 @@ App::get('/v1/project/usage') $executionsMbSecondsBreakdown = array_map(function ($function) use ($dbForProject) { $id = $function->getId(); $name = $function->getAttribute('name'); - $metric = str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS); + $metric = str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS); $value = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), Query::equal('period', ['inf']) @@ -271,7 +271,7 @@ App::get('/v1/project/usage') $buildsMbSecondsBreakdown = array_map(function ($function) use ($dbForProject) { $id = $function->getId(); $name = $function->getAttribute('name'); - $metric = str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_MB_SECONDS); + $metric = str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_MB_SECONDS); $value = $dbForProject->findOne('stats', [ Query::equal('metric', [$metric]), Query::equal('period', ['inf']) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 5eda8e9a0e..e583503237 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -8,8 +8,8 @@ use Appwrite\Event\Mail; use Appwrite\Event\Validator\Event; use Appwrite\Extend\Exception; use Appwrite\Hooks\Hooks; +use Appwrite\Network\Platform; use Appwrite\Network\Validator\Email; -use Appwrite\Network\Validator\Origin; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; @@ -182,7 +182,7 @@ App::post('/v1/projects') Permission::delete(Role::team(ID::custom($teamId), 'developer')), ], 'name' => $name, - 'teamInternalId' => $team->getInternalId(), + 'teamInternalId' => $team->getSequence(), 'teamId' => $team->getId(), 'region' => $region, 'description' => $description, @@ -230,13 +230,13 @@ App::post('/v1/projects') if ($sharedTables) { $dbForProject ->setSharedTables(true) - ->setTenant($sharedTablesV1 ? $project->getInternalId() : null) + ->setTenant($sharedTablesV1 ? (int)$project->getSequence() : null) ->setNamespace($dsn->getParam('namespace')); } else { $dbForProject ->setSharedTables(false) ->setTenant(null) - ->setNamespace('_' . $project->getInternalId()); + ->setNamespace('_' . $project->getSequence()); } $create = true; @@ -504,12 +504,12 @@ App::patch('/v1/projects/:projectId/team') $project ->setAttribute('teamId', $teamId) - ->setAttribute('teamInternalId', $team->getInternalId()) + ->setAttribute('teamInternalId', $team->getSequence()) ->setAttribute('$permissions', $permissions); $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project); $installations = $dbForPlatform->find('installations', [ - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), ]); foreach ($installations as $installation) { $installation->getAttribute('$permissions', $permissions); @@ -517,7 +517,7 @@ App::patch('/v1/projects/:projectId/team') } $repositories = $dbForPlatform->find('repositories', [ - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), ]); foreach ($repositories as $repository) { $repository->getAttribute('$permissions', $permissions); @@ -525,7 +525,7 @@ App::patch('/v1/projects/:projectId/team') } $vcsComments = $dbForPlatform->find('vcsComments', [ - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), ]); foreach ($vcsComments as $vcsComment) { $vcsComment->getAttribute('$permissions', $permissions); @@ -1229,7 +1229,7 @@ App::post('/v1/projects/:projectId/webhooks') Permission::update(Role::any()), Permission::delete(Role::any()), ], - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'projectId' => $project->getId(), 'name' => $name, 'events' => $events, @@ -1279,7 +1279,7 @@ App::get('/v1/projects/:projectId/webhooks') } $webhooks = $dbForPlatform->find('webhooks', [ - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), Query::limit(5000), ]); @@ -1320,7 +1320,7 @@ App::get('/v1/projects/:projectId/webhooks/:webhookId') $webhook = $dbForPlatform->findOne('webhooks', [ Query::equal('$id', [$webhookId]), - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), ]); if ($webhook->isEmpty()) { @@ -1370,7 +1370,7 @@ App::put('/v1/projects/:projectId/webhooks/:webhookId') $webhook = $dbForPlatform->findOne('webhooks', [ Query::equal('$id', [$webhookId]), - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), ]); if ($webhook->isEmpty()) { @@ -1427,7 +1427,7 @@ App::patch('/v1/projects/:projectId/webhooks/:webhookId/signature') $webhook = $dbForPlatform->findOne('webhooks', [ Query::equal('$id', [$webhookId]), - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), ]); if ($webhook->isEmpty()) { @@ -1474,7 +1474,7 @@ App::delete('/v1/projects/:projectId/webhooks/:webhookId') $webhook = $dbForPlatform->findOne('webhooks', [ Query::equal('$id', [$webhookId]), - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), ]); if ($webhook->isEmpty()) { @@ -1528,7 +1528,7 @@ App::post('/v1/projects/:projectId/keys') Permission::update(Role::any()), Permission::delete(Role::any()), ], - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'projectId' => $project->getId(), 'name' => $name, 'scopes' => $scopes, @@ -1576,7 +1576,7 @@ App::get('/v1/projects/:projectId/keys') } $keys = $dbForPlatform->find('keys', [ - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), Query::limit(5000), ]); @@ -1617,7 +1617,7 @@ App::get('/v1/projects/:projectId/keys/:keyId') $key = $dbForPlatform->findOne('keys', [ Query::equal('$id', [$keyId]), - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), ]); if ($key->isEmpty()) { @@ -1661,7 +1661,7 @@ App::put('/v1/projects/:projectId/keys/:keyId') $key = $dbForPlatform->findOne('keys', [ Query::equal('$id', [$keyId]), - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), ]); if ($key->isEmpty()) { @@ -1712,7 +1712,7 @@ App::delete('/v1/projects/:projectId/keys/:keyId') $key = $dbForPlatform->findOne('keys', [ Query::equal('$id', [$keyId]), - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), ]); if ($key->isEmpty()) { @@ -1790,7 +1790,7 @@ App::post('/v1/projects/:projectId/platforms') ] )) ->param('projectId', '', new UID(), 'Project unique ID.') - ->param('type', null, new WhiteList([Origin::CLIENT_TYPE_WEB, Origin::CLIENT_TYPE_FLUTTER_WEB, Origin::CLIENT_TYPE_FLUTTER_IOS, Origin::CLIENT_TYPE_FLUTTER_ANDROID, Origin::CLIENT_TYPE_FLUTTER_LINUX, Origin::CLIENT_TYPE_FLUTTER_MACOS, Origin::CLIENT_TYPE_FLUTTER_WINDOWS, Origin::CLIENT_TYPE_APPLE_IOS, Origin::CLIENT_TYPE_APPLE_MACOS, Origin::CLIENT_TYPE_APPLE_WATCHOS, Origin::CLIENT_TYPE_APPLE_TVOS, Origin::CLIENT_TYPE_ANDROID, Origin::CLIENT_TYPE_UNITY, Origin::CLIENT_TYPE_REACT_NATIVE_IOS, Origin::CLIENT_TYPE_REACT_NATIVE_ANDROID], true), 'Platform type.') + ->param('type', null, new WhiteList([Platform::TYPE_WEB, Platform::TYPE_FLUTTER_WEB, Platform::TYPE_FLUTTER_IOS, Platform::TYPE_FLUTTER_ANDROID, Platform::TYPE_FLUTTER_LINUX, Platform::TYPE_FLUTTER_MACOS, Platform::TYPE_FLUTTER_WINDOWS, Platform::TYPE_APPLE_IOS, Platform::TYPE_APPLE_MACOS, Platform::TYPE_APPLE_WATCHOS, Platform::TYPE_APPLE_TVOS, Platform::TYPE_ANDROID, Platform::TYPE_UNITY, Platform::TYPE_REACT_NATIVE_IOS, Platform::TYPE_REACT_NATIVE_ANDROID], 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 or macOS. Max length: 256 chars.', true) ->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true) @@ -1811,7 +1811,7 @@ App::post('/v1/projects/:projectId/platforms') Permission::update(Role::any()), Permission::delete(Role::any()), ], - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'projectId' => $project->getId(), 'type' => $type, 'name' => $name, @@ -1858,7 +1858,7 @@ App::get('/v1/projects/:projectId/platforms') } $platforms = $dbForPlatform->find('platforms', [ - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), Query::limit(5000), ]); @@ -1899,7 +1899,7 @@ App::get('/v1/projects/:projectId/platforms/:platformId') $platform = $dbForPlatform->findOne('platforms', [ Query::equal('$id', [$platformId]), - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), ]); if ($platform->isEmpty()) { @@ -1943,7 +1943,7 @@ App::put('/v1/projects/:projectId/platforms/:platformId') $platform = $dbForPlatform->findOne('platforms', [ Query::equal('$id', [$platformId]), - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), ]); if ($platform->isEmpty()) { @@ -1997,7 +1997,7 @@ App::delete('/v1/projects/:projectId/platforms/:platformId') $platform = $dbForPlatform->findOne('platforms', [ Query::equal('$id', [$platformId]), - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), ]); if ($platform->isEmpty()) { @@ -2274,6 +2274,7 @@ App::get('/v1/projects/:projectId/templates/email/:type/:locale') ->setParam('{{footer}}', $localeObj->getText("emails.{$type}.footer")) ->setParam('{{body}}', $localeObj->getText('emails.' . $type . '.body'), escapeHtml: false) ->setParam('{{thanks}}', $localeObj->getText("emails.{$type}.thanks")) + ->setParam('{{buttonText}}', $localeObj->getText("emails.{$type}.buttonText")) ->setParam('{{signature}}', $localeObj->getText("emails.{$type}.signature")) ->setParam('{{direction}}', $localeObj->getText('settings.direction')); $message = $message->render(); diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index c1c8d8e4a0..417ea602ba 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -58,7 +58,7 @@ App::get('/v1/proxy/rules') $queries[] = Query::search('search', $search); } - $queries[] = Query::equal('projectInternalId', [$project->getInternalId()]); + $queries[] = Query::equal('projectInternalId', [$project->getSequence()]); /** * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries @@ -124,7 +124,7 @@ App::get('/v1/proxy/rules/:ruleId') ->action(function (string $ruleId, Response $response, Document $project, Database $dbForPlatform) { $rule = $dbForPlatform->getDocument('rules', $ruleId); - if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getInternalId()) { + if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getSequence()) { throw new Exception(Exception::RULE_NOT_FOUND); } @@ -165,7 +165,7 @@ App::delete('/v1/proxy/rules/:ruleId') ->action(function (string $ruleId, Response $response, Document $project, Database $dbForPlatform, Delete $queueForDeletes, Event $queueForEvents) { $rule = $dbForPlatform->getDocument('rules', $ruleId); - if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getInternalId()) { + if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getSequence()) { throw new Exception(Exception::RULE_NOT_FOUND); } @@ -210,7 +210,7 @@ App::patch('/v1/proxy/rules/:ruleId/verification') ->action(function (string $ruleId, Response $response, Certificate $queueForCertificates, Event $queueForEvents, Document $project, Database $dbForPlatform, Log $log) { $rule = $dbForPlatform->getDocument('rules', $ruleId); - if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getInternalId()) { + if ($rule->isEmpty() || $rule->getAttribute('projectInternalId') !== $project->getSequence()) { throw new Exception(Exception::RULE_NOT_FOUND); } diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index b3b8fb906a..c6e242296b 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -18,6 +18,7 @@ use Appwrite\Utopia\Database\Validator\Queries\Buckets; use Appwrite\Utopia\Database\Validator\Queries\Files; use Appwrite\Utopia\Response; use Utopia\App; +use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\DateTime; @@ -145,7 +146,7 @@ App::post('/v1/storage/buckets') $bucket = $dbForProject->getDocument('buckets', $bucketId); - $dbForProject->createCollection('bucket_' . $bucket->getInternalId(), $attributes, $indexes, permissions: $permissions ?? [], documentSecurity: $fileSecurity); + $dbForProject->createCollection('bucket_' . $bucket->getSequence(), $attributes, $indexes, permissions: $permissions ?? [], documentSecurity: $fileSecurity); } catch (DuplicateException) { throw new Exception(Exception::STORAGE_BUCKET_ALREADY_EXISTS); } @@ -316,17 +317,17 @@ App::put('/v1/storage/buckets/:bucketId') $permissions = Permission::aggregate($permissions); $bucket = $dbForProject->updateDocument('buckets', $bucket->getId(), $bucket - ->setAttribute('name', $name) - ->setAttribute('$permissions', $permissions) - ->setAttribute('maximumFileSize', $maximumFileSize) - ->setAttribute('allowedFileExtensions', $allowedFileExtensions) - ->setAttribute('fileSecurity', $fileSecurity) - ->setAttribute('enabled', $enabled) - ->setAttribute('encryption', $encryption) - ->setAttribute('compression', $compression) - ->setAttribute('antivirus', $antivirus)); + ->setAttribute('name', $name) + ->setAttribute('$permissions', $permissions) + ->setAttribute('maximumFileSize', $maximumFileSize) + ->setAttribute('allowedFileExtensions', $allowedFileExtensions) + ->setAttribute('fileSecurity', $fileSecurity) + ->setAttribute('enabled', $enabled) + ->setAttribute('encryption', $encryption) + ->setAttribute('compression', $compression) + ->setAttribute('antivirus', $antivirus)); - $dbForProject->updateCollection('bucket_' . $bucket->getInternalId(), $permissions, $fileSecurity); + $dbForProject->updateCollection('bucket_' . $bucket->getSequence(), $permissions, $fileSecurity); $queueForEvents ->setParam('bucketId', $bucket->getId()); @@ -558,7 +559,7 @@ App::post('/v1/storage/buckets/:bucketId/files') $path = $deviceForFiles->getPath($fileId . '.' . \pathinfo($fileName, PATHINFO_EXTENSION)); $path = str_ireplace($deviceForFiles->getRoot(), $deviceForFiles->getRoot() . DIRECTORY_SEPARATOR . $bucket->getId(), $path); // Add bucket id to path after root - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); $metadata = ['content_type' => $deviceForLocal->getFileMimeType($fileTmpName)]; if (!$file->isEmpty()) { @@ -652,7 +653,7 @@ App::post('/v1/storage/buckets/:bucketId/files') '$id' => $fileId, '$permissions' => $permissions, 'bucketId' => $bucket->getId(), - 'bucketInternalId' => $bucket->getInternalId(), + 'bucketInternalId' => $bucket->getSequence(), 'name' => $fileName, 'path' => $path, 'signature' => $fileHash, @@ -671,7 +672,7 @@ App::post('/v1/storage/buckets/:bucketId/files') 'metadata' => $metadata, ]); - $file = $dbForProject->createDocument('bucket_' . $bucket->getInternalId(), $doc); + $file = $dbForProject->createDocument('bucket_' . $bucket->getSequence(), $doc); } else { $file = $file ->setAttribute('$permissions', $permissions) @@ -696,7 +697,7 @@ App::post('/v1/storage/buckets/:bucketId/files') if (!$validator->isValid($bucket->getCreate())) { throw new Exception(Exception::USER_UNAUTHORIZED); } - $file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file)); + $file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getSequence(), $fileId, $file)); } } else { if ($file->isEmpty()) { @@ -704,7 +705,7 @@ App::post('/v1/storage/buckets/:bucketId/files') '$id' => ID::custom($fileId), '$permissions' => $permissions, 'bucketId' => $bucket->getId(), - 'bucketInternalId' => $bucket->getInternalId(), + 'bucketInternalId' => $bucket->getSequence(), 'name' => $fileName, 'path' => $path, 'signature' => '', @@ -720,7 +721,7 @@ App::post('/v1/storage/buckets/:bucketId/files') ]); try { - $file = $dbForProject->createDocument('bucket_' . $bucket->getInternalId(), $doc); + $file = $dbForProject->createDocument('bucket_' . $bucket->getSequence(), $doc); } catch (NotFoundException) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } @@ -741,7 +742,7 @@ App::post('/v1/storage/buckets/:bucketId/files') } try { - $file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file)); + $file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getSequence(), $fileId, $file)); } catch (NotFoundException) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } @@ -826,9 +827,9 @@ App::get('/v1/storage/buckets/:bucketId/files') $fileId = $cursor->getValue(); if ($fileSecurity && !$valid) { - $cursorDocument = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + $cursorDocument = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { - $cursorDocument = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + $cursorDocument = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } if ($cursorDocument->isEmpty()) { @@ -842,11 +843,11 @@ App::get('/v1/storage/buckets/:bucketId/files') try { if ($fileSecurity && !$valid) { - $files = $dbForProject->find('bucket_' . $bucket->getInternalId(), $queries); - $total = $dbForProject->count('bucket_' . $bucket->getInternalId(), $filterQueries, APP_LIMIT_COUNT); + $files = $dbForProject->find('bucket_' . $bucket->getSequence(), $queries); + $total = $dbForProject->count('bucket_' . $bucket->getSequence(), $filterQueries, APP_LIMIT_COUNT); } else { - $files = Authorization::skip(fn () => $dbForProject->find('bucket_' . $bucket->getInternalId(), $queries)); - $total = Authorization::skip(fn () => $dbForProject->count('bucket_' . $bucket->getInternalId(), $filterQueries, APP_LIMIT_COUNT)); + $files = Authorization::skip(fn () => $dbForProject->find('bucket_' . $bucket->getSequence(), $queries)); + $total = Authorization::skip(fn () => $dbForProject->count('bucket_' . $bucket->getSequence(), $filterQueries, APP_LIMIT_COUNT)); } } catch (NotFoundException) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); @@ -902,9 +903,9 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId') } if ($fileSecurity && !$valid) { - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } if ($file->isEmpty()) { @@ -953,17 +954,20 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') ->param('output', '', new WhiteList(\array_keys(Config::getParam('storage-outputs')), true), 'Output format type (jpeg, jpg, png, gif and webp).', true) // NOTE: this is only for the sdk generator and is not used in the action below and is utilised in `resources.php` for `resourceToken`. ->param('token', '', new Text(512), 'File token for accessing this file.', true) + ->inject('request') ->inject('response') ->inject('dbForProject') ->inject('resourceToken') ->inject('deviceForFiles') ->inject('deviceForLocal') - ->action(function (string $bucketId, string $fileId, int $width, int $height, string $gravity, int $quality, int $borderWidth, string $borderColor, int $borderRadius, float $opacity, int $rotation, string $background, string $output, ?string $token, Response $response, Database $dbForProject, Document $resourceToken, Device $deviceForFiles, Device $deviceForLocal) { + ->inject('project') + ->action(function (string $bucketId, string $fileId, int $width, int $height, string $gravity, int $quality, int $borderWidth, string $borderColor, int $borderRadius, float $opacity, int $rotation, string $background, string $output, ?string $token, Request $request, Response $response, Database $dbForProject, Document $resourceToken, Device $deviceForFiles, Device $deviceForLocal, Document $project) { if (!\extension_loaded('imagick')) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Imagick extension is missing'); } + /* @type Document $bucket */ $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -973,7 +977,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getInternalId(); + $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getSequence(); $fileSecurity = $bucket->getAttribute('fileSecurity', false); $validator = new Authorization(Database::PERMISSION_READ); $valid = $validator->isValid($bucket->getRead()); @@ -982,12 +986,13 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') } if ($fileSecurity && !$valid && !$isToken) { - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + /* @type Document $file */ + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } - if (!$resourceToken->isEmpty() && $resourceToken->getAttribute('fileInternalId') !== $file->getInternalId()) { + if (!$resourceToken->isEmpty() && $resourceToken->getAttribute('fileInternalId') !== $file->getSequence()) { throw new Exception(Exception::USER_UNAUTHORIZED); } @@ -1004,7 +1009,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') $algorithm = $file->getAttribute('algorithm', Compression::NONE); $cipher = $file->getAttribute('openSSLCipher'); $mime = $file->getAttribute('mimeType'); - if (!\in_array($mime, $inputs) || $file->getAttribute('sizeActual') > (int) System::getEnv('_APP_STORAGE_PREVIEW_LIMIT', 20000000)) { + if (!\in_array($mime, $inputs) || $file->getAttribute('sizeActual') > (int) System::getEnv('_APP_STORAGE_PREVIEW_LIMIT', APP_STORAGE_READ_BUFFER)) { if (!\in_array($mime, $inputs)) { $path = (\array_key_exists($mime, $fileLogos)) ? $fileLogos[$mime] : $fileLogos['default']; } else { @@ -1035,8 +1040,12 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') $output = empty($type) ? (array_search($mime, $outputs) ?? 'jpg') : $type; } + $startTime = \microtime(true); + $source = $deviceForFiles->read($path); + $downloadTime = \microtime(true) - $startTime; + if (!empty($cipher)) { // Decrypt $source = OpenSSL::decrypt( $source, @@ -1048,6 +1057,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') ); } + $decryptionTime = \microtime(true) - $startTime - $downloadTime; + switch ($algorithm) { case Compression::ZSTD: $compressor = new Zstd(); @@ -1059,6 +1070,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') break; } + $decompressionTime = \microtime(true) - $startTime - $downloadTime - $decryptionTime; + try { $image = new Image($source); } catch (ImagickException $e) { @@ -1089,6 +1102,12 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview') $data = $image->output($output, $quality); + $renderingTime = \microtime(true) - $startTime - $downloadTime - $decryptionTime - $decompressionTime; + + $totalTime = \microtime(true) - $startTime; + + Console::info("File preview rendered,project=" . $project->getId() . ",bucket=" . $bucketId . ",file=" . $file->getId() . ",uri=" . $request->getURI() . ",total=" . $totalTime . ",rendering=" . $renderingTime . ",decryption=" . $decryptionTime . ",decompression=" . $decompressionTime . ",download=" . $downloadTime); + $contentType = (\array_key_exists($output, $outputs)) ? $outputs[$output] : $outputs['jpg']; //Do not update transformedAt if it's a console user @@ -1140,7 +1159,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') ->inject('resourceToken') ->inject('deviceForFiles') ->action(function (string $bucketId, string $fileId, ?string $token, Request $request, Response $response, Database $dbForProject, string $mode, Document $resourceToken, Device $deviceForFiles) { - + /* @type Document $bucket */ $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -1150,7 +1169,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getInternalId(); + $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getSequence(); $fileSecurity = $bucket->getAttribute('fileSecurity', false); $validator = new Authorization(Database::PERMISSION_READ); $valid = $validator->isValid($bucket->getRead()); @@ -1158,13 +1177,14 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') throw new Exception(Exception::USER_UNAUTHORIZED); } - if ($fileSecurity && !$valid) { - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + if ($fileSecurity && !$valid && !$isToken) { + $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + /* @type Document $file */ + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } - if (!$resourceToken->isEmpty() && $resourceToken->getAttribute('fileInternalId') !== $file->getInternalId()) { + if (!$resourceToken->isEmpty() && $resourceToken->getAttribute('fileInternalId') !== $file->getSequence()) { throw new Exception(Exception::USER_UNAUTHORIZED); } @@ -1178,13 +1198,6 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') throw new Exception(Exception::STORAGE_FILE_NOT_FOUND, 'File not found in ' . $path); } - $response - ->setContentType($file->getAttribute('mimeType')) - ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days - ->addHeader('X-Peak', \memory_get_peak_usage()) - ->addHeader('Content-Disposition', 'attachment; filename="' . $file->getAttribute('name', '') . '"') - ; - $size = $file->getAttribute('sizeOriginal', 0); $rangeHeader = $request->getHeader('range'); @@ -1193,7 +1206,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') $end = $request->getRangeEnd(); $unit = $request->getRangeUnit(); - if ($end === null) { + if ($end === null || $end - $start > APP_STORAGE_READ_BUFFER) { $end = min(($start + MAX_OUTPUT_CHUNK_SIZE - 1), ($size - 1)); } @@ -1208,6 +1221,13 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/download') ->setStatusCode(Response::STATUS_CODE_PARTIALCONTENT); } + $response + ->setContentType($file->getAttribute('mimeType')) + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days + ->addHeader('X-Peak', \memory_get_peak_usage()) + ->addHeader('Content-Disposition', 'attachment; filename="' . $file->getAttribute('name', '') . '"') + ; + $source = ''; if (!empty($file->getAttribute('openSSLCipher'))) { // Decrypt $source = $deviceForFiles->read($path); @@ -1300,6 +1320,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') ->inject('resourceToken') ->inject('deviceForFiles') ->action(function (string $bucketId, string $fileId, ?string $token, Response $response, Request $request, Database $dbForProject, string $mode, Document $resourceToken, Device $deviceForFiles) { + /* @type Document $bucket */ $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); $isAPIKey = Auth::isAppUser(Authorization::getRoles()); @@ -1309,7 +1330,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getInternalId(); + $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getSequence(); $fileSecurity = $bucket->getAttribute('fileSecurity', false); $validator = new Authorization(Database::PERMISSION_READ); $valid = $validator->isValid($bucket->getRead()); @@ -1317,13 +1338,14 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') throw new Exception(Exception::USER_UNAUTHORIZED); } - if ($fileSecurity && !$valid) { - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + if ($fileSecurity && !$valid && !$isToken) { + $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + /* @type Document $file */ + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } - if (!$resourceToken->isEmpty() && $resourceToken->getAttribute('fileInternalId') !== $file->getInternalId()) { + if (!$resourceToken->isEmpty() && $resourceToken->getAttribute('fileInternalId') !== $file->getSequence()) { throw new Exception(Exception::USER_UNAUTHORIZED); } @@ -1345,15 +1367,6 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') $contentType = $file->getAttribute('mimeType'); } - $response - ->setContentType($contentType) - ->addHeader('Content-Security-Policy', 'script-src none;') - ->addHeader('X-Content-Type-Options', 'nosniff') - ->addHeader('Content-Disposition', 'inline; filename="' . $file->getAttribute('name', '') . '"') - ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days - ->addHeader('X-Peak', \memory_get_peak_usage()) - ; - $size = $file->getAttribute('sizeOriginal', 0); $rangeHeader = $request->getHeader('range'); @@ -1362,8 +1375,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') $end = $request->getRangeEnd(); $unit = $request->getRangeUnit(); - if ($end === null) { - $end = min(($start + 2000000 - 1), ($size - 1)); + if ($end === null || $end - $start > APP_STORAGE_READ_BUFFER) { + $end = min(($start + APP_STORAGE_READ_BUFFER - 1), ($size - 1)); } if ($unit != 'bytes' || $start >= $end || $end >= $size) { @@ -1377,6 +1390,15 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/view') ->setStatusCode(Response::STATUS_CODE_PARTIALCONTENT); } + $response + ->setContentType($contentType) + ->addHeader('Content-Security-Policy', 'script-src none;') + ->addHeader('X-Content-Type-Options', 'nosniff') + ->addHeader('Content-Disposition', 'inline; filename="' . $file->getAttribute('name', '') . '"') + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days + ->addHeader('X-Peak', \memory_get_peak_usage()) + ; + $source = ''; if (!empty($file->getAttribute('openSSLCipher'))) { // Decrypt $source = $deviceForFiles->read($path); @@ -1478,7 +1500,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/push') throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); } - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); @@ -1498,14 +1520,6 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/push') $contentType = $file->getAttribute('mimeType'); } - $response - ->setContentType($contentType) - ->addHeader('Content-Security-Policy', 'script-src none;') - ->addHeader('X-Content-Type-Options', 'nosniff') - ->addHeader('Content-Disposition', 'inline; filename="' . $file->getAttribute('name', '') . '"') - ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days - ->addHeader('X-Peak', \memory_get_peak_usage()); - $size = $file->getAttribute('sizeOriginal', 0); $rangeHeader = $request->getHeader('range'); @@ -1514,8 +1528,8 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/push') $end = $request->getRangeEnd(); $unit = $request->getRangeUnit(); - if ($end === null) { - $end = min(($start + 2000000 - 1), ($size - 1)); + if ($end === null || $end - $start > APP_STORAGE_READ_BUFFER) { + $end = min(($start + APP_STORAGE_READ_BUFFER - 1), ($size - 1)); } if ($unit != 'bytes' || $start >= $end || $end >= $size) { @@ -1529,6 +1543,14 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/push') ->setStatusCode(Response::STATUS_CODE_PARTIALCONTENT); } + $response + ->setContentType($contentType) + ->addHeader('Content-Security-Policy', 'script-src none;') + ->addHeader('X-Content-Type-Options', 'nosniff') + ->addHeader('Content-Disposition', 'inline; filename="' . $file->getAttribute('name', '') . '"') + ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days + ->addHeader('X-Peak', \memory_get_peak_usage()); + $source = ''; if (!empty($file->getAttribute('openSSLCipher'))) { // Decrypt $source = $deviceForFiles->read($path); @@ -1643,7 +1665,7 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId') } // Read permission should not be required for update - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); @@ -1689,9 +1711,9 @@ App::put('/v1/storage/buckets/:bucketId/files/:fileId') try { if ($fileSecurity && !$valid) { - $file = $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file); + $file = $dbForProject->updateDocument('bucket_' . $bucket->getSequence(), $fileId, $file); } else { - $file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getInternalId(), $fileId, $file)); + $file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getSequence(), $fileId, $file)); } } catch (NotFoundException) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); @@ -1757,7 +1779,7 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') } // Read permission should not be required for delete - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); @@ -1787,9 +1809,9 @@ App::delete('/v1/storage/buckets/:bucketId/files/:fileId') try { if ($fileSecurity && !$valid) { - $deleted = $dbForProject->deleteDocument('bucket_' . $bucket->getInternalId(), $fileId); + $deleted = $dbForProject->deleteDocument('bucket_' . $bucket->getSequence(), $fileId); } else { - $deleted = Authorization::skip(fn () => $dbForProject->deleteDocument('bucket_' . $bucket->getInternalId(), $fileId)); + $deleted = Authorization::skip(fn () => $dbForProject->deleteDocument('bucket_' . $bucket->getSequence(), $fileId)); } } catch (NotFoundException) { throw new Exception(Exception::STORAGE_BUCKET_NOT_FOUND); @@ -1937,14 +1959,14 @@ App::get('/v1/storage/:bucketId/usage') $stats = $usage = []; $days = $periods[$range]; $metrics = [ - str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES), - str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES_STORAGE), - str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES_IMAGES_TRANSFORMED), + str_replace('{bucketInternalId}', $bucket->getSequence(), METRIC_BUCKET_ID_FILES), + str_replace('{bucketInternalId}', $bucket->getSequence(), METRIC_BUCKET_ID_FILES_STORAGE), + str_replace('{bucketInternalId}', $bucket->getSequence(), METRIC_BUCKET_ID_FILES_IMAGES_TRANSFORMED), ]; Authorization::skip(function () use ($dbForProject, $dbForLogs, $bucket, $days, $metrics, &$stats) { foreach ($metrics as $metric) { - $db = ($metric === str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES_IMAGES_TRANSFORMED)) + $db = ($metric === str_replace('{bucketInternalId}', $bucket->getSequence(), METRIC_BUCKET_ID_FILES_IMAGES_TRANSFORMED)) ? $dbForLogs : $dbForProject; diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 49d9005c54..98ec49ca48 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -11,6 +11,7 @@ use Appwrite\Event\Messaging; use Appwrite\Event\StatsUsage; use Appwrite\Extend\Exception; use Appwrite\Network\Validator\Email; +use Appwrite\Network\Validator\Redirect; use Appwrite\Platform\Workers\Deletes; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; @@ -50,7 +51,6 @@ use Utopia\Locale\Locale; use Utopia\System\System; use Utopia\Validator\ArrayList; use Utopia\Validator\Assoc; -use Utopia\Validator\Host; use Utopia\Validator\Text; use Utopia\Validator\URL; use Utopia\Validator\WhiteList; @@ -123,9 +123,9 @@ App::post('/v1/teams') Permission::delete(Role::team($team->getId(), 'owner')), ], 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'teamId' => $team->getId(), - 'teamInternalId' => $team->getInternalId(), + 'teamInternalId' => $team->getSequence(), 'roles' => $roles, 'invited' => DateTime::now(), 'joined' => DateTime::now(), @@ -466,7 +466,7 @@ App::post('/v1/teams/:teamId/memberships') } return new ArrayList(new Key(), APP_LIMIT_ARRAY_PARAMS_SIZE); }, '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](https://appwrite.io/docs/permissions). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 32 characters long.', false, ['project']) - ->param('url', '', fn ($clients, $devKey) => $devKey->isEmpty() ? new Host($clients) : new URL(), 'URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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', 'devKey']) // TODO add our own built-in confirm page + ->param('url', '', fn ($platforms, $devKey) => $devKey->isEmpty() ? new Redirect($platforms) : new URL(), 'URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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, ['platforms', 'devKey']) // TODO add our own built-in confirm page ->param('name', '', new Text(128), 'Name of the new team member. Max length: 128 chars.', true) ->inject('response') ->inject('project') @@ -595,8 +595,8 @@ App::post('/v1/teams/:teamId/memberships') } $membership = $dbForProject->findOne('memberships', [ - Query::equal('userInternalId', [$invitee->getInternalId()]), - Query::equal('teamInternalId', [$team->getInternalId()]), + Query::equal('userInternalId', [$invitee->getSequence()]), + Query::equal('teamInternalId', [$team->getSequence()]), ]); $secret = Auth::tokenGenerator(); @@ -612,9 +612,9 @@ App::post('/v1/teams/:teamId/memberships') Permission::delete(Role::team($team->getId(), 'owner')), ], 'userId' => $invitee->getId(), - 'userInternalId' => $invitee->getInternalId(), + 'userInternalId' => $invitee->getSequence(), 'teamId' => $team->getId(), - 'teamInternalId' => $team->getInternalId(), + 'teamInternalId' => $team->getSequence(), 'roles' => $roles, 'invited' => DateTime::now(), 'joined' => ($isPrivilegedUser || $isAppUser) ? DateTime::now() : null, @@ -666,6 +666,7 @@ App::post('/v1/teams/:teamId/memberships') ->setParam('{{hello}}', $locale->getText("emails.invitation.hello")) ->setParam('{{footer}}', $locale->getText("emails.invitation.footer")) ->setParam('{{thanks}}', $locale->getText("emails.invitation.thanks")) + ->setParam('{{buttonText}}', $locale->getText("emails.invitation.buttonText")) ->setParam('{{signature}}', $locale->getText("emails.invitation.signature")); $body = $message->render(); @@ -842,7 +843,7 @@ App::get('/v1/teams/:teamId/memberships') } // Set internal queries - $queries[] = Query::equal('teamInternalId', [$team->getInternalId()]); + $queries[] = Query::equal('teamInternalId', [$team->getSequence()]); /** * Get cursor document if there was a cursor query, we use array_filter and reset for reference $cursor to $queries @@ -1092,15 +1093,18 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId') collection: 'memberships', queries: [ Query::contains('roles', ['owner']), - Query::equal('teamInternalId', [$team->getInternalId()]) + Query::equal('teamInternalId', [$team->getSequence()]) ], max: 2 ); + // Is the role change being requested by the user on their own membership? + $isCurrentUserAnOwner = $user->getSequence() === $membership->getAttribute('userInternalId'); + // Prevent role change if there's only one owner left, - // the requester is that owner, and the new `$roles` no longer include 'owner'! - if ($ownersCount === 1 && $isOwner && !\in_array('owner', $roles)) { - throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'There must be at least one owner in the organization.'); + // the requester is that owner, and the new `$roles` no longer include 'owner' + if ($ownersCount === 1 && $isOwner && $isCurrentUserAnOwner && !\in_array('owner', $roles)) { + throw new Exception(Exception::MEMBERSHIP_DOWNGRADE_PROHIBITED, 'There must be at least one owner in the organization.'); } } @@ -1180,7 +1184,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') throw new Exception(Exception::TEAM_NOT_FOUND); } - if ($membership->getAttribute('teamInternalId') !== $team->getInternalId()) { + if ($membership->getAttribute('teamInternalId') !== $team->getSequence()) { throw new Exception(Exception::TEAM_MEMBERSHIP_MISMATCH); } @@ -1197,7 +1201,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') $user->setAttributes($dbForProject->getDocument('users', $userId)->getArrayCopy()); // Get user } - if ($membership->getAttribute('userInternalId') !== $user->getInternalId()) { + if ($membership->getAttribute('userInternalId') !== $user->getSequence()) { throw new Exception(Exception::TEAM_INVITE_MISMATCH, 'Invite does not belong to current user (' . $user->getAttribute('email') . ')'); } @@ -1229,7 +1233,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId/status') Permission::delete(Role::user($user->getId())), ], 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'provider' => Auth::SESSION_PROVIDER_EMAIL, 'providerUid' => $user->getAttribute('email'), 'secret' => Auth::hash($secret), // One way hash encryption to protect DB leak @@ -1315,10 +1319,12 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') )) ->param('teamId', '', new UID(), 'Team ID.') ->param('membershipId', '', new UID(), 'Membership ID.') + ->inject('user') + ->inject('project') ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->action(function (string $teamId, string $membershipId, Response $response, Database $dbForProject, Event $queueForEvents) { + ->action(function (string $teamId, string $membershipId, Document $user, Document $project, Response $response, Database $dbForProject, Event $queueForEvents) { $membership = $dbForProject->getDocument('memberships', $membershipId); @@ -1326,9 +1332,9 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') throw new Exception(Exception::TEAM_INVITE_NOT_FOUND); } - $user = $dbForProject->getDocument('users', $membership->getAttribute('userId')); + $profile = $dbForProject->getDocument('users', $membership->getAttribute('userId')); - if ($user->isEmpty()) { + if ($profile->isEmpty()) { throw new Exception(Exception::USER_NOT_FOUND); } @@ -1338,10 +1344,33 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') throw new Exception(Exception::TEAM_NOT_FOUND); } - if ($membership->getAttribute('teamInternalId') !== $team->getInternalId()) { + if ($membership->getAttribute('teamInternalId') !== $team->getSequence()) { throw new Exception(Exception::TEAM_MEMBERSHIP_MISMATCH); } + if ($project->getId() === 'console') { + // Quick check: + // fetch up to 2 owners to determine if only one exists + $ownersCount = $dbForProject->count( + collection: 'memberships', + queries: [ + Query::contains('roles', ['owner']), + Query::equal('teamInternalId', [$team->getSequence()]) + ], + max: 2 + ); + + // Is the deletion being requested by the user on their own membership and they are also the owner? + $isSelfOwner = + in_array('owner', $membership->getAttribute('roles')) && + $membership->getAttribute('userInternalId') === $user->getSequence(); + + if ($ownersCount === 1 && $isSelfOwner) { + /* Prevent removal if the user is the only owner. */ + throw new Exception(Exception::MEMBERSHIP_DELETION_PROHIBITED, 'There must be at least one owner in the organization.'); + } + } + try { $dbForProject->deleteDocument('memberships', $membership->getId()); } catch (AuthorizationException $exception) { @@ -1350,15 +1379,15 @@ App::delete('/v1/teams/:teamId/memberships/:membershipId') throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed to remove membership from DB'); } - $dbForProject->purgeCachedDocument('users', $user->getId()); + $dbForProject->purgeCachedDocument('users', $profile->getId()); if ($membership->getAttribute('confirm')) { // Count only confirmed members Authorization::skip(fn () => $dbForProject->decreaseDocumentAttribute('teams', $team->getId(), 'total', 1, 0)); } $queueForEvents - ->setParam('userId', $user->getId()) ->setParam('teamId', $team->getId()) + ->setParam('userId', $profile->getId()) ->setParam('membershipId', $membership->getId()) ->setPayload($response->output($membership, Response::MODEL_MEMBERSHIP)) ; diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index bc9de0fd42..b3ae17dc91 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -140,7 +140,7 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e Permission::delete(Role::user($user->getId())), ], 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'providerType' => 'email', 'identifier' => $email, ])); @@ -164,7 +164,7 @@ function createUser(string $hash, mixed $hashOptions, string $userId, ?string $e Permission::delete(Role::user($user->getId())), ], 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'providerType' => 'sms', 'identifier' => $phone, ])); @@ -564,10 +564,10 @@ App::post('/v1/users/:userId/targets') Permission::delete(Role::user($user->getId())), ], 'providerId' => empty($provider->getId()) ? null : $provider->getId(), - 'providerInternalId' => $provider->isEmpty() ? null : $provider->getInternalId(), + 'providerInternalId' => $provider->isEmpty() ? null : $provider->getSequence(), 'providerType' => $providerType, 'userId' => $userId, - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'identifier' => $identifier, 'name' => ($name !== '') ? $name : null, ])); @@ -649,6 +649,8 @@ App::get('/v1/users') $total = $dbForProject->count('users', $filterQueries, APP_LIMIT_COUNT); } catch (OrderException $e) { throw new Exception(Exception::DATABASE_QUERY_ORDER_NULL, "The order attribute '{$e->getAttribute()}' had a null value. Cursor pagination requires all documents order attribute values are non-null."); + } catch (QueryException $e) { + throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } $response->dynamic(new Document([ 'users' => $users, @@ -846,7 +848,7 @@ App::get('/v1/users/:userId/memberships') } // Set internal queries - $queries[] = Query::equal('userInternalId', [$user->getInternalId()]); + $queries[] = Query::equal('userInternalId', [$user->getSequence()]); $memberships = array_map(function ($membership) use ($dbForProject, $user) { $team = $dbForProject->getDocument('teams', $membership->getAttribute('teamId')); @@ -910,7 +912,7 @@ App::get('/v1/users/:userId/logs') $audit = new Audit($dbForProject); - $logs = $audit->getLogsByUser($user->getInternalId(), $queries); + $logs = $audit->getLogsByUser($user->getSequence(), $queries); $output = []; @@ -957,7 +959,7 @@ App::get('/v1/users/:userId/logs') } $response->dynamic(new Document([ - 'total' => $audit->countLogsByUser($user->getInternalId(), $queries), + 'total' => $audit->countLogsByUser($user->getSequence(), $queries), 'logs' => $output, ]), Response::MODEL_LOG_LIST); }); @@ -980,7 +982,7 @@ App::get('/v1/users/:userId/targets') ] )) ->param('userId', '', new UID(), 'User ID.') - ->param('queries', [], new Targets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Users::ALLOWED_ATTRIBUTES), true) + ->param('queries', [], new Targets(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Targets::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('dbForProject') ->action(function (string $userId, array $queries, Response $response, Database $dbForProject) { @@ -1396,7 +1398,7 @@ App::patch('/v1/users/:userId/email') // Makes sure this email is not already used in another identity $identityWithMatchingEmail = $dbForProject->findOne('identities', [ Query::equal('providerEmail', [$email]), - Query::notEqual('userInternalId', $user->getInternalId()), + Query::notEqual('userInternalId', $user->getSequence()), ]); if (!$identityWithMatchingEmail->isEmpty()) { throw new Exception(Exception::USER_EMAIL_ALREADY_EXISTS); @@ -1440,7 +1442,7 @@ App::patch('/v1/users/:userId/email') Permission::delete(Role::user($user->getId())), ], 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'providerType' => 'email', 'identifier' => $email, ])); @@ -1529,7 +1531,7 @@ App::patch('/v1/users/:userId/phone') Permission::delete(Role::user($user->getId())), ], 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'providerType' => 'sms', 'identifier' => $number, ])); @@ -1711,7 +1713,7 @@ App::patch('/v1/users/:userId/targets/:targetId') $target ->setAttribute('providerId', $provider->getId()) - ->setAttribute('providerInternalId', $provider->getInternalId()); + ->setAttribute('providerInternalId', $provider->getSequence()); } if ($name) { @@ -2051,7 +2053,7 @@ App::post('/v1/users/:userId/sessions') [ '$id' => ID::unique(), 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'provider' => Auth::SESSION_PROVIDER_SERVER, 'secret' => Auth::hash($secret), // One way hash encryption to protect DB leak 'userAgent' => $request->getUserAgent('UNKNOWN'), @@ -2131,7 +2133,7 @@ App::post('/v1/users/:userId/tokens') $token = new Document([ '$id' => ID::unique(), 'userId' => $user->getId(), - 'userInternalId' => $user->getInternalId(), + 'userInternalId' => $user->getSequence(), 'type' => Auth::TOKEN_TYPE_GENERIC, 'secret' => Auth::hash($secret), 'expire' => $expire, @@ -2293,8 +2295,8 @@ App::delete('/v1/users/:userId') $clone = clone $user; $dbForProject->deleteDocument('users', $userId); - DeleteIdentities::delete($dbForProject, Query::equal('userInternalId', [$user->getInternalId()])); - DeleteTargets::delete($dbForProject, Query::equal('userInternalId', [$user->getInternalId()])); + DeleteIdentities::delete($dbForProject, Query::equal('userInternalId', [$user->getSequence()])); + DeleteTargets::delete($dbForProject, Query::equal('userInternalId', [$user->getSequence()])); $queueForDeletes ->setType(DELETE_TYPE_DOCUMENT) diff --git a/app/controllers/api/vcs.php b/app/controllers/api/vcs.php index 571c7ddca7..a8efd093b5 100644 --- a/app/controllers/api/vcs.php +++ b/app/controllers/api/vcs.php @@ -4,6 +4,7 @@ use Appwrite\Auth\OAuth2\Github as OAuth2Github; use Appwrite\Event\Build; use Appwrite\Event\Delete; use Appwrite\Extend\Exception; +use Appwrite\Network\Validator\Redirect; use Appwrite\SDK\AuthType; use Appwrite\SDK\ContentType; use Appwrite\SDK\Method; @@ -53,7 +54,6 @@ use Utopia\Detector\Detector\Runtime; use Utopia\Detector\Detector\Strategy; use Utopia\System\System; use Utopia\Validator\Boolean; -use Utopia\Validator\Host; use Utopia\Validator\Text; use Utopia\Validator\WhiteList; use Utopia\VCS\Adapter\Git\GitHub; @@ -78,11 +78,11 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $resourceCollection = $resourceType === "function" ? 'functions' : 'sites'; $resourceId = $repository->getAttribute('resourceId'); $resource = Authorization::skip(fn () => $dbForProject->getDocument($resourceCollection, $resourceId)); - $resourceInternalId = $resource->getInternalId(); + $resourceInternalId = $resource->getSequence(); $deploymentId = ID::unique(); $repositoryId = $repository->getId(); - $repositoryInternalId = $repository->getInternalId(); + $repositoryInternalId = $repository->getSequence(); $providerRepositoryId = $repository->getAttribute('providerRepositoryId'); $installationId = $repository->getAttribute('installationId'); $installationInternalId = $repository->getAttribute('installationInternalId'); @@ -116,8 +116,10 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId } $commentStatus = $isAuthorized ? 'waiting' : 'failed'; + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $hostname = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); - $authorizeUrl = $request->getProtocol() . '://' . $request->getHostname() . "/console/git/authorize-contributor?projectId={$projectId}&installationId={$installationId}&repositoryId={$repositoryId}&providerPullRequestId={$providerPullRequestId}"; + $authorizeUrl = $protocol . '://' . $hostname . "/console/git/authorize-contributor?projectId={$projectId}&installationId={$installationId}&repositoryId={$repositoryId}&providerPullRequestId={$providerPullRequestId}"; $action = $isAuthorized ? ['type' => 'logs'] : ['type' => 'authorize', 'url' => $authorizeUrl]; @@ -157,7 +159,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId ], 'installationInternalId' => $installationInternalId, 'installationId' => $installationId, - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'projectId' => $project->getId(), 'providerRepositoryId' => $providerRepositoryId, 'providerBranch' => $providerBranch, @@ -257,7 +259,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId $resource = $resource ->setAttribute('latestDeploymentId', $deployment->getId()) - ->setAttribute('latestDeploymentInternalId', $deployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $deployment->getSequence()) ->setAttribute('latestDeploymentCreatedAt', $deployment->getCreatedAt()) ->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); Authorization::skip(fn () => $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), $resource)); @@ -273,12 +275,12 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'domain' => $domain, 'type' => 'deployment', 'trigger' => 'deployment', 'deploymentId' => $deployment->getId(), - 'deploymentInternalId' => $deployment->getInternalId(), + 'deploymentInternalId' => $deployment->getSequence(), 'deploymentResourceType' => 'site', 'deploymentResourceId' => $resourceId, 'deploymentResourceInternalId' => $resourceInternalId, @@ -293,19 +295,25 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId // VCS branch preview if (!empty($providerBranch)) { - $domain = "branch-{$providerBranch}-{$resource->getId()}-{$project->getId()}.{$sitesDomain}"; + $branchPrefix = substr($providerBranch, 0, 16); + if (strlen($providerBranch) > 16) { + $remainingChars = substr($providerBranch, 16); + $branchPrefix .= '-' . substr(hash('sha256', $remainingChars), 0, 7); + } + $resourceProjectHash = substr(hash('sha256', $resource->getId() . $project->getId()), 0, 7); + $domain = "branch-{$branchPrefix}-{$resourceProjectHash}.{$sitesDomain}"; $ruleId = md5($domain); try { Authorization::skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'domain' => $domain, 'type' => 'deployment', 'trigger' => 'deployment', 'deploymentId' => $deployment->getId(), - 'deploymentInternalId' => $deployment->getInternalId(), + 'deploymentInternalId' => $deployment->getSequence(), 'deploymentResourceType' => 'site', 'deploymentResourceId' => $resourceId, 'deploymentResourceInternalId' => $resourceInternalId, @@ -324,19 +332,19 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId // VCS commit preview if (!empty($providerCommitHash)) { - $domain = "commit-{$providerCommitHash}-{$resource->getId()}-{$project->getId()}.{$sitesDomain}"; + $domain = "commit-" . substr($providerCommitHash, 0, 16) . ".{$sitesDomain}"; $ruleId = md5($domain); try { Authorization::skip( fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'domain' => $domain, 'type' => 'deployment', 'trigger' => 'deployment', 'deploymentId' => $deployment->getId(), - 'deploymentInternalId' => $deployment->getInternalId(), + 'deploymentInternalId' => $deployment->getSequence(), 'deploymentResourceType' => 'site', 'deploymentResourceId' => $resourceId, 'deploymentResourceInternalId' => $resourceInternalId, @@ -357,6 +365,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId if (!empty($providerCommitHash) && $resource->getAttribute('providerSilentMode', false) === false) { $resourceName = $resource->getAttribute('name'); $projectName = $project->getAttribute('name'); + $region = $project->getAttribute('region', 'default'); $name = "{$resourceName} ({$projectName})"; $message = 'Starting...'; @@ -371,7 +380,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId } $owner = $github->getOwnerName($providerInstallationId); - $providerTargetUrl = $request->getProtocol() . '://' . $request->getHostname() . "/console/project-$projectId/$resourceCollection/$resourceType-$resourceId"; + $providerTargetUrl = $protocol . '://' . $hostname . "/console/project-$region-$projectId/$resourceCollection/$resourceType-$resourceId"; $github->updateCommitStatus($repositoryName, $providerCommitHash, $owner, 'pending', $message, $providerTargetUrl, $name); } @@ -417,8 +426,8 @@ App::get('/v1/vcs/github/authorize') type: MethodType::WEBAUTH, hide: true, )) - ->param('success', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a successful installation attempt.', true, ['clients']) - ->param('failure', '', fn ($clients) => new Host($clients), 'URL to redirect back to console after a failed installation attempt.', true, ['clients']) + ->param('success', '', fn ($platforms) => new Redirect($platforms), 'URL to redirect back to console after a successful installation attempt.', true, ['platforms']) + ->param('failure', '', fn ($platforms) => new Redirect($platforms), 'URL to redirect back to console after a failed installation attempt.', true, ['platforms']) ->inject('request') ->inject('response') ->inject('project') @@ -430,6 +439,8 @@ App::get('/v1/vcs/github/authorize') ]); $appName = System::getEnv('_APP_VCS_GITHUB_APP_NAME'); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $hostname = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); if (empty($appName)) { throw new Exception(Exception::GENERAL_SERVER_ERROR, 'GitHub App name is not configured. Please configure VCS (Version Control System) variables in .env file.'); @@ -437,7 +448,7 @@ App::get('/v1/vcs/github/authorize') $url = "https://github.com/apps/$appName/installations/new?" . \http_build_query([ 'state' => $state, - 'redirect_uri' => $request->getProtocol() . '://' . $request->getHostname() . "/v1/vcs/github/callback" + 'redirect_uri' => $protocol . '://' . $hostname . "/v1/vcs/github/callback" ]); $response @@ -470,16 +481,6 @@ App::get('/v1/vcs/github/callback') $state = \json_decode($state, true); $projectId = $state['projectId'] ?? ''; - $defaultState = [ - 'success' => $request->getProtocol() . '://' . $request->getHostname() . "/console/project-$projectId/settings/git-installations", - 'failure' => $request->getProtocol() . '://' . $request->getHostname() . "/console/project-$projectId/settings/git-installations", - ]; - - $state = \array_merge($defaultState, $state ?? []); - - $redirectSuccess = $state['success'] ?? ''; - $redirectFailure = $state['failure'] ?? ''; - $project = $dbForPlatform->getDocument('projects', $projectId); if ($project->isEmpty()) { @@ -496,6 +497,20 @@ App::get('/v1/vcs/github/callback') throw new Exception(Exception::PROJECT_NOT_FOUND, $error); } + $region = $project->getAttribute('region', 'default'); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $hostname = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); + + $defaultState = [ + 'success' => $protocol . '://' . $hostname . "/console/project-$region-$projectId/settings/git-installations", + 'failure' => $protocol . '://' . $hostname . "/console/project-$region-$projectId/settings/git-installations", + ]; + + $state = \array_merge($defaultState, $state ?? []); + + $redirectSuccess = $state['success'] ?? ''; + $redirectFailure = $state['failure'] ?? ''; + // Create / Update installation if (!empty($providerInstallationId)) { $privateKey = System::getEnv('_APP_VCS_GITHUB_PRIVATE_KEY'); @@ -503,7 +518,7 @@ App::get('/v1/vcs/github/callback') $github->initializeVariables($providerInstallationId, $privateKey, $githubAppId); $owner = $github->getOwnerName($providerInstallationId) ?? ''; - $projectInternalId = $project->getInternalId(); + $projectInternalId = $project->getSequence(); $installation = $dbForPlatform->findOne('installations', [ Query::equal('providerInstallationId', [$providerInstallationId]), @@ -599,11 +614,12 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro ->param('installationId', '', new Text(256), 'Installation Id') ->param('providerRepositoryId', '', new Text(256), 'Repository Id') ->param('providerRootDirectory', '', new Text(256, 0), 'Path to get contents of nested directory', true) + ->param('providerReference', '', new Text(256, 0), 'Git reference (branch, tag, commit) to get contents from', true) ->inject('gitHub') ->inject('response') ->inject('project') ->inject('dbForPlatform') - ->action(function (string $installationId, string $providerRepositoryId, string $providerRootDirectory, GitHub $github, Response $response, Document $project, Database $dbForPlatform) { + ->action(function (string $installationId, string $providerRepositoryId, string $providerRootDirectory, string $providerReference, GitHub $github, Response $response, Document $project, Database $dbForPlatform) { $installation = $dbForPlatform->getDocument('installations', $installationId); if ($installation->isEmpty()) { @@ -625,7 +641,7 @@ App::get('/v1/vcs/github/installations/:installationId/providerRepositories/:pro throw new Exception(Exception::PROVIDER_REPOSITORY_NOT_FOUND); } - $contents = $github->listRepositoryContents($owner, $repositoryName, $providerRootDirectory); + $contents = $github->listRepositoryContents($owner, $repositoryName, $providerRootDirectory, $providerReference); $vcsContents = []; foreach ($contents as $content) { @@ -999,7 +1015,7 @@ App::post('/v1/vcs/github/installations/:installationId/providerRepositories') if (empty($accessToken) || empty($refreshToken) || empty($accessTokenExpiry)) { $identity = $dbForPlatform->findOne('identities', [ Query::equal('provider', ['github']), - Query::equal('userInternalId', [$user->getInternalId()]), + Query::equal('userInternalId', [$user->getSequence()]), ]); if ($identity->isEmpty()) { throw new Exception(Exception::USER_IDENTITY_NOT_FOUND); @@ -1209,6 +1225,7 @@ App::post('/v1/vcs/github/events') if ($event == $github::EVENT_PUSH) { $providerBranchCreated = $parsedPayload["branchCreated"] ?? false; + $providerBranchDeleted = $parsedPayload["branchDeleted"] ?? false; $providerBranch = $parsedPayload["branch"] ?? ''; $providerBranchUrl = $parsedPayload["branchUrl"] ?? ''; $providerRepositoryId = $parsedPayload["repositoryId"] ?? ''; @@ -1230,8 +1247,8 @@ App::post('/v1/vcs/github/events') Query::limit(100), ])); - // create new deployment only on push and not when branch is created - if (!$providerBranchCreated) { + // create new deployment only on push and not when branch is created or deleted + if (!$providerBranchCreated && !$providerBranchDeleted) { $createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerBranchUrl, $providerRepositoryName, $providerRepositoryUrl, $providerRepositoryOwner, $providerCommitHash, $providerCommitAuthor, $providerCommitAuthorUrl, $providerCommitMessage, $providerCommitUrl, '', false, $dbForPlatform, $queueForBuilds, $getProjectDB, $request); } } elseif ($event == $github::EVENT_INSTALLATION) { @@ -1246,7 +1263,7 @@ App::post('/v1/vcs/github/events') foreach ($installations as $installation) { $repositories = Authorization::skip(fn () => $dbForPlatform->find('repositories', [ - Query::equal('installationInternalId', [$installation->getInternalId()]), + Query::equal('installationInternalId', [$installation->getSequence()]), Query::limit(1000) ])); @@ -1349,7 +1366,7 @@ App::get('/v1/vcs/installations') throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } - $queries[] = Query::equal('projectInternalId', [$project->getInternalId()]); + $queries[] = Query::equal('projectInternalId', [$project->getSequence()]); if (!empty($search)) { $queries[] = Query::search('search', $search); @@ -1422,7 +1439,7 @@ App::get('/v1/vcs/installations/:installationId') throw new Exception(Exception::INSTALLATION_NOT_FOUND); } - if ($installation->getAttribute('projectInternalId') !== $project->getInternalId()) { + if ($installation->getAttribute('projectInternalId') !== $project->getSequence()) { throw new Exception(Exception::INSTALLATION_NOT_FOUND); } @@ -1505,7 +1522,7 @@ App::patch('/v1/vcs/github/installations/:installationId/repositories/:repositor } $repository = Authorization::skip(fn () => $dbForPlatform->getDocument('repositories', $repositoryId, [ - Query::equal('projectInternalId', [$project->getInternalId()]) + Query::equal('projectInternalId', [$project->getSequence()]) ])); if ($repository->isEmpty()) { diff --git a/app/controllers/general.php b/app/controllers/general.php index bff701792e..42e26b6fbe 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -49,14 +49,13 @@ use Utopia\Logger\Log\User; use Utopia\Logger\Logger; use Utopia\Platform\Service; use Utopia\System\System; -use Utopia\Validator\Hostname; use Utopia\Validator\Text; Config::setParam('domainVerification', false); Config::setParam('cookieDomain', 'localhost'); Config::setParam('cookieSamesite', Response::COOKIE_SAMESITE_NONE); -function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, SwooleRequest $swooleRequest, Request $request, Response $response, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) +function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) { $host = $request->getHostname() ?? ''; if (!empty($previewHostname)) { @@ -76,7 +75,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw } $errorView = __DIR__ . '/../views/general/error.phtml'; - $url = (System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https') . '://' . System::getEnv('_APP_DOMAIN', ''); + $url = (System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https') . '://' . System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); if ($rule->isEmpty()) { $appDomainFunctionsFallback = System::getEnv('_APP_DOMAIN_FUNCTIONS_FALLBACK', ''); @@ -118,6 +117,11 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $project->setAttribute('accessedAt', DateTime::now()); Authorization::skip(fn () => $dbForPlatform->updateDocument('projects', $project->getId(), $project)); } + + /** + * Set projectId to update the Error hook logger, since x-appwrite-project is not available when executing custom domain function + */ + $log->addTag('projectId', $project->getId()); } if (array_key_exists('proxy', $project->getAttribute('services', []))) { @@ -186,7 +190,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $resourceId = $rule->getAttribute('deploymentResourceId', ''); $type = ($resourceType === 'site') ? 'sites' : 'functions'; $exception = new AppwriteException(AppwriteException::DEPLOYMENT_NOT_FOUND, view: $errorView); - $exception->addCTA('View deployments', $url . '/console/project-' . $projectId . '/' . $type . '/' . $resourceType . '-' . $resourceId); + $exception->addCTA('View deployments', $url . '/console/project-' . $project->getAttribute('region', 'default') . '-' . $projectId . '/' . $type . '/' . $resourceType . '-' . $resourceId); throw $exception; } @@ -262,7 +266,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw } if (!$authorized) { - $url = (System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https') . "://" . System::getEnv('_APP_DOMAIN'); + $url = (System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https') . "://" . System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); $response ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') ->addHeader('Pragma', 'no-cache') @@ -319,21 +323,22 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $allowAnyStatus = !\is_null($apiKey) && $apiKey->isDeploymentStatusIgnored(); if (!$allowAnyStatus && $deployment->getAttribute('status') !== 'ready') { $status = $deployment->getAttribute('status'); + $region = $project->getAttribute('region', 'default'); switch ($status) { case 'failed': $exception = new AppwriteException(AppwriteException::BUILD_FAILED, view: $errorView); - $ctaUrl = '/console/project-' . $project->getId() . '/sites/site-' . $resource->getId() . '/deployments/deployment-' . $deployment->getId(); + $ctaUrl = '/console/project-' . $region . '-' . $project->getId() . '/sites/site-' . $resource->getId() . '/deployments/deployment-' . $deployment->getId(); $exception->addCTA('View logs', $url . $ctaUrl); break; case 'canceled': $exception = new AppwriteException(AppwriteException::BUILD_CANCELED, view: $errorView); - $ctaUrl = '/console/project-' . $project->getId() . '/sites/site-' . $resource->getId() . '/deployments'; + $ctaUrl = '/console/project-' . $region . '-' . $project->getId() . '/sites/site-' . $resource->getId() . '/deployments'; $exception->addCTA('View deployments', $url . $ctaUrl); break; default: $exception = new AppwriteException(AppwriteException::BUILD_NOT_READY, view: $errorView); - $ctaUrl = '/console/project-' . $project->getId() . '/sites/site-' . $resource->getId() . '/deployments/deployment-' . $deployment->getId(); + $ctaUrl = '/console/project-' . $region . '-' . $project->getId() . '/sites/site-' . $resource->getId() . '/deployments/deployment-' . $deployment->getId(); $exception->addCTA('Reload', '/'); $exception->addCTA('View logs', $url . $ctaUrl); break; @@ -345,7 +350,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $permissions = $resource->getAttribute('execute'); if (!(\in_array('any', $permissions)) && !(\in_array('guests', $permissions))) { $exception = new AppwriteException(AppwriteException::FUNCTION_EXECUTE_PERMISSION_MISSING, view: $errorView); - $exception->addCTA('View settings', $url . '/console/project-' . $project->getId() . '/functions/function-' . $resource->getId() . '/settings'); + $exception->addCTA('View settings', $url . '/console/project-' . $project->getAttribute('region', 'default') . '-' . $project->getId() . '/functions/function-' . $resource->getId() . '/settings'); throw $exception; } } @@ -391,9 +396,9 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $execution = new Document([ '$id' => $executionId, '$permissions' => [], - 'resourceInternalId' => $resource->getInternalId(), + 'resourceInternalId' => $resource->getSequence(), 'resourceId' => $resource->getId(), - 'deploymentInternalId' => $deployment->getInternalId(), + 'deploymentInternalId' => $deployment->getSequence(), 'deploymentId' => $deployment->getId(), 'responseStatusCode' => 0, 'responseHeaders' => [], @@ -447,7 +452,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw $vars[$var->getAttribute('key')] = $var->getAttribute('value', ''); } - $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; $hostname = System::getEnv('_APP_DOMAIN'); $endpoint = $protocol . '://' . $hostname . "/v1"; @@ -511,28 +516,27 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw 'function' => $deployment->getAttribute('entrypoint', ''), 'site' => '', }; + $source = $deployment->getAttribute('buildPath', ''); + $extension = str_ends_with($source, '.tar') ? 'tar' : 'tar.gz'; - if ($type === 'function') { - $runtimeEntrypoint = match ($version) { - 'v2' => '', - default => 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $runtime['startCommand'] . '"' - }; - } elseif ($type === 'site') { + $startCommand = $runtime['startCommand']; + if ($type === 'site') { $frameworks = Config::getParam('frameworks', []); $framework = $frameworks[$resource->getAttribute('framework', '')] ?? null; - $startCommand = $runtime['startCommand']; - if (!is_null($framework)) { $adapter = ($framework['adapters'] ?? [])[$deployment->getAttribute('adapter', '')] ?? null; if (!is_null($adapter) && isset($adapter['startCommand'])) { $startCommand = $adapter['startCommand']; } } - - $runtimeEntrypoint = 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $startCommand . '"'; } + $runtimeEntrypoint = match ($version) { + 'v2' => '', + default => "cp /tmp/code.$extension /mnt/code/code.$extension && nohup helpers/start.sh \"$startCommand\"", + }; + $entrypoint = match ($type) { 'function' => $deployment->getAttribute('entrypoint', ''), 'site' => '', @@ -545,7 +549,7 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw variables: $vars, timeout: $resource->getAttribute('timeout', 30), image: $runtime['image'], - source: $deployment->getAttribute('buildPath', ''), + source: $source, entrypoint: $entrypoint, version: $version, path: $path, @@ -692,11 +696,11 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw } $metricTypeExecutions = str_replace(['{resourceType}'], [$deployment->getAttribute('resourceType')], METRIC_RESOURCE_TYPE_EXECUTIONS); - $metricTypeIdExecutions = str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS); + $metricTypeIdExecutions = str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS); $metricTypeExecutionsCompute = str_replace(['{resourceType}'], [$deployment->getAttribute('resourceType')], METRIC_RESOURCE_TYPE_EXECUTIONS_COMPUTE); - $metricTypeIdExecutionsCompute = str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE); + $metricTypeIdExecutionsCompute = str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE); $metricTypeExecutionsMbSeconds = str_replace(['{resourceType}'], [$deployment->getAttribute('resourceType')], METRIC_RESOURCE_TYPE_EXECUTIONS_MB_SECONDS); - $metricTypeIdExecutionsMBSeconds = str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS); + $metricTypeIdExecutionsMBSeconds = str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS); if ($deployment->getAttribute('resourceType') === 'sites') { $queueForStatsUsage ->disableMetric(METRIC_NETWORK_REQUESTS) @@ -719,9 +723,9 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw ->addMetric(METRIC_SITES_REQUESTS, 1) ->addMetric(METRIC_SITES_INBOUND, $request->getSize() + $fileSize) ->addMetric(METRIC_SITES_OUTBOUND, $response->getSize()) - ->addMetric(str_replace('{siteInternalId}', $resource->getInternalId(), METRIC_SITES_ID_REQUESTS), 1) - ->addMetric(str_replace('{siteInternalId}', $resource->getInternalId(), METRIC_SITES_ID_INBOUND), $request->getSize() + $fileSize) - ->addMetric(str_replace('{siteInternalId}', $resource->getInternalId(), METRIC_SITES_ID_OUTBOUND), $response->getSize()) + ->addMetric(str_replace('{siteInternalId}', $resource->getSequence(), METRIC_SITES_ID_REQUESTS), 1) + ->addMetric(str_replace('{siteInternalId}', $resource->getSequence(), METRIC_SITES_ID_INBOUND), $request->getSize() + $fileSize) + ->addMetric(str_replace('{siteInternalId}', $resource->getSequence(), METRIC_SITES_ID_OUTBOUND), $response->getSize()) ; } @@ -749,12 +753,6 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw return false; } elseif ($type === 'redirect') { $url = $rule->getAttribute('redirectUrl', ''); - - $query = ($swooleRequest->server['query_string'] ?? ''); - if (!empty($query)) { - $url .= '?' . $query; - } - $response->redirect($url, \intval($rule->getAttribute('redirectStatusCode', 301))); return true; } else { @@ -793,13 +791,14 @@ App::init() ->inject('swooleRequest') ->inject('request') ->inject('response') + ->inject('log') ->inject('console') ->inject('project') ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('locale') ->inject('localeCodes') - ->inject('clients') + ->inject('platforms') ->inject('geodb') ->inject('queueForStatsUsage') ->inject('queueForEvents') @@ -810,7 +809,9 @@ App::init() ->inject('previewHostname') ->inject('devKey') ->inject('apiKey') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Document $console, Document $project, Database $dbForPlatform, callable $getProjectDB, Locale $locale, array $localeCodes, array $clients, Reader $geodb, StatsUsage $queueForStatsUsage, Event $queueForEvents, Certificate $queueForCertificates, Func $queueForFunctions, Executor $executor, callable $isResourceBlocked, string $previewHostname, Document $devKey, ?Key $apiKey) { + ->inject('httpReferrer') + ->inject('httpReferrerSafe') + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Document $console, Document $project, Database $dbForPlatform, callable $getProjectDB, Locale $locale, array $localeCodes, array $platforms, Reader $geodb, StatsUsage $queueForStatsUsage, Event $queueForEvents, Certificate $queueForCertificates, Func $queueForFunctions, Executor $executor, callable $isResourceBlocked, string $previewHostname, Document $devKey, ?Key $apiKey, string $httpReferrer, string $httpReferrerSafe) { /* * Appwrite Router */ @@ -818,7 +819,7 @@ App::init() $mainDomain = System::getEnv('_APP_DOMAIN', ''); // Only run Router when external domain if ($host !== $mainDomain || !empty($previewHostname)) { - if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { + if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { $utopia->getRoute()?->label('router', true); } } @@ -914,7 +915,7 @@ App::init() 'type' => 'api', 'status' => 'verifying', 'projectId' => $console->getId(), - 'projectInternalId' => $console->getInternalId(), + 'projectInternalId' => $console->getSequence(), 'search' => implode(' ', [$ruleId, $domain->get()]), 'owner' => $owner, 'region' => $console->getAttribute('region') @@ -942,42 +943,9 @@ App::init() $locale->setDefault($localeParam); } - $referrer = $request->getReferer(); - $origin = \parse_url($request->getOrigin($referrer), PHP_URL_HOST); - $protocol = \parse_url($request->getOrigin($referrer), PHP_URL_SCHEME); - $port = \parse_url($request->getOrigin($referrer), PHP_URL_PORT); - - $refDomainOrigin = 'localhost'; - $validator = new Hostname($clients); - if ($validator->isValid($origin)) { - $refDomainOrigin = $origin; - } elseif (!empty($origin)) { - // Auto-allow domains with linked rule - if (System::getEnv('_APP_RULES_FORMAT') === 'md5') { - $rule = Authorization::skip(fn () => $dbForPlatform->getDocument('rules', md5($origin ?? ''))); - } else { - $rule = Authorization::skip( - fn () => $dbForPlatform->find('rules', [ - Query::equal('domain', [$origin]), - Query::limit(1) - ]) - )[0] ?? new Document(); - } - - if (!$rule->isEmpty() && $rule->getAttribute('projectInternalId') === $project->getInternalId()) { - $refDomainOrigin = $origin; - } - } - - $refDomain = (!empty($protocol) ? $protocol : $request->getProtocol()) . '://' . $refDomainOrigin . (!empty($port) ? ':' . $port : ''); - - $refDomain = (!$route->getLabel('origin', false)) // This route is publicly accessible - ? $refDomain - : (!empty($protocol) ? $protocol : $request->getProtocol()) . '://' . $origin . (!empty($port) ? ':' . $port : ''); - + $origin = \parse_url($request->getOrigin($httpReferrer), PHP_URL_HOST); $selfDomain = new Domain($request->getHostname()); $endDomain = new Domain((string)$origin); - Config::setParam( 'domainVerification', ($selfDomain->getRegisterable() === $endDomain->getRegisterable()) && @@ -1049,7 +1017,7 @@ App::init() ->addHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE') ->addHeader('Access-Control-Allow-Headers', 'Origin, Cookie, Set-Cookie, X-Requested-With, Content-Type, Access-Control-Allow-Origin, Access-Control-Request-Headers, Accept, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Dev-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-Appwrite-Timeout, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-SDK-GraphQL, X-Appwrite-ID, X-Appwrite-Timestamp, Content-Range, Range, Cache-Control, Expires, Pragma, X-Forwarded-For, X-Forwarded-User-Agent') ->addHeader('Access-Control-Expose-Headers', 'X-Appwrite-Session, X-Fallback-Cookies') - ->addHeader('Access-Control-Allow-Origin', $refDomain) + ->addHeader('Access-Control-Allow-Origin', $httpReferrerSafe) ->addHeader('Access-Control-Allow-Credentials', 'true'); if (!$devKey->isEmpty()) { @@ -1062,14 +1030,16 @@ App::init() * Skip this check for non-web platforms which are not required to send an origin header */ $origin = $request->getOrigin($request->getReferer('')); - $originValidator = new Origin(\array_merge($project->getAttribute('platforms', []), $console->getAttribute('platforms', []))); + $originValidator = new Origin($platforms); if ( - !$originValidator->isValid($origin) - && $devKey->isEmpty() + $devKey->isEmpty() + && !empty($origin) + && !$originValidator->isValid($origin) && \in_array($request->getMethod(), [Request::METHOD_POST, Request::METHOD_PUT, Request::METHOD_PATCH, Request::METHOD_DELETE]) && $route->getLabel('origin', false) !== '*' && empty($request->getHeader('x-appwrite-key', '')) + && \parse_url($httpReferrerSafe, PHP_URL_HOST) === 'localhost' ) { throw new AppwriteException(AppwriteException::GENERAL_UNKNOWN_ORIGIN, $originValidator->getDescription()); } @@ -1080,6 +1050,7 @@ App::options() ->inject('swooleRequest') ->inject('request') ->inject('response') + ->inject('log') ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('queueForEvents') @@ -1092,7 +1063,7 @@ App::options() ->inject('project') ->inject('devKey') ->inject('apiKey') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, Document $project, Document $devKey, ?Key $apiKey) { + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, Document $project, Document $devKey, ?Key $apiKey) { /* * Appwrite Router */ @@ -1100,7 +1071,7 @@ App::options() $mainDomain = System::getEnv('_APP_DOMAIN', ''); // Only run Router when external domain if ($host !== $mainDomain || !empty($previewHostname)) { - if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { + if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { $utopia->getRoute()?->label('router', true); } } @@ -1273,7 +1244,12 @@ App::error() $log->addTag('url', $request->getURI()); $log->addTag('verboseType', get_class($error)); $log->addTag('code', $error->getCode()); - $log->addTag('projectId', $project->getId()); + + $tags = $log->getTags(); + if (!isset($tags['projectId'])) { + $log->addTag('projectId', $project->getId()); + } + $log->addTag('hostname', $request->getHostname()); $log->addTag('locale', (string)$request->getParam('locale', $request->getHeader('x-appwrite-locale', ''))); @@ -1391,6 +1367,7 @@ App::get('/robots.txt') ->inject('swooleRequest') ->inject('request') ->inject('response') + ->inject('log') ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('queueForEvents') @@ -1401,7 +1378,7 @@ App::get('/robots.txt') ->inject('isResourceBlocked') ->inject('previewHostname') ->inject('apiKey') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) { + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) { $host = $request->getHostname() ?? ''; $mainDomain = System::getEnv('_APP_DOMAIN', ''); @@ -1409,7 +1386,7 @@ App::get('/robots.txt') $template = new View(__DIR__ . '/../views/general/robots.phtml'); $response->text($template->render(false)); } else { - if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { + if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { $utopia->getRoute()?->label('router', true); } } @@ -1423,6 +1400,7 @@ App::get('/humans.txt') ->inject('swooleRequest') ->inject('request') ->inject('response') + ->inject('log') ->inject('dbForPlatform') ->inject('getProjectDB') ->inject('queueForEvents') @@ -1433,7 +1411,7 @@ App::get('/humans.txt') ->inject('isResourceBlocked') ->inject('previewHostname') ->inject('apiKey') - ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) { + ->action(function (App $utopia, SwooleRequest $swooleRequest, Request $request, Response $response, Log $log, Database $dbForPlatform, callable $getProjectDB, Event $queueForEvents, StatsUsage $queueForStatsUsage, Func $queueForFunctions, Executor $executor, Reader $geodb, callable $isResourceBlocked, string $previewHostname, ?Key $apiKey) { $host = $request->getHostname() ?? ''; $mainDomain = System::getEnv('_APP_DOMAIN', ''); @@ -1441,7 +1419,7 @@ App::get('/humans.txt') $template = new View(__DIR__ . '/../views/general/humans.phtml'); $response->text($template->render(false)); } else { - if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { + if (router($utopia, $dbForPlatform, $getProjectDB, $swooleRequest, $request, $response, $log, $queueForEvents, $queueForStatsUsage, $queueForFunctions, $executor, $geodb, $isResourceBlocked, $previewHostname, $apiKey)) { $utopia->getRoute()?->label('router', true); } } diff --git a/app/controllers/mock.php b/app/controllers/mock.php index 16d8e03841..0684e5294a 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -129,32 +129,6 @@ App::get('/v1/mock/tests/general/oauth2/failure') ]); }); -App::patch('/v1/mock/functions-v2') - ->desc('Update Function Version to V2 (outdated code syntax)') - ->groups(['mock', 'api', 'functions']) - ->label('scope', 'functions.write') - ->label('docs', false) - ->param('functionId', '', new UID(), 'Function ID.') - ->inject('response') - ->inject('dbForProject') - ->action(function (string $functionId, Response $response, Database $dbForProject) { - $isDevelopment = System::getEnv('_APP_ENV', 'development') === 'development'; - - if (!$isDevelopment) { - throw new Exception(Exception::GENERAL_NOT_IMPLEMENTED); - } - - $function = $dbForProject->getDocument('functions', $functionId); - - if ($function->isEmpty()) { - throw new Exception(Exception::FUNCTION_NOT_FOUND); - } - - $dbForProject->updateDocument('functions', $function->getId(), $function->setAttribute('version', 'v2')); - - $response->noContent(); - }); - App::post('/v1/mock/api-key-unprefixed') ->desc('Create API Key (without standard prefix)') ->groups(['mock', 'api', 'projects']) @@ -185,7 +159,7 @@ App::post('/v1/mock/api-key-unprefixed') Permission::update(Role::any()), Permission::delete(Role::any()), ], - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'projectId' => $project->getId(), 'name' => 'Outdated key', 'scopes' => $scopes, @@ -235,7 +209,7 @@ App::get('/v1/mock/github/callback') $github->initializeVariables($providerInstallationId, $privateKey, $githubAppId); $owner = $github->getOwnerName($providerInstallationId) ?? ''; - $projectInternalId = $project->getInternalId(); + $projectInternalId = $project->getSequence(); $teamId = $project->getAttribute('teamId', ''); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 937f245099..86fb1e5822 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -22,6 +22,7 @@ use Utopia\Abuse\Abuse; use Utopia\App; use Utopia\Cache\Adapter\Filesystem; use Utopia\Cache\Cache; +use Utopia\CLI\Console; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\DateTime; @@ -563,7 +564,7 @@ App::init() $cache = new Cache( new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId()) ); - $timestamp = 60 * 60 * 24 * 30; + $timestamp = 60 * 60 * 24 * 180; // Temporarily increase the TTL to 180 day to ensure files in the cache are still fetched. $data = $cache->load($key, $timestamp); if (!empty($data) && !$cacheLog->isEmpty()) { @@ -574,8 +575,7 @@ App::init() $bucketId = $parts[1] ?? null; $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); - $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getInternalId(); - $isAPIKey = Auth::isAppUser(Authorization::getRoles()); + $isToken = !$resourceToken->isEmpty() && $resourceToken->getAttribute('bucketInternalId') === $bucket->getSequence(); $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); if ($bucket->isEmpty() || (!$bucket->getAttribute('enabled') && !$isAppUser && !$isPrivilegedUser)) { @@ -593,12 +593,12 @@ App::init() $fileId = $parts[1] ?? null; if ($fileSecurity && !$valid && !$isToken) { - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } - if (!$resourceToken->isEmpty() && $resourceToken->getAttribute('fileInternalId') !== $file->getInternalId()) { + if (!$resourceToken->isEmpty() && $resourceToken->getAttribute('fileInternalId') !== $file->getSequence()) { throw new Exception(Exception::USER_UNAUTHORIZED); } @@ -797,6 +797,12 @@ App::shutdown() } if (!empty($queueForDatabase->getType())) { + Console::info("Triggering database event: \n" . \json_encode([ + 'projectId' => $project->getId(), + 'databaseId' => $queueForDatabase->getDatabase()?->getId(), + 'collectionId' => $queueForDatabase->getCollection()?->getId(), + 'documentId' => $queueForDatabase->getDocument()?->getId(), + ])); $queueForDatabase->trigger(); } @@ -824,6 +830,10 @@ App::shutdown() $resourceType = $parseLabel($pattern, $responsePayload, $requestParams, $user); } + $cache = new Cache( + new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId()) + ); + $key = $request->cacheIdentifier(); $signature = md5($data['payload']); $cacheLog = Authorization::skip(fn () => $dbForProject->getDocument('cache', $key)); @@ -841,12 +851,11 @@ App::shutdown() } elseif (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_CACHE_UPDATE)) > $accessedAt) { $cacheLog->setAttribute('accessedAt', $now); Authorization::skip(fn () => $dbForProject->updateDocument('cache', $cacheLog->getId(), $cacheLog)); + // Overwrite the file every APP_CACHE_UPDATE seconds to update the file modified time that is used in the TTL checks in cache->load() + $cache->save($key, $data['payload']); } if ($signature !== $cacheLog->getAttribute('signature')) { - $cache = new Cache( - new Filesystem(APP_STORAGE_CACHE . DIRECTORY_SEPARATOR . 'app-' . $project->getId()) - ); $cache->save($key, $data['payload']); } } diff --git a/app/http.php b/app/http.php index 6064dfdd4c..30f4013821 100644 --- a/app/http.php +++ b/app/http.php @@ -309,7 +309,7 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg 'orders' => $index['orders'], ]), $files['indexes']); - $dbForPlatform->createCollection('bucket_' . $bucket->getInternalId(), $attributes, $indexes); + $dbForPlatform->createCollection('bucket_' . $bucket->getSequence(), $attributes, $indexes); } if (Authorization::skip(fn () => $dbForPlatform->getDocument('buckets', 'screenshots')->isEmpty())) { @@ -357,7 +357,7 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg 'orders' => $index['orders'], ]), $files['indexes']); - Authorization::skip(fn () => $dbForPlatform->createCollection('bucket_' . $bucket->getInternalId(), $attributes, $indexes)); + Authorization::skip(fn () => $dbForPlatform->createCollection('bucket_' . $bucket->getSequence(), $attributes, $indexes)); } }); diff --git a/app/init/configs.php b/app/init/configs.php index 6cd57faa93..7572302919 100644 --- a/app/init/configs.php +++ b/app/init/configs.php @@ -2,6 +2,8 @@ use Utopia\Config\Config; +require_once __DIR__ . '/../config/storage/resource_limits.php'; + Config::load('template-runtimes', __DIR__ . '/../config/template-runtimes.php'); Config::load('events', __DIR__ . '/../config/events.php'); Config::load('auth', __DIR__ . '/../config/auth.php'); diff --git a/app/init/constants.php b/app/init/constants.php index 3f929e46f6..ebf79086a7 100644 --- a/app/init/constants.php +++ b/app/init/constants.php @@ -37,7 +37,7 @@ const APP_PROJECT_ACCESS = 24 * 60 * 60; // 24 hours const APP_RESOURCE_TOKEN_ACCESS = 24 * 60 * 60; // 24 hours const APP_FILE_ACCESS = 24 * 60 * 60; // 24 hours const APP_CACHE_UPDATE = 24 * 60 * 60; // 24 hours -const APP_CACHE_BUSTER = 4319; +const APP_CACHE_BUSTER = 4320; const APP_VERSION_STABLE = '1.7.4'; const APP_DATABASE_ATTRIBUTE_EMAIL = 'email'; const APP_DATABASE_ATTRIBUTE_ENUM = 'enum'; diff --git a/app/init/database/filters.php b/app/init/database/filters.php index c470329706..98a37ec4ad 100644 --- a/app/init/database/filters.php +++ b/app/init/database/filters.php @@ -71,7 +71,7 @@ Database::addFilter( }, function (mixed $value, Document $document, Database $database) { $attributes = $database->find('attributes', [ - Query::equal('collectionInternalId', [$document->getInternalId()]), + Query::equal('collectionInternalId', [$document->getSequence()]), Query::equal('databaseInternalId', [$document->getAttribute('databaseInternalId')]), Query::limit($database->getLimitForAttributes()), ]); @@ -107,7 +107,7 @@ Database::addFilter( function (mixed $value, Document $document, Database $database) { return $database ->find('indexes', [ - Query::equal('collectionInternalId', [$document->getInternalId()]), + Query::equal('collectionInternalId', [$document->getSequence()]), Query::equal('databaseInternalId', [$document->getAttribute('databaseInternalId')]), Query::limit($database->getLimitForIndexes()), ]); @@ -122,7 +122,7 @@ Database::addFilter( function (mixed $value, Document $document, Database $database) { return $database ->find('platforms', [ - Query::equal('projectInternalId', [$document->getInternalId()]), + Query::equal('projectInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), ]); } @@ -136,7 +136,7 @@ Database::addFilter( function (mixed $value, Document $document, Database $database) { return $database ->find('keys', [ - Query::equal('projectInternalId', [$document->getInternalId()]), + Query::equal('projectInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), ]); } @@ -150,7 +150,7 @@ Database::addFilter( function (mixed $value, Document $document, Database $database) { return $database ->find('devKeys', [ - Query::equal('projectInternalId', [$document->getInternalId()]), + Query::equal('projectInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), ]); } @@ -164,7 +164,7 @@ Database::addFilter( function (mixed $value, Document $document, Database $database) { return $database ->find('webhooks', [ - Query::equal('projectInternalId', [$document->getInternalId()]), + Query::equal('projectInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), ]); } @@ -177,7 +177,7 @@ Database::addFilter( }, function (mixed $value, Document $document, Database $database) { return Authorization::skip(fn () => $database->find('sessions', [ - Query::equal('userInternalId', [$document->getInternalId()]), + Query::equal('userInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), ])); } @@ -191,7 +191,7 @@ Database::addFilter( function (mixed $value, Document $document, Database $database) { return Authorization::skip(fn () => $database ->find('tokens', [ - Query::equal('userInternalId', [$document->getInternalId()]), + Query::equal('userInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), ])); } @@ -205,7 +205,7 @@ Database::addFilter( function (mixed $value, Document $document, Database $database) { return Authorization::skip(fn () => $database ->find('challenges', [ - Query::equal('userInternalId', [$document->getInternalId()]), + Query::equal('userInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), ])); } @@ -219,7 +219,7 @@ Database::addFilter( function (mixed $value, Document $document, Database $database) { return Authorization::skip(fn () => $database ->find('authenticators', [ - Query::equal('userInternalId', [$document->getInternalId()]), + Query::equal('userInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), ])); } @@ -233,7 +233,7 @@ Database::addFilter( function (mixed $value, Document $document, Database $database) { return Authorization::skip(fn () => $database ->find('memberships', [ - Query::equal('userInternalId', [$document->getInternalId()]), + Query::equal('userInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY), ])); } @@ -247,7 +247,7 @@ Database::addFilter( function (mixed $value, Document $document, Database $database) { return $database ->find('variables', [ - Query::equal('resourceInternalId', [$document->getInternalId()]), + Query::equal('resourceInternalId', [$document->getSequence()]), Query::equal('resourceType', ['function', 'site']), Query::limit(APP_LIMIT_SUBQUERY), ]); @@ -325,7 +325,7 @@ Database::addFilter( function (mixed $value, Document $document, Database $database) { return Authorization::skip(fn () => $database ->find('targets', [ - Query::equal('userInternalId', [$document->getInternalId()]), + Query::equal('userInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBQUERY) ])); } @@ -340,13 +340,13 @@ Database::addFilter( $targetIds = Authorization::skip(fn () => \array_map( fn ($document) => $document->getAttribute('targetInternalId'), $database->find('subscribers', [ - Query::equal('topicInternalId', [$document->getInternalId()]), + Query::equal('topicInternalId', [$document->getSequence()]), Query::limit(APP_LIMIT_SUBSCRIBERS_SUBQUERY) ]) )); if (\count($targetIds) > 0) { return $database->skipValidation(fn () => $database->find('targets', [ - Query::equal('$internalId', $targetIds) + Query::equal('$sequence', $targetIds) ])); } return []; diff --git a/app/init/registers.php b/app/init/registers.php index 415730f936..3dc0e22dba 100644 --- a/app/init/registers.php +++ b/app/init/registers.php @@ -36,7 +36,8 @@ App::setMode(System::getEnv('_APP_ENV', App::MODE_TYPE_PRODUCTION)); if (!App::isProduction()) { // Allow specific domains to skip public domain validation in dev environment // Useful for existing tests involving webhooks - PublicDomain::allow(['request-catcher']); + PublicDomain::allow(['request-catcher-sms']); + PublicDomain::allow(['request-catcher-webhook']); } $register->set('logger', function () { // Register error logger diff --git a/app/init/resources.php b/app/init/resources.php index c75df2a362..bc798aaba8 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -19,6 +19,7 @@ use Appwrite\Event\StatsUsage; use Appwrite\Event\Webhook; use Appwrite\Extend\Exception; use Appwrite\GraphQL\Schema; +use Appwrite\Network\Platform; use Appwrite\Network\Validator\Origin; use Appwrite\Utopia\Request; use Executor\Executor; @@ -52,6 +53,7 @@ use Utopia\Storage\Device\S3; use Utopia\Storage\Device\Wasabi; use Utopia\Storage\Storage; use Utopia\System\System; +use Utopia\Telemetry\Adapter as Telemetry; use Utopia\Telemetry\Adapter\None as NoTelemetry; use Utopia\Validator\Hostname; use Utopia\Validator\WhiteList; @@ -78,9 +80,15 @@ App::setResource('localeCodes', function () { App::setResource('publisher', function (Group $pools) { return new BrokerPool(publisher: $pools->get('publisher')); }, ['pools']); +App::setResource('publisherRedis', function () { + // Stub +}); App::setResource('consumer', function (Group $pools) { return new BrokerPool(consumer: $pools->get('consumer')); }, ['pools']); +App::setResource('consumerRedis', function () { + // Stub +}); App::setResource('queueForMessaging', function (Publisher $publisher) { return new Messaging($publisher); }, ['publisher']); @@ -120,11 +128,11 @@ App::setResource('queueForCertificates', function (Publisher $publisher) { App::setResource('queueForMigrations', function (Publisher $publisher) { return new Migration($publisher); }, ['publisher']); -App::setResource('clients', function ($request, $console, $project) { +App::setResource('platforms', function (Request $request, Document $console, Document $project) { $console->setAttribute('platforms', [ // Always allow current host '$collection' => ID::custom('platforms'), 'name' => 'Current Host', - 'type' => Origin::CLIENT_TYPE_WEB, + 'type' => Platform::TYPE_WEB, 'hostname' => $request->getHostname(), ], Document::SET_TYPE_APPEND); @@ -137,39 +145,32 @@ App::setResource('clients', function ($request, $console, $project) { } $console->setAttribute('platforms', [ '$collection' => ID::custom('platforms'), - 'type' => Origin::CLIENT_TYPE_WEB, + 'type' => Platform::TYPE_WEB, 'name' => $hostname, 'hostname' => $hostname, ], Document::SET_TYPE_APPEND); } - /** - * Get All verified client URLs for both console and current projects - * + Filter for duplicated entries - */ - $clientsConsole = \array_map( - fn ($node) => $node['hostname'], - \array_filter( - $console->getAttribute('platforms', []), - fn ($node) => (isset($node['type']) && ($node['type'] === Origin::CLIENT_TYPE_WEB) && !empty($node['hostname'])) - ) - ); - - $clients = $clientsConsole; - $platforms = $project->getAttribute('platforms', []); - - foreach ($platforms as $node) { - if ( - isset($node['type']) && - ($node['type'] === Origin::CLIENT_TYPE_WEB || - $node['type'] === Origin::CLIENT_TYPE_FLUTTER_WEB) && - !empty($node['hostname']) - ) { - $clients[] = $node['hostname']; - } + // Add `exp` and `appwrite-callback-{projectId}` schemes + if (!$project->isEmpty() && $project->getId() !== 'console') { + $project->setAttribute('platforms', [ + '$collection' => ID::custom('platforms'), + 'type' => Platform::TYPE_SCHEME, + 'name' => 'Expo', + 'key' => 'exp', + ], Document::SET_TYPE_APPEND); + $project->setAttribute('platforms', [ + '$collection' => ID::custom('platforms'), + 'type' => Platform::TYPE_SCHEME, + 'name' => 'Appwrite Callback', + 'key' => 'appwrite-callback-' . $project->getId(), + ], Document::SET_TYPE_APPEND); } - return \array_unique($clients); + return [ + ...$console->getAttribute('platforms', []), + ...$project->getAttribute('platforms', []), + ]; }, ['request', 'console', 'project']); App::setResource('user', function ($mode, $project, $console, $request, $response, $dbForProject, $dbForPlatform) { @@ -221,7 +222,9 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons Auth::$unique = $session['id'] ?? ''; Auth::$secret = $session['secret'] ?? ''; - if (APP_MODE_ADMIN !== $mode) { + if ($mode === APP_MODE_ADMIN) { + $user = $dbForPlatform->getDocument('users', Auth::$unique); + } else { if ($project->isEmpty()) { $user = new Document([]); } else { @@ -231,8 +234,6 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons $user = $dbForProject->getDocument('users', Auth::$unique); } } - } else { - $user = $dbForPlatform->getDocument('users', Auth::$unique); } if ( @@ -263,7 +264,11 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons $jwtUserId = $payload['userId'] ?? ''; if (!empty($jwtUserId)) { - $user = $dbForProject->getDocument('users', $jwtUserId); + if ($mode === APP_MODE_ADMIN) { + $user = $dbForPlatform->getDocument('users', $jwtUserId); + } else { + $user = $dbForProject->getDocument('users', $jwtUserId); + } } $jwtSessionId = $payload['sessionId'] ?? ''; @@ -347,13 +352,13 @@ App::setResource('dbForProject', function (Group $pools, Database $dbForPlatform if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getInternalId()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database ->setSharedTables(false) ->setTenant(null) - ->setNamespace('_' . $project->getInternalId()); + ->setNamespace('_' . $project->getSequence()); } return $database; @@ -400,13 +405,13 @@ App::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getInternalId()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database ->setSharedTables(false) ->setTenant(null) - ->setNamespace('_' . $project->getInternalId()); + ->setNamespace('_' . $project->getSequence()); } }); @@ -430,7 +435,7 @@ App::setResource('getLogsDB', function (Group $pools, Cache $cache) { return function (?Document $project = null) use ($pools, $cache, &$database) { if ($database !== null && $project !== null && !$project->isEmpty() && $project->getId() !== 'console') { - $database->setTenant($project->getInternalId()); + $database->setTenant((int)$project->getSequence()); return $database; } @@ -445,7 +450,7 @@ App::setResource('getLogsDB', function (Group $pools, Cache $cache) { // set tenant if ($project !== null && !$project->isEmpty() && $project->getId() !== 'console') { - $database->setTenant($project->getInternalId()); + $database->setTenant((int)$project->getSequence()); } return $database; @@ -454,7 +459,7 @@ App::setResource('getLogsDB', function (Group $pools, Cache $cache) { App::setResource('telemetry', fn () => new NoTelemetry()); -App::setResource('cache', function (Group $pools) { +App::setResource('cache', function (Group $pools, Telemetry $telemetry) { $list = Config::getParam('pools-cache', []); $adapters = []; @@ -462,8 +467,10 @@ App::setResource('cache', function (Group $pools) { $adapters[] = new CachePool($pools->get($value)); } - return new Cache(new Sharding($adapters)); -}, ['pools']); + $cache = new Cache(new Sharding($adapters)); + $cache->setTelemetry($telemetry); + return $cache; +}, ['pools', 'telemetry']); App::setResource('redis', function () { $host = System::getEnv('_APP_REDIS_HOST', 'localhost'); @@ -486,24 +493,24 @@ App::setResource('timelimit', function (\Redis $redis) { }; }, ['redis']); -App::setResource('deviceForLocal', function () { - return new Local(); -}); -App::setResource('deviceForFiles', function ($project) { - return getDevice(APP_STORAGE_UPLOADS . '/app-' . $project->getId()); -}, ['project']); -App::setResource('deviceForSites', function ($project) { - return getDevice(APP_STORAGE_SITES . '/app-' . $project->getId()); -}, ['project']); -App::setResource('deviceForImports', function ($project) { - return getDevice(APP_STORAGE_IMPORTS . '/app-' . $project->getId()); -}, ['project']); -App::setResource('deviceForFunctions', function ($project) { - return getDevice(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId()); -}, ['project']); -App::setResource('deviceForBuilds', function ($project) { - return getDevice(APP_STORAGE_BUILDS . '/app-' . $project->getId()); -}, ['project']); +App::setResource('deviceForLocal', function (Telemetry $telemetry) { + return new Device\Telemetry($telemetry, new Local()); +}, ['telemetry']); +App::setResource('deviceForFiles', function ($project, Telemetry $telemetry) { + return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_UPLOADS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); +App::setResource('deviceForSites', function ($project, Telemetry $telemetry) { + return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_SITES . '/app-' . $project->getId())); +}, ['project', 'telemetry']); +App::setResource('deviceForImports', function ($project, Telemetry $telemetry) { + return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_IMPORTS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); +App::setResource('deviceForFunctions', function ($project, Telemetry $telemetry) { + return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); +App::setResource('deviceForBuilds', function ($project, Telemetry $telemetry) { + return new Device\Telemetry($telemetry, getDevice(APP_STORAGE_BUILDS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); function getDevice(string $root, string $connection = ''): Device { @@ -836,7 +843,7 @@ App::setResource('team', function (Document $project, Database $dbForPlatform, A $team = Authorization::skip(function () use ($dbForPlatform, $teamInternalId) { return $dbForPlatform->findOne('teams', [ - Query::equal('$internalId', [$teamInternalId]), + Query::equal('$sequence', [$teamInternalId]), ]); }); @@ -877,7 +884,7 @@ App::setResource('apiKey', function (Request $request, Document $project): ?Key return Key::decode($project, $key); }, ['request', 'project']); -App::setResource('executor', fn () => new Executor(fn (string $projectId, string $deploymentId) => System::getEnv('_APP_EXECUTOR_HOST'))); +App::setResource('executor', fn () => new Executor()); App::setResource('resourceToken', function ($project, $dbForProject, $request) { $tokenJWT = $request->getParam('token'); @@ -915,10 +922,10 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { return match ($token->getAttribute('resourceType')) { TOKENS_RESOURCE_TYPE_FILES => (function () use ($token, $dbForProject) { - $internalIds = explode(':', $token->getAttribute('resourceInternalId')); + $sequences = explode(':', $token->getAttribute('resourceInternalId')); $ids = explode(':', $token->getAttribute('resourceId')); - if (count($internalIds) !== 2 || count($ids) !== 2) { + if (count($sequences) !== 2 || count($ids) !== 2) { return new Document([]); } @@ -931,8 +938,8 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { return new Document([ 'bucketId' => $ids[0], 'fileId' => $ids[1], - 'bucketInternalId' => $internalIds[0], - 'fileInternalId' => $internalIds[1], + 'bucketInternalId' => $sequences[0], + 'fileInternalId' => $sequences[1], ]); })(), @@ -941,3 +948,52 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { } return new Document([]); }, ['project', 'dbForProject', 'request']); + +App::setResource('httpReferrer', function (Request $request): string { + $referrer = $request->getReferer(); + return $referrer; +}, ['request']); + +App::setResource('httpReferrerSafe', function (Request $request, string $httpReferrer, array $platforms, Database $dbForPlatform, Document $project, App $utopia): string { + $origin = \parse_url($request->getOrigin($httpReferrer), PHP_URL_HOST); + $protocol = \parse_url($request->getOrigin($httpReferrer), PHP_URL_SCHEME); + $port = \parse_url($request->getOrigin($httpReferrer), PHP_URL_PORT); + $referrer = (!empty($protocol) ? $protocol : $request->getProtocol()) . '://' . $origin . (!empty($port) ? ':' . $port : ''); + + // Safe if route is publicly accessible + $route = $utopia->getRoute(); + if ($route->getLabel('origin', false)) { + return $referrer; + } + + // Safe if added as web platform + $originValidator = new Origin($platforms); + if ($originValidator->isValid($request->getOrigin($httpReferrer))) { + return $referrer; + } + + // Safe if rule with same project ID exists + if (!empty($origin)) { + if (System::getEnv('_APP_RULES_FORMAT') === 'md5') { + $rule = Authorization::skip(fn () => $dbForPlatform->getDocument('rules', md5($origin ?? ''))); + } else { + $rule = Authorization::skip( + fn () => $dbForPlatform->find('rules', [ + Query::equal('domain', [$origin]), + Query::limit(1) + ]) + )[0] ?? new Document(); + } + + if (!$rule->isEmpty() && $rule->getAttribute('projectInternalId') === $project->getSequence()) { + return $referrer; + } + } + + // Unsafe; Localhost is always safe for ease of local development + $origin = 'localhost'; + $protocol = \parse_url($request->getOrigin($httpReferrer), PHP_URL_SCHEME); + $port = \parse_url($request->getOrigin($httpReferrer), PHP_URL_PORT); + $referrer = (!empty($protocol) ? $protocol : $request->getProtocol()) . '://' . $origin . (!empty($port) ? ':' . $port : ''); + return $referrer; +}, ['request', 'httpReferrer', 'platforms', 'dbForPlatform', 'project', 'utopia']); diff --git a/app/realtime.php b/app/realtime.php index 7e6fc0e311..bb0d4da78c 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -79,8 +79,8 @@ if (!function_exists('getProjectDB')) { static $databases = []; - if (isset($databases[$project->getInternalId()])) { - return $databases[$project->getInternalId()]; + if (isset($databases[$project->getSequence()])) { + return $databases[$project->getSequence()]; } /** @var Group $pools */ @@ -105,20 +105,20 @@ if (!function_exists('getProjectDB')) { if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getInternalId()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database ->setSharedTables(false) ->setTenant(null) - ->setNamespace('_' . $project->getInternalId()); + ->setNamespace('_' . $project->getSequence()); } $database ->setMetadata('host', \gethostname()) ->setMetadata('project', $project->getId()); - return $databases[$project->getInternalId()] = $database; + return $databases[$project->getSequence()] = $database; } } @@ -532,7 +532,7 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, } $timelimit = $app->getResource('timelimit'); - $console = $app->getResource('console'); /** @var Document $console */ + $platforms = $app->getResource('platforms'); $user = $app->getResource('user'); /** @var Document $user */ /* @@ -557,9 +557,9 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, * Skip this check for non-web platforms which are not required to send an origin header. */ $origin = $request->getOrigin(); - $originValidator = new Origin(array_merge($project->getAttribute('platforms', []), $console->getAttribute('platforms', []))); + $originValidator = new Origin($platforms); - if (!$originValidator->isValid($origin) && $project->getId() !== 'console') { + if (!empty($origin) && !$originValidator->isValid($origin) && $project->getId() !== 'console') { throw new Exception(Exception::REALTIME_POLICY_VIOLATION, $originValidator->getDescription()); } diff --git a/app/views/general/404.phtml b/app/views/general/404.phtml index 5e63344c8a..2a9ff7f312 100644 --- a/app/views/general/404.phtml +++ b/app/views/general/404.phtml @@ -151,37 +151,6 @@ <div class="center"><a href="/"><button>Go to homepage</button></a></div> </div> </div> - - <div class="brand"> - <p>Powered by</p> - <svg class="logo-dark" width="110" height="20" viewBox="0 0 110 20" fill="none" xmlns="http://www.w3.org/2000/svg"> - <path d="M31.8649 16.2461C33.6492 16.2461 34.5511 15.3184 34.9433 14.6867H35.1197C35.1981 15.3578 35.6687 15.9895 36.5903 15.9895H38.3353V14.0156H37.8843C37.5706 14.0156 37.4138 13.838 37.4138 13.5617V5.64661H35.1001V6.90986H34.9236C34.4727 6.27823 33.5315 5.39001 31.8061 5.39001C29.0611 5.39001 27.022 7.67965 27.022 10.818C27.022 13.9564 29.1003 16.2461 31.8649 16.2461ZM32.2767 13.9959C30.6493 13.9959 29.3748 12.7919 29.3748 10.8378C29.3748 8.92316 30.6101 7.62044 32.2571 7.62044C33.8256 7.62044 35.1393 8.78499 35.1393 10.8378C35.1393 12.5945 34.0217 13.9959 32.2767 13.9959Z" fill="#EDEDF0" /> - <path d="M39.7013 20H42.0149V14.6867H42.1914C42.6227 15.3184 43.5443 16.2461 45.3677 16.2461C48.1127 16.2461 50.1127 13.9169 50.1127 10.818C50.1127 7.69939 47.9755 5.39001 45.2109 5.39001C43.4462 5.39001 42.5835 6.35719 42.1718 6.89012H41.9953V5.64661H39.7013V20ZM44.8776 14.0551C43.2894 14.0551 41.9757 12.8708 41.9757 10.818C41.9757 9.06133 43.0933 7.58096 44.8383 7.58096C46.4657 7.58096 47.7402 8.86395 47.7402 10.818C47.7402 12.7326 46.5049 14.0551 44.8776 14.0551Z" fill="#EDEDF0" /> - <path d="M51.3065 20H53.6202V14.6867H53.7966C54.228 15.3184 55.1495 16.2461 56.973 16.2461C59.718 16.2461 61.5273 13.9169 61.5273 10.818C61.5273 7.69939 59.5807 5.39001 56.8161 5.39001C55.0515 5.39001 54.1888 6.35719 53.777 6.89012H53.6005V5.64661H51.3065V20ZM56.4828 14.0551C54.8946 14.0551 53.5809 12.8708 53.5809 10.818C53.5809 9.06133 54.6985 7.58096 56.4436 7.58096C58.071 7.58096 59.3454 8.86395 59.3454 10.818C59.3454 12.7326 58.1102 14.0551 56.4828 14.0551Z" fill="#EDEDF0" /> - <path d="M64.5857 16.2296H67.8601L69.7227 8.11721H69.8404L71.7031 16.2296H74.9579L77.5642 5.88678H75.2323L73.3697 14.0189H73.1932L71.3305 5.88678H68.2522L66.3699 14.0189H66.1935L64.3504 5.88678H61.8799L64.5857 16.2296Z" fill="#EDEDF0" /> - <path d="M78.7363 16.2296H81.0499V11.1174C81.0499 9.16334 81.9519 7.9593 83.6381 7.9593H84.6576V5.63019H83.893C82.5793 5.63019 81.5793 6.53815 81.1872 7.40663H81.0303V5.88678H78.7363V16.2296Z" fill="#EDEDF0" /> - <path d="M96.1391 16.2296H97.943V14.1571H96.1587C95.4529 14.1571 95.1588 13.8413 95.1588 13.111V7.93956H98.0606V5.88678H95.1588V2.98526H92.9628V5.88678H91.0413V7.93956H92.8255V13.1307C92.8255 15.3217 94.1392 16.2296 96.1391 16.2296Z" fill="#EDEDF0" /> - <path d="M104.15 16.2461C106.287 16.2461 108.17 15.1802 108.836 13.0287L106.719 12.5155C106.346 13.6603 105.268 14.2525 104.13 14.2525C102.444 14.2525 101.327 13.1472 101.307 11.4102H109.091V10.7588C109.091 7.67965 107.189 5.39001 104.052 5.39001C101.287 5.39001 98.915 7.58096 98.915 10.8378C98.915 13.9959 101.013 16.2461 104.15 16.2461ZM101.327 9.71269C101.464 8.46918 102.581 7.42305 104.052 7.42305C105.464 7.42305 106.621 8.31128 106.738 9.71269H101.327Z" fill="#EDEDF0" /> - <path fill-rule="evenodd" clip-rule="evenodd" d="M90.0125 16.2296H87.6989V7.93956H85.895V5.88678H90.0125V16.2296Z" fill="#EDEDF0" /> - <path d="M88.6834 4.45145C89.5265 4.45145 90.154 3.81983 90.154 2.99082C90.154 2.18155 89.5265 1.54993 88.6834 1.54993C87.8403 1.54993 87.2129 2.18155 87.2129 2.99082C87.2129 3.81983 87.8403 4.45145 88.6834 4.45145Z" fill="#EDEDF0" /> - <path d="M20.2007 13.6935V18.258H8.88588C5.5894 18.258 2.71111 16.4222 1.17116 13.6935C0.947288 13.2968 0.751353 12.8806 0.586995 12.4486C0.26435 11.6021 0.0615332 10.6938 0 9.74603V8.51195C0.0133592 8.30074 0.03441 8.09119 0.0619381 7.88413C0.118209 7.45921 0.203222 7.04343 0.314953 6.63926C1.37195 2.80758 4.8089 0 8.88588 0C12.9629 0 16.3994 2.80758 17.4564 6.63926H12.6184C11.8241 5.39025 10.4493 4.5645 8.88588 4.5645C7.32245 4.5645 5.94767 5.39025 5.15341 6.63926C4.91132 7.01895 4.72349 7.43764 4.60042 7.88413C4.49112 8.27999 4.43282 8.69744 4.43282 9.12899C4.43282 10.4373 4.96962 11.6166 5.83027 12.4486C6.62778 13.2209 7.70299 13.6935 8.88588 13.6935H20.2007Z" fill="#FD366E" /> - <path d="M20.2006 7.88412V12.4486H11.9414C12.8021 11.6166 13.3389 10.4373 13.3389 9.12899C13.3389 8.69744 13.2806 8.27999 13.1713 7.88412H20.2006Z" fill="#FD366E" /> - </svg> - <svg class="logo-light" width="110" height="20" viewBox="0 0 110 20" fill="none" xmlns="http://www.w3.org/2000/svg"> - <path d="M31.8648 16.2461C33.649 16.2461 34.5509 15.3184 34.9431 14.6867H35.1195C35.198 15.3578 35.6685 15.9895 36.5901 15.9895H38.3351V14.0156H37.8841C37.5704 14.0156 37.4136 13.838 37.4136 13.5617V5.64661H35.0999V6.90986H34.9235C34.4725 6.27823 33.5314 5.39001 31.8059 5.39001C29.0609 5.39001 27.0218 7.67965 27.0218 10.818C27.0218 13.9564 29.1001 16.2461 31.8648 16.2461ZM32.2765 13.9959C30.6491 13.9959 29.3746 12.7919 29.3746 10.8378C29.3746 8.92316 30.6099 7.62044 32.2569 7.62044C33.8255 7.62044 35.1391 8.78499 35.1391 10.8378C35.1391 12.5945 34.0215 13.9959 32.2765 13.9959Z" fill="#2D2D31" /> - <path d="M39.7011 20H42.0147V14.6867H42.1912C42.6226 15.3184 43.5441 16.2461 45.3676 16.2461C48.1126 16.2461 50.1125 13.9169 50.1125 10.818C50.1125 7.69939 47.9753 5.39001 45.2107 5.39001C43.4461 5.39001 42.5833 6.35719 42.1716 6.89012H41.9951V5.64661H39.7011V20ZM44.8774 14.0551C43.2892 14.0551 41.9755 12.8708 41.9755 10.818C41.9755 9.06133 43.0931 7.58096 44.8382 7.58096C46.4656 7.58096 47.74 8.86395 47.74 10.818C47.74 12.7326 46.5048 14.0551 44.8774 14.0551Z" fill="#2D2D31" /> - <path d="M51.3063 20H53.62V14.6867H53.7964C54.2278 15.3184 55.1493 16.2461 56.9728 16.2461C59.7178 16.2461 61.5271 13.9169 61.5271 10.818C61.5271 7.69939 59.5805 5.39001 56.8159 5.39001C55.0513 5.39001 54.1886 6.35719 53.7768 6.89012H53.6004V5.64661H51.3063V20ZM56.4826 14.0551C54.8944 14.0551 53.5808 12.8708 53.5808 10.818C53.5808 9.06133 54.6984 7.58096 56.4434 7.58096C58.0708 7.58096 59.3453 8.86395 59.3453 10.818C59.3453 12.7326 58.11 14.0551 56.4826 14.0551Z" fill="#2D2D31" /> - <path d="M64.5855 16.2296H67.8599L69.7226 8.11721H69.8402L71.7029 16.2296H74.9577L77.564 5.88678H75.2322L73.3695 14.0189H73.193L71.3303 5.88678H68.252L66.3697 14.0189H66.1933L64.3502 5.88678H61.8797L64.5855 16.2296Z" fill="#2D2D31" /> - <path d="M78.7361 16.2296H81.0498V11.1174C81.0498 9.16334 81.9517 7.9593 83.6379 7.9593H84.6575V5.63019H83.8928C82.5791 5.63019 81.5791 6.53815 81.187 7.40663H81.0301V5.88678H78.7361V16.2296Z" fill="#2D2D31" /> - <path d="M96.1389 16.2296H97.9428V14.1571H96.1585C95.4527 14.1571 95.1586 13.8413 95.1586 13.111V7.93956H98.0604V5.88678H95.1586V2.98526H92.9626V5.88678H91.0411V7.93956H92.8253V13.1307C92.8253 15.3217 94.139 16.2296 96.1389 16.2296Z" fill="#2D2D31" /> - <path d="M104.15 16.2461C106.287 16.2461 108.169 15.1802 108.836 13.0287L106.718 12.5155C106.346 13.6603 105.268 14.2525 104.13 14.2525C102.444 14.2525 101.326 13.1472 101.307 11.4102H109.091V10.7588C109.091 7.67965 107.189 5.39001 104.052 5.39001C101.287 5.39001 98.9148 7.58096 98.9148 10.8378C98.9148 13.9959 101.013 16.2461 104.15 16.2461ZM101.326 9.71269C101.464 8.46918 102.581 7.42305 104.052 7.42305C105.464 7.42305 106.62 8.31128 106.738 9.71269H101.326Z" fill="#2D2D31" /> - <path fill-rule="evenodd" clip-rule="evenodd" d="M90.0123 16.2296H87.6987V7.93956H85.8948V5.88678H90.0123V16.2296Z" fill="#2D2D31" /> - <path d="M88.6835 4.45145C89.5266 4.45145 90.154 3.81983 90.154 2.99082C90.154 2.18155 89.5266 1.54993 88.6835 1.54993C87.8404 1.54993 87.213 2.18155 87.213 2.99082C87.213 3.81983 87.8404 4.45145 88.6835 4.45145Z" fill="#2D2D31" /> - <path d="M20.2007 13.6935V18.258H8.88588C5.5894 18.258 2.71111 16.4222 1.17116 13.6935C0.947288 13.2968 0.751353 12.8806 0.586995 12.4486C0.26435 11.6021 0.0615332 10.6938 0 9.74603V8.51195C0.0133592 8.30074 0.03441 8.09119 0.0619381 7.88413C0.118209 7.45921 0.203222 7.04343 0.314953 6.63926C1.37195 2.80758 4.8089 0 8.88588 0C12.9629 0 16.3994 2.80758 17.4564 6.63926H12.6184C11.8241 5.39025 10.4493 4.5645 8.88588 4.5645C7.32245 4.5645 5.94767 5.39025 5.15341 6.63926C4.91132 7.01895 4.72349 7.43764 4.60042 7.88413C4.49112 8.27999 4.43282 8.69744 4.43282 9.12899C4.43282 10.4373 4.96962 11.6166 5.83027 12.4486C6.62778 13.2209 7.70299 13.6935 8.88588 13.6935H20.2007Z" fill="#FD366E" /> - <path d="M20.2007 7.88412V12.4486H11.9415C12.8022 11.6166 13.339 10.4373 13.339 9.12899C13.339 8.69744 13.2807 8.27999 13.1714 7.88412H20.2007Z" fill="#FD366E" /> - </svg> - - </div> </body> </html> \ No newline at end of file diff --git a/app/views/general/error.phtml b/app/views/general/error.phtml index de1c2b6541..de859a9c86 100644 --- a/app/views/general/error.phtml +++ b/app/views/general/error.phtml @@ -15,7 +15,7 @@ $labelClass = ''; $buttons = []; $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; -$hostname = System::getEnv('_APP_DOMAIN'); +$hostname = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); // TODO: remove this later if (System::getEnv('_APP_ENV') === 'development') { $hostname = 'localhost'; @@ -512,36 +512,6 @@ switch ($type) { <?php endif; ?> </div> - <div x-show="page === 'error'" class="brand"> - <p>Powered by</p> - <svg class="logo-dark" width="110" height="20" viewBox="0 0 110 20" fill="none" xmlns="http://www.w3.org/2000/svg"> - <path d="M31.8649 16.2461C33.6492 16.2461 34.5511 15.3184 34.9433 14.6867H35.1197C35.1981 15.3578 35.6687 15.9895 36.5903 15.9895H38.3353V14.0156H37.8843C37.5706 14.0156 37.4138 13.838 37.4138 13.5617V5.64661H35.1001V6.90986H34.9236C34.4727 6.27823 33.5315 5.39001 31.8061 5.39001C29.0611 5.39001 27.022 7.67965 27.022 10.818C27.022 13.9564 29.1003 16.2461 31.8649 16.2461ZM32.2767 13.9959C30.6493 13.9959 29.3748 12.7919 29.3748 10.8378C29.3748 8.92316 30.6101 7.62044 32.2571 7.62044C33.8256 7.62044 35.1393 8.86395 35.1393 10.8378C35.1393 12.5945 34.0217 13.9959 32.2767 13.9959Z" fill="#EDEDF0" /> - <path d="M39.7013 20H42.0149V14.6867H42.1914C42.6227 15.3184 43.5443 16.2461 45.3677 16.2461C48.1127 16.2461 50.1127 13.9169 50.1127 10.818C50.1127 7.69939 47.9755 5.39001 45.2109 5.39001C43.4462 5.39001 42.5835 6.35719 42.1718 6.89012H41.9953V5.63019H39.7013V20ZM44.8776 14.0551C43.2894 14.0551 41.9757 12.8708 41.9757 10.818C41.9757 9.06133 43.0933 7.58096 44.8383 7.58096C46.4657 7.58096 47.7402 8.86395 47.7402 10.818C47.7402 12.7326 46.5049 14.0551 44.8776 14.0551Z" fill="#EDEDF0" /> - <path d="M51.3065 20H53.6202V14.6867H53.7966C54.228 15.3184 55.1495 16.2461 56.973 16.2461C59.718 16.2461 61.5273 13.9169 61.5273 10.818C61.5273 7.69939 59.5807 5.39001 56.8161 5.39001C55.0515 5.39001 54.1888 6.35719 53.777 6.89012H53.6005V5.64661H51.3065V20ZM56.4828 14.0551C54.8946 14.0551 53.5809 12.8708 53.5809 10.818C53.5809 9.06133 54.6985 7.58096 56.4436 7.58096C58.071 7.58096 59.3454 8.86395 59.3454 10.818C59.3454 12.7326 58.1102 14.0551 56.4828 14.0551Z" fill="#EDEDF0" /> - <path d="M64.5857 16.2296H67.8601L69.7227 8.11721H69.8404L71.7031 16.2296H74.9579L77.5642 5.88678H75.2323L73.3697 14.0189H73.1932L71.3305 5.88678H68.2522L66.3699 14.0189H66.1935L64.3504 5.88678H61.8799L64.5857 16.2296Z" fill="#EDEDF0" /> - <path d="M78.7363 16.2296H81.0499V11.1174C81.0499 9.16334 81.9519 7.9593 83.6381 7.9593H84.6576V5.63019H83.893C82.5793 5.63019 81.5793 6.53815 81.1872 7.40663H81.0303V5.88678H78.7363V16.2296Z" fill="#EDEDF0" /> - <path d="M96.1391 16.2296H97.943V14.1571H96.1587C95.4529 14.1571 95.1588 13.8413 95.1588 13.111V7.93956H98.0606V5.88678H95.1588V2.98526H92.9628V5.88678H91.0413V7.93956H92.8255V13.1307C92.8255 15.3217 94.1392 16.2296 96.1391 16.2296Z" fill="#EDEDF0" /> - <path d="M104.15 16.2461C106.287 16.2461 108.17 15.1802 108.836 13.0287L106.719 12.5155C106.346 13.6603 105.268 14.2525 104.13 14.2525C102.444 14.2525 101.327 13.1472 101.307 11.4102H109.091V10.7588C109.091 7.67965 107.189 5.39001 104.052 5.39001C101.287 5.39001 98.915 7.58096 98.915 10.8378C98.915 13.9959 101.013 16.2461 104.15 16.2461ZM101.327 9.71269C101.464 8.46918 102.581 7.42305 104.052 7.42305C105.464 7.42305 106.621 8.31128 106.738 9.71269H101.327Z" fill="#EDEDF0" /> - <path fill-rule="evenodd" clip-rule="evenodd" d="M90.0125 16.2296H87.6989V7.93956H85.895V5.88678H90.0125V16.2296Z" fill="#EDEDF0" /> - <path d="M88.6834 4.45145C89.5265 4.45145 90.154 3.81983 90.154 2.99082C90.154 2.18155 89.5265 1.54993 88.6834 1.54993C87.8403 1.54993 87.2129 2.18155 87.2129 2.99082C87.2129 3.81983 87.8403 4.45145 88.6834 4.45145Z" fill="#EDEDF0" /> - <path d="M20.2007 13.6935V18.258H8.88588C5.5894 18.258 2.71111 16.4222 1.17116 13.6935C0.947288 13.2968 0.751353 12.8806 0.586995 12.4486C0.26435 11.6021 0.0615332 10.6938 0 9.74603V8.51195C0.0133592 8.30074 0.03441 8.09119 0.0619381 7.88413C0.118209 7.45921 0.203222 7.04343 0.314953 6.63926C1.37195 2.80758 4.8089 0 8.88588 0C12.9629 0 16.3994 2.80758 17.4564 6.63926H12.6184C11.8241 5.39025 10.4493 4.5645 8.88588 4.5645C7.32245 4.5645 5.94767 5.39025 5.15341 6.63926C4.91132 7.01895 4.72349 7.43764 4.60042 7.88413C4.49112 8.27999 4.43282 8.69744 4.43282 9.12899C4.43282 10.4373 4.96962 11.6166 5.83027 12.4486C6.62778 13.2209 7.70299 13.6935 8.88588 13.6935H20.2007Z" fill="#FD366E" /> - <path d="M20.2006 7.88412V12.4486H11.9414C12.8021 11.6166 13.3389 10.4373 13.3389 9.12899C13.3389 8.69744 13.2806 8.27999 13.1713 7.88412H20.2006Z" fill="#FD366E" /> - </svg> - <svg class="logo-light" width="110" height="20" viewBox="0 0 110 20" fill="none" xmlns="http://www.w3.org/2000/svg"> - <path d="M31.8648 16.2461C33.649 16.2461 34.5509 15.3184 34.9431 14.6867H35.1195C35.198 15.3578 35.6685 15.9895 36.5901 15.9895H38.3351V14.0156H37.8841C37.5704 14.0156 37.4136 13.838 37.4136 13.5617V5.64661H35.0999V6.90986H34.9235C34.4725 6.27823 33.5314 5.39001 31.8059 5.39001C29.0609 5.39001 27.0218 7.67965 27.0218 10.818C27.0218 13.9564 29.1001 16.2461 31.8648 16.2461ZM32.2765 13.9959C30.6491 13.9959 29.3746 12.7919 29.3746 10.8378C29.3746 8.92316 30.6099 7.62044 32.2569 7.62044C33.8255 7.62044 35.1391 8.78499 35.1391 10.8378C35.1391 12.5945 34.0215 13.9959 32.2765 13.9959Z" fill="#2D2D31" /> - <path d="M39.7011 20H42.0147V14.6867H42.1912C42.6226 15.3184 43.5441 16.2461 45.3676 16.2461C48.1126 16.2461 50.1125 13.9169 50.1125 10.818C50.1125 7.69939 47.9753 5.39001 45.2107 5.39001C43.4461 5.39001 42.5833 6.35719 42.1716 6.89012H41.9951V5.64661H39.7011V20ZM44.8774 14.0551C43.2892 14.0551 41.9755 12.8708 41.9755 10.818C41.9755 9.06133 43.0931 7.58096 44.8382 7.58096C46.4656 7.58096 47.74 8.86395 47.74 10.818C47.74 12.7326 46.5048 14.0551 44.8774 14.0551Z" fill="#2D2D31" /> - <path d="M51.3063 20H53.62V14.6867H53.7964C54.2278 15.3184 55.1493 16.2461 56.9728 16.2461C59.7178 16.2461 61.5271 13.9169 61.5271 10.818C61.5271 7.69939 59.5805 5.39001 56.8159 5.39001C55.0513 5.39001 54.1886 6.35719 53.7768 6.89012H53.6004V5.64661H51.3063V20ZM56.4826 14.0551C54.8944 14.0551 53.5808 12.8708 53.5808 10.818C53.5808 9.06133 54.6984 7.58096 56.4434 7.58096C58.0708 7.58096 59.3453 8.86395 59.3453 10.818C59.3453 12.7326 58.11 14.0551 56.4826 14.0551Z" fill="#2D2D31" /> - <path d="M64.5855 16.2296H67.8599L69.7226 8.11721H69.8402L71.7029 16.2296H74.9577L77.564 5.88678H75.2322L73.3695 14.0189H73.193L71.3303 5.88678H68.252L66.3697 14.0189H66.1933L64.3502 5.88678H61.8797L64.5855 16.2296Z" fill="#2D2D31" /> - <path d="M78.7361 16.2296H81.0498V11.1174C81.0498 9.16334 81.9517 7.9593 83.6379 7.9593H84.6575V5.63019H83.8928C82.5791 5.63019 81.5791 6.53815 81.187 7.40663H81.0301V5.88678H78.7361V16.2296Z" fill="#2D2D31" /> - <path d="M96.1389 16.2296H97.9428V14.1571H96.1585C95.4527 14.1571 95.1586 13.8413 95.1586 13.111V7.93956H98.0604V5.88678H95.1586V2.98526H92.9626V5.88678H91.0411V7.93956H92.8253V13.1307C92.8253 15.3217 94.139 16.2296 96.1389 16.2296Z" fill="#2D2D31" /> - <path d="M104.15 16.2461C106.287 16.2461 108.169 15.1802 108.836 13.0287L106.718 12.5155C106.346 13.6603 105.268 14.2525 104.13 14.2525C102.444 14.2525 101.326 13.1472 101.307 11.4102H109.091V10.7588C109.091 7.67965 107.189 5.39001 104.052 5.39001C101.287 5.39001 98.9148 7.58096 98.9148 10.8378C98.9148 13.9959 101.013 16.2461 104.15 16.2461ZM101.326 9.71269C101.464 8.46918 102.581 7.42305 104.052 7.42305C105.464 7.42305 106.62 8.31128 106.738 9.71269H101.326Z" fill="#2D2D31" /> - <path fill-rule="evenodd" clip-rule="evenodd" d="M90.0123 16.2296H87.6987V7.93956H85.8948V5.88678H90.0123V16.2296Z" fill="#2D2D31" /> - <path d="M88.6835 4.45145C89.5266 4.45145 90.154 3.81983 90.154 2.99082C90.154 2.18155 89.5266 1.54993 88.6835 1.54993C87.8404 1.54993 87.213 2.18155 87.213 2.99082C87.213 3.81983 87.8404 4.45145 88.6835 4.45145Z" fill="#2D2D31" /> - <path d="M20.2007 13.6935V18.258H8.88588C5.5894 18.258 2.71111 16.4222 1.17116 13.6935C0.947288 13.2968 0.751353 12.8806 0.586995 12.4486C0.26435 11.6021 0.0615332 10.6938 0 9.74603V8.51195C0.0133592 8.30074 0.03441 8.09119 0.0619381 7.88413C0.118209 7.45921 0.203222 7.04343 0.314953 6.63926C1.37195 2.80758 4.8089 0 8.88588 0C12.9629 0 16.3994 2.80758 17.4564 6.63926H12.6184C11.8241 5.39025 10.4493 4.5645 8.88588 4.5645C7.32245 4.5645 5.94767 5.39025 5.15341 6.63926C4.91132 7.01895 4.72349 7.43764 4.60042 7.88413C4.49112 8.27999 4.43282 8.69744 4.43282 9.12899C4.43282 10.4373 4.96962 11.6166 5.83027 12.4486C6.62778 13.2209 7.70299 13.6935 8.88588 13.6935H20.2007Z" fill="#FD366E" /> - <path d="M20.2007 7.88412V12.4486H11.9415C12.8022 11.6166 13.339 10.4373 13.339 9.12899C13.339 8.69744 13.2807 8.27999 13.1714 7.88412H20.2007Z" fill="#FD366E" /> - </svg> - - </div> </body> </html> \ No newline at end of file diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index d78bca7a38..89facfe0f1 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -177,7 +177,7 @@ $image = $this->getParam('image', ''); appwrite-console: <<: *x-logging container_name: appwrite-console - image: <?php echo $organization; ?>/console:6.0.11 + image: <?php echo $organization; ?>/console:6.0.13 restart: unless-stopped networks: - appwrite @@ -841,7 +841,7 @@ $image = $this->getParam('image', ''); - _APP_DB_PASS appwrite-assistant: - image: appwrite/assistant:0.4.0 + image: appwrite/assistant:0.8.3 container_name: appwrite-assistant <<: *x-logging restart: unless-stopped @@ -864,7 +864,7 @@ $image = $this->getParam('image', ''); <<: *x-logging restart: unless-stopped stop_signal: SIGINT - image: openruntimes/executor:0.7.14 + image: openruntimes/executor:0.7.22 networks: - appwrite - runtimes diff --git a/app/worker.php b/app/worker.php index 597e8a9943..4f0f569a9e 100644 --- a/app/worker.php +++ b/app/worker.php @@ -40,7 +40,9 @@ use Utopia\Queue\Message; use Utopia\Queue\Publisher; use Utopia\Queue\Server; use Utopia\Registry\Registry; +use Utopia\Storage\Device\Telemetry as TelemetryDevice; use Utopia\System\System; +use Utopia\Telemetry\Adapter as Telemetry; use Utopia\Telemetry\Adapter\None as NoTelemetry; Authorization::disable(); @@ -90,13 +92,13 @@ Server::setResource('dbForProject', function (Cache $cache, Registry $register, if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getInternalId()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database ->setSharedTables(false) ->setTenant(null) - ->setNamespace('_' . $project->getInternalId()); + ->setNamespace('_' . $project->getSequence()); } $database->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_WORKER); @@ -127,13 +129,13 @@ Server::setResource('getProjectDB', function (Group $pools, Database $dbForPlatf if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getInternalId()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database ->setSharedTables(false) ->setTenant(null) - ->setNamespace('_' . $project->getInternalId()); + ->setNamespace('_' . $project->getSequence()); } return $database; @@ -149,13 +151,13 @@ Server::setResource('getProjectDB', function (Group $pools, Database $dbForPlatf if (\in_array($dsn->getHost(), $sharedTables)) { $database ->setSharedTables(true) - ->setTenant($project->getInternalId()) + ->setTenant((int)$project->getSequence()) ->setNamespace($dsn->getParam('namespace')); } else { $database ->setSharedTables(false) ->setTenant(null) - ->setNamespace('_' . $project->getInternalId()); + ->setNamespace('_' . $project->getSequence()); } $database->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_WORKER); @@ -168,7 +170,7 @@ Server::setResource('getLogsDB', function (Group $pools, Cache $cache) { $database = null; return function (?Document $project = null) use ($pools, $cache, $database) { if ($database !== null && $project !== null && !$project->isEmpty() && $project->getId() !== 'console') { - $database->setTenant($project->getInternalId()); + $database->setTenant((int)$project->getSequence()); return $database; } @@ -183,7 +185,7 @@ Server::setResource('getLogsDB', function (Group $pools, Cache $cache) { // set tenant if ($project !== null && !$project->isEmpty() && $project->getId() !== 'console') { - $database->setTenant($project->getInternalId()); + $database->setTenant((int)$project->getSequence()); } return $database; @@ -245,10 +247,18 @@ Server::setResource('publisher', function (Group $pools) { return new BrokerPool(publisher: $pools->get('publisher')); }, ['pools']); +Server::setResource('publisherRedis', function () { + // Stub +}); + Server::setResource('consumer', function (Group $pools) { return new BrokerPool(consumer: $pools->get('consumer')); }, ['pools']); +Server::setResource('consumerRedis', function () { + // Stub +}); + Server::setResource('queueForStatsUsage', function (Publisher $publisher) { return new StatsUsage($publisher); }, ['publisher']); @@ -311,29 +321,29 @@ Server::setResource('pools', function (Registry $register) { Server::setResource('telemetry', fn () => new NoTelemetry()); -Server::setResource('deviceForSites', function (Document $project) { - return getDevice(APP_STORAGE_SITES . '/app-' . $project->getId()); -}, ['project']); +Server::setResource('deviceForSites', function (Document $project, Telemetry $telemetry) { + return new TelemetryDevice($telemetry, getDevice(APP_STORAGE_SITES . '/app-' . $project->getId())); +}, ['project', 'telemetry']); -Server::setResource('deviceForImports', function (Document $project) { - return getDevice(APP_STORAGE_IMPORTS . '/app-' . $project->getId()); -}, ['project']); +Server::setResource('deviceForImports', function (Document $project, Telemetry $telemetry) { + return new TelemetryDevice($telemetry, getDevice(APP_STORAGE_IMPORTS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); -Server::setResource('deviceForFunctions', function (Document $project) { - return getDevice(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId()); -}, ['project']); +Server::setResource('deviceForFunctions', function (Document $project, Telemetry $telemetry) { + return new TelemetryDevice($telemetry, getDevice(APP_STORAGE_FUNCTIONS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); -Server::setResource('deviceForFiles', function (Document $project) { - return getDevice(APP_STORAGE_UPLOADS . '/app-' . $project->getId()); -}, ['project']); +Server::setResource('deviceForFiles', function (Document $project, Telemetry $telemetry) { + return new TelemetryDevice($telemetry, getDevice(APP_STORAGE_UPLOADS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); -Server::setResource('deviceForBuilds', function (Document $project) { - return getDevice(APP_STORAGE_BUILDS . '/app-' . $project->getId()); -}, ['project']); +Server::setResource('deviceForBuilds', function (Document $project, Telemetry $telemetry) { + return new TelemetryDevice($telemetry, getDevice(APP_STORAGE_BUILDS . '/app-' . $project->getId())); +}, ['project', 'telemetry']); -Server::setResource('deviceForCache', function (Document $project) { - return getDevice(APP_STORAGE_CACHE . '/app-' . $project->getId()); -}, ['project']); +Server::setResource('deviceForCache', function (Document $project, Telemetry $telemetry) { + return new TelemetryDevice($telemetry, getDevice(APP_STORAGE_CACHE . '/app-' . $project->getId())); +}, ['project', 'telemetry']); Server::setResource( 'isResourceBlocked', @@ -398,7 +408,7 @@ Server::setResource('logError', function (Registry $register, Document $project) }; }, ['register', 'project']); -Server::setResource('executor', fn () => new Executor(fn (string $projectId, string $deploymentId) => System::getEnv('_APP_EXECUTOR_HOST'))); +Server::setResource('executor', fn () => new Executor()); $pools = $register->get('pools'); $platform = new Appwrite(); diff --git a/composer.json b/composer.json index 328791c56f..5e90143b13 100644 --- a/composer.json +++ b/composer.json @@ -52,22 +52,22 @@ "utopia-php/cache": "0.13.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", + "utopia-php/database": "0.71.*", "utopia-php/detector": "0.1.*", - "utopia-php/database": "0.69.*", - "utopia-php/domains": "0.8.0", + "utopia-php/domains": "0.8.*", "utopia-php/dsn": "0.2.1", "utopia-php/framework": "0.33.*", "utopia-php/fetch": "0.4.*", "utopia-php/image": "0.8.*", "utopia-php/locale": "0.4.*", "utopia-php/logger": "0.6.*", - "utopia-php/messaging": "0.17.*", - "utopia-php/migration": "0.9.*", + "utopia-php/messaging": "0.18.*", + "utopia-php/migration": "0.11.*", "utopia-php/orchestration": "0.9.*", "utopia-php/platform": "0.7.*", "utopia-php/pools": "0.8.*", "utopia-php/preloader": "0.2.*", - "utopia-php/queue": "0.10.*", + "utopia-php/queue": "0.11.0", "utopia-php/registry": "0.5.*", "utopia-php/storage": "0.18.*", "utopia-php/swoole": "0.8.*", @@ -76,10 +76,10 @@ "utopia-php/vcs": "0.10.*", "utopia-php/websocket": "0.3.*", "matomo/device-detector": "6.1.*", - "dragonmantank/cron-expression": "3.3.2", - "phpmailer/phpmailer": "6.9.1", - "chillerlan/php-qrcode": "4.3.4", - "adhocore/jwt": "1.1.2", + "dragonmantank/cron-expression": "3.3.*", + "phpmailer/phpmailer": "6.9.*", + "chillerlan/php-qrcode": "4.3.*", + "adhocore/jwt": "1.1.*", "spomky-labs/otphp": "^10.0", "webonyx/graphql-php": "14.11.*", "league/csv": "9.14.*" diff --git a/composer.lock b/composer.lock index a111b6639e..ea3b3459a6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,27 +4,27 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a4b3f30b815230a17c33310f62ffb18d", + "content-hash": "f53e1ccd394581428d9efcb53b46d479", "packages": [ { "name": "adhocore/jwt", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/adhocore/php-jwt.git", - "reference": "6c434af7170090bb7a8880d2bc220a2254ba7899" + "reference": "ad417603d9d45578b6af2089ad5b78f101c82367" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/adhocore/php-jwt/zipball/6c434af7170090bb7a8880d2bc220a2254ba7899", - "reference": "6c434af7170090bb7a8880d2bc220a2254ba7899", + "url": "https://api.github.com/repos/adhocore/php-jwt/zipball/ad417603d9d45578b6af2089ad5b78f101c82367", + "reference": "ad417603d9d45578b6af2089ad5b78f101c82367", "shasum": "" }, "require": { "php": "^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^6.5 || ^7.5" + "phpunit/phpunit": "^7.5 || ^8.5" }, "type": "library", "autoload": { @@ -53,28 +53,32 @@ ], "support": { "issues": "https://github.com/adhocore/php-jwt/issues", - "source": "https://github.com/adhocore/php-jwt/tree/1.1.2" + "source": "https://github.com/adhocore/php-jwt/tree/1.1.3" }, "funding": [ { "url": "https://paypal.me/ji10", "type": "custom" + }, + { + "url": "https://github.com/adhocore", + "type": "github" } ], - "time": "2021-02-20T09:56:44+00:00" + "time": "2025-02-18T01:00:50+00:00" }, { "name": "appwrite/appwrite", - "version": "11.1.0", + "version": "15.0.0", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-for-php.git", - "reference": "1d043f543acdb17b9fdb440b1b2dd208e400bad3" + "reference": "deb97b62e0abed8a4fd5c5d48e77365cf89867cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/1d043f543acdb17b9fdb440b1b2dd208e400bad3", - "reference": "1d043f543acdb17b9fdb440b1b2dd208e400bad3", + "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/deb97b62e0abed8a4fd5c5d48e77365cf89867cf", + "reference": "deb97b62e0abed8a4fd5c5d48e77365cf89867cf", "shasum": "" }, "require": { @@ -100,10 +104,10 @@ "support": { "email": "team@appwrite.io", "issues": "https://github.com/appwrite/sdk-for-php/issues", - "source": "https://github.com/appwrite/sdk-for-php/tree/11.1.0", + "source": "https://github.com/appwrite/sdk-for-php/tree/15.0.0", "url": "https://appwrite.io/support" }, - "time": "2024-06-26T07:03:23+00:00" + "time": "2025-05-18T09:47:10+00:00" }, { "name": "appwrite/php-clamav", @@ -157,16 +161,16 @@ }, { "name": "appwrite/php-runtimes", - "version": "0.19.0", + "version": "0.19.1", "source": { "type": "git", "url": "https://github.com/appwrite/runtimes.git", - "reference": "8d21483efc19b9d977e323188989ee67a188464b" + "reference": "7bd0cc3cb97de625d7b07230bd91b121f88e72ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/runtimes/zipball/8d21483efc19b9d977e323188989ee67a188464b", - "reference": "8d21483efc19b9d977e323188989ee67a188464b", + "url": "https://api.github.com/repos/appwrite/runtimes/zipball/7bd0cc3cb97de625d7b07230bd91b121f88e72ae", + "reference": "7bd0cc3cb97de625d7b07230bd91b121f88e72ae", "shasum": "" }, "require": { @@ -206,9 +210,9 @@ ], "support": { "issues": "https://github.com/appwrite/runtimes/issues", - "source": "https://github.com/appwrite/runtimes/tree/0.19.0" + "source": "https://github.com/appwrite/runtimes/tree/0.19.1" }, - "time": "2025-03-25T22:37:51+00:00" + "time": "2025-05-27T07:12:56+00:00" }, { "name": "beberlei/assert", @@ -279,16 +283,16 @@ }, { "name": "brick/math", - "version": "0.12.3", + "version": "0.13.1", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "866551da34e9a618e64a819ee1e01c20d8a588ba" + "reference": "fc7ed316430118cc7836bf45faff18d5dfc8de04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/866551da34e9a618e64a819ee1e01c20d8a588ba", - "reference": "866551da34e9a618e64a819ee1e01c20d8a588ba", + "url": "https://api.github.com/repos/brick/math/zipball/fc7ed316430118cc7836bf45faff18d5dfc8de04", + "reference": "fc7ed316430118cc7836bf45faff18d5dfc8de04", "shasum": "" }, "require": { @@ -327,7 +331,7 @@ ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.12.3" + "source": "https://github.com/brick/math/tree/0.13.1" }, "funding": [ { @@ -335,7 +339,7 @@ "type": "github" } ], - "time": "2025-02-28T13:11:00+00:00" + "time": "2025-03-29T13:50:30+00:00" }, { "name": "chillerlan/php-qrcode", @@ -565,16 +569,16 @@ }, { "name": "dragonmantank/cron-expression", - "version": "v3.3.2", + "version": "v3.3.3", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8" + "reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/782ca5968ab8b954773518e9e49a6f892a34b2a8", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/adfb1f505deb6384dc8b39804c5065dd3c8c8c0a", + "reference": "adfb1f505deb6384dc8b39804c5065dd3c8c8c0a", "shasum": "" }, "require": { @@ -614,7 +618,7 @@ ], "support": { "issues": "https://github.com/dragonmantank/cron-expression/issues", - "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.2" + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.3" }, "funding": [ { @@ -622,7 +626,7 @@ "type": "github" } ], - "time": "2022-09-10T18:51:20+00:00" + "time": "2023-08-10T19:36:49+00:00" }, { "name": "giggsey/libphonenumber-for-php-lite", @@ -709,16 +713,16 @@ }, { "name": "google/protobuf", - "version": "v4.31.0", + "version": "v4.31.1", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "d59e31ce4bf0e4b48728e90c4d880839edb5be07" + "reference": "2b028ce8876254e2acbeceea7d9b573faad41864" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/d59e31ce4bf0e4b48728e90c4d880839edb5be07", - "reference": "d59e31ce4bf0e4b48728e90c4d880839edb5be07", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/2b028ce8876254e2acbeceea7d9b573faad41864", + "reference": "2b028ce8876254e2acbeceea7d9b573faad41864", "shasum": "" }, "require": { @@ -747,9 +751,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.31.0" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.31.1" }, - "time": "2025-05-14T16:17:23+00:00" + "time": "2025-05-28T18:52:35+00:00" }, { "name": "league/csv", @@ -1109,16 +1113,16 @@ }, { "name": "open-telemetry/api", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/api.git", - "reference": "4e3bb38e069876fb73c2ce85c89583bf2b28cd86" + "reference": "b3a9286f9c1c8247c83493c5b1fa475cd0cec7f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/4e3bb38e069876fb73c2ce85c89583bf2b28cd86", - "reference": "4e3bb38e069876fb73c2ce85c89583bf2b28cd86", + "url": "https://api.github.com/repos/opentelemetry-php/api/zipball/b3a9286f9c1c8247c83493c5b1fa475cd0cec7f7", + "reference": "b3a9286f9c1c8247c83493c5b1fa475cd0cec7f7", "shasum": "" }, "require": { @@ -1138,7 +1142,7 @@ ] }, "branch-alias": { - "dev-main": "1.1.x-dev" + "dev-main": "1.4.x-dev" } }, "autoload": { @@ -1175,7 +1179,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-05-07T12:32:21+00:00" + "time": "2025-06-19T23:36:51+00:00" }, { "name": "open-telemetry/context", @@ -1238,16 +1242,16 @@ }, { "name": "open-telemetry/exporter-otlp", - "version": "1.3.1", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/exporter-otlp.git", - "reference": "8b3ca1f86d01429c73b407bf1a2075d9c187001e" + "reference": "196f3a1dbce3b2c0f8110d164232c11ac00ddbb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/8b3ca1f86d01429c73b407bf1a2075d9c187001e", - "reference": "8b3ca1f86d01429c73b407bf1a2075d9c187001e", + "url": "https://api.github.com/repos/opentelemetry-php/exporter-otlp/zipball/196f3a1dbce3b2c0f8110d164232c11ac00ddbb2", + "reference": "196f3a1dbce3b2c0f8110d164232c11ac00ddbb2", "shasum": "" }, "require": { @@ -1298,7 +1302,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-05-21T12:02:20+00:00" + "time": "2025-06-16T00:24:51+00:00" }, { "name": "open-telemetry/gen-otlp-protobuf", @@ -1365,22 +1369,22 @@ }, { "name": "open-telemetry/sdk", - "version": "1.5.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/sdk.git", - "reference": "cd0d7367599717fc29e04eb8838ec061e6c2c657" + "reference": "1c0371794e4c0700afd4a9d4d8511cb5e3f78e6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/cd0d7367599717fc29e04eb8838ec061e6c2c657", - "reference": "cd0d7367599717fc29e04eb8838ec061e6c2c657", + "url": "https://api.github.com/repos/opentelemetry-php/sdk/zipball/1c0371794e4c0700afd4a9d4d8511cb5e3f78e6a", + "reference": "1c0371794e4c0700afd4a9d4d8511cb5e3f78e6a", "shasum": "" }, "require": { "ext-json": "*", "nyholm/psr7-server": "^1.1", - "open-telemetry/api": "~1.0 || ~1.1", + "open-telemetry/api": "~1.4.0", "open-telemetry/context": "^1.0", "open-telemetry/sem-conv": "^1.0", "php": "^8.1", @@ -1403,6 +1407,10 @@ "type": "library", "extra": { "spi": { + "OpenTelemetry\\API\\Configuration\\ConfigEnv\\EnvComponentLoader": [ + "OpenTelemetry\\API\\Instrumentation\\Configuration\\General\\ConfigEnv\\EnvComponentLoaderHttpConfig", + "OpenTelemetry\\API\\Instrumentation\\Configuration\\General\\ConfigEnv\\EnvComponentLoaderPeerConfig" + ], "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\HookManagerInterface": [ "OpenTelemetry\\API\\Instrumentation\\AutoInstrumentation\\ExtensionHookManager" ] @@ -1451,20 +1459,20 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-05-22T02:33:34+00:00" + "time": "2025-06-19T23:36:51+00:00" }, { "name": "open-telemetry/sem-conv", - "version": "1.32.0", + "version": "1.32.1", "source": { "type": "git", "url": "https://github.com/opentelemetry-php/sem-conv.git", - "reference": "16585cc0dbc3032a318e274043454679430d2ebf" + "reference": "94daa85ea61a8e2b7e1b0af6be0e875bedda7c22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/16585cc0dbc3032a318e274043454679430d2ebf", - "reference": "16585cc0dbc3032a318e274043454679430d2ebf", + "url": "https://api.github.com/repos/opentelemetry-php/sem-conv/zipball/94daa85ea61a8e2b7e1b0af6be0e875bedda7c22", + "reference": "94daa85ea61a8e2b7e1b0af6be0e875bedda7c22", "shasum": "" }, "require": { @@ -1508,7 +1516,7 @@ "issues": "https://github.com/open-telemetry/opentelemetry-php/issues", "source": "https://github.com/open-telemetry/opentelemetry-php" }, - "time": "2025-05-05T03:58:53+00:00" + "time": "2025-06-24T02:32:27+00:00" }, { "name": "paragonie/constant_time_encoding", @@ -1870,16 +1878,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.43", + "version": "3.0.46", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "709ec107af3cb2f385b9617be72af8cf62441d02" + "reference": "56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/709ec107af3cb2f385b9617be72af8cf62441d02", - "reference": "709ec107af3cb2f385b9617be72af8cf62441d02", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6", + "reference": "56483a7de62a6c2a6635e42e93b8a9e25d4f0ec6", "shasum": "" }, "require": { @@ -1960,7 +1968,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.43" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.46" }, "funding": [ { @@ -1976,7 +1984,7 @@ "type": "tidelift" } ], - "time": "2024-12-14T21:12:59+00:00" + "time": "2025-06-26T16:29:55+00:00" }, { "name": "psr/container", @@ -2319,21 +2327,20 @@ }, { "name": "ramsey/uuid", - "version": "4.7.6", + "version": "4.9.0", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "91039bc1faa45ba123c4328958e620d382ec7088" + "reference": "4e0e23cc785f0724a0e838279a9eb03f28b092a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/91039bc1faa45ba123c4328958e620d382ec7088", - "reference": "91039bc1faa45ba123c4328958e620d382ec7088", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/4e0e23cc785f0724a0e838279a9eb03f28b092a0", + "reference": "4e0e23cc785f0724a0e838279a9eb03f28b092a0", "shasum": "" }, "require": { - "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", - "ext-json": "*", + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13", "php": "^8.0", "ramsey/collection": "^1.2 || ^2.0" }, @@ -2341,26 +2348,23 @@ "rhumsaa/uuid": "self.version" }, "require-dev": { - "captainhook/captainhook": "^5.10", + "captainhook/captainhook": "^5.25", "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "ergebnis/composer-normalize": "^2.47", + "mockery/mockery": "^1.6", "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^8.5 || ^9", - "ramsey/composer-repl": "^1.4", - "slevomat/coding-standard": "^8.4", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.9" + "php-mock/php-mock": "^2.6", + "php-mock/php-mock-mockery": "^1.5", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpbench/phpbench": "^1.2.14", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6", + "slevomat/coding-standard": "^8.18", + "squizlabs/php_codesniffer": "^3.13" }, "suggest": { "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", @@ -2395,19 +2399,9 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.7.6" + "source": "https://github.com/ramsey/uuid/tree/4.9.0" }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", - "type": "tidelift" - } - ], - "time": "2024-04-27T21:32:50+00:00" + "time": "2025-06-25T14:20:11+00:00" }, { "name": "spomky-labs/otphp", @@ -2553,16 +2547,16 @@ }, { "name": "symfony/http-client", - "version": "v7.2.4", + "version": "v7.3.1", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "78981a2ffef6437ed92d4d7e2a86a82f256c6dc6" + "reference": "4403d87a2c16f33345dca93407a8714ee8c05a64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/78981a2ffef6437ed92d4d7e2a86a82f256c6dc6", - "reference": "78981a2ffef6437ed92d4d7e2a86a82f256c6dc6", + "url": "https://api.github.com/repos/symfony/http-client/zipball/4403d87a2c16f33345dca93407a8714ee8c05a64", + "reference": "4403d87a2c16f33345dca93407a8714ee8c05a64", "shasum": "" }, "require": { @@ -2574,6 +2568,7 @@ }, "conflict": { "amphp/amp": "<2.5", + "amphp/socket": "<1.1", "php-http/discovery": "<1.15", "symfony/http-foundation": "<6.4" }, @@ -2586,7 +2581,6 @@ "require-dev": { "amphp/http-client": "^4.2.1|^5.0", "amphp/http-tunnel": "^1.0|^2.0", - "amphp/socket": "^1.1", "guzzlehttp/promises": "^1.4|^2.0", "nyholm/psr7": "^1.0", "php-http/httplug": "^1.0|^2.0", @@ -2628,7 +2622,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.2.4" + "source": "https://github.com/symfony/http-client/tree/v7.3.1" }, "funding": [ { @@ -2644,7 +2638,7 @@ "type": "tidelift" } ], - "time": "2025-02-13T10:27:23+00:00" + "time": "2025-06-28T07:58:39+00:00" }, { "name": "symfony/http-client-contracts", @@ -2966,16 +2960,16 @@ }, { "name": "tbachert/spi", - "version": "v1.0.3", + "version": "v1.0.5", "source": { "type": "git", "url": "https://github.com/Nevay/spi.git", - "reference": "506a79c98e1a51522e76ee921ccb6c62d52faf3a" + "reference": "e7078767866d0a9e0f91d3f9d42a832df5e39002" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nevay/spi/zipball/506a79c98e1a51522e76ee921ccb6c62d52faf3a", - "reference": "506a79c98e1a51522e76ee921ccb6c62d52faf3a", + "url": "https://api.github.com/repos/Nevay/spi/zipball/e7078767866d0a9e0f91d3f9d42a832df5e39002", + "reference": "e7078767866d0a9e0f91d3f9d42a832df5e39002", "shasum": "" }, "require": { @@ -2993,7 +2987,7 @@ "extra": { "class": "Nevay\\SPI\\Composer\\Plugin", "branch-alias": { - "dev-main": "0.2.x-dev" + "dev-main": "1.0.x-dev" }, "plugin-optional": true }, @@ -3012,9 +3006,9 @@ ], "support": { "issues": "https://github.com/Nevay/spi/issues", - "source": "https://github.com/Nevay/spi/tree/v1.0.3" + "source": "https://github.com/Nevay/spi/tree/v1.0.5" }, - "time": "2025-04-02T19:38:14+00:00" + "time": "2025-06-29T15:42:06+00:00" }, { "name": "thecodingmachine/safe", @@ -3499,16 +3493,16 @@ }, { "name": "utopia-php/database", - "version": "0.69.5", + "version": "0.71.10", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "4abe53609dfc23b2ea82884d12b149df6a8af2f5" + "reference": "83278d663f9c63c25a11d9e71c7922da7ec48636" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/4abe53609dfc23b2ea82884d12b149df6a8af2f5", - "reference": "4abe53609dfc23b2ea82884d12b149df6a8af2f5", + "url": "https://api.github.com/repos/utopia-php/database/zipball/83278d663f9c63c25a11d9e71c7922da7ec48636", + "reference": "83278d663f9c63c25a11d9e71c7922da7ec48636", "shasum": "" }, "require": { @@ -3549,9 +3543,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.69.5" + "source": "https://github.com/utopia-php/database/tree/0.71.10" }, - "time": "2025-05-17T08:01:51+00:00" + "time": "2025-07-18T00:05:55+00:00" }, { "name": "utopia-php/detector", @@ -3794,16 +3788,16 @@ }, { "name": "utopia-php/image", - "version": "0.8.3", + "version": "0.8.4", "source": { "type": "git", "url": "https://github.com/utopia-php/image.git", - "reference": "8820b0e53b3636b7bdf815e92394d333fef06f26" + "reference": "ce788ff0121a79286fdbe3ef3eba566de646df65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/image/zipball/8820b0e53b3636b7bdf815e92394d333fef06f26", - "reference": "8820b0e53b3636b7bdf815e92394d333fef06f26", + "url": "https://api.github.com/repos/utopia-php/image/zipball/ce788ff0121a79286fdbe3ef3eba566de646df65", + "reference": "ce788ff0121a79286fdbe3ef3eba566de646df65", "shasum": "" }, "require": { @@ -3837,9 +3831,9 @@ ], "support": { "issues": "https://github.com/utopia-php/image/issues", - "source": "https://github.com/utopia-php/image/tree/0.8.3" + "source": "https://github.com/utopia-php/image/tree/0.8.4" }, - "time": "2025-05-15T10:39:28+00:00" + "time": "2025-06-03T08:32:20+00:00" }, { "name": "utopia-php/locale", @@ -3948,16 +3942,16 @@ }, { "name": "utopia-php/messaging", - "version": "0.17.0", + "version": "0.18.1", "source": { "type": "git", "url": "https://github.com/utopia-php/messaging.git", - "reference": "c51915d0e030db3a3add37f1561751d18b2d9a85" + "reference": "5d1245207a61d7ca065daddad7ac5f1d5640152f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/messaging/zipball/c51915d0e030db3a3add37f1561751d18b2d9a85", - "reference": "c51915d0e030db3a3add37f1561751d18b2d9a85", + "url": "https://api.github.com/repos/utopia-php/messaging/zipball/5d1245207a61d7ca065daddad7ac5f1d5640152f", + "reference": "5d1245207a61d7ca065daddad7ac5f1d5640152f", "shasum": "" }, "require": { @@ -3993,26 +3987,26 @@ ], "support": { "issues": "https://github.com/utopia-php/messaging/issues", - "source": "https://github.com/utopia-php/messaging/tree/0.17.0" + "source": "https://github.com/utopia-php/messaging/tree/0.18.1" }, - "time": "2025-05-12T16:14:08+00:00" + "time": "2025-06-26T18:26:07+00:00" }, { "name": "utopia-php/migration", - "version": "0.9.3", + "version": "0.11.1", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "e518d39eb550fde36bc5cf06c9bd7b2faf5dbedd" + "reference": "d528a454d5c1ed6564b2843a39ff13297bcdb1af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/e518d39eb550fde36bc5cf06c9bd7b2faf5dbedd", - "reference": "e518d39eb550fde36bc5cf06c9bd7b2faf5dbedd", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/d528a454d5c1ed6564b2843a39ff13297bcdb1af", + "reference": "d528a454d5c1ed6564b2843a39ff13297bcdb1af", "shasum": "" }, "require": { - "appwrite/appwrite": "11.*", + "appwrite/appwrite": "15.*", "ext-curl": "*", "ext-openssl": "*", "php": ">=8.1", @@ -4049,9 +4043,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.9.3" + "source": "https://github.com/utopia-php/migration/tree/0.11.1" }, - "time": "2025-05-01T05:41:26+00:00" + "time": "2025-07-11T13:46:37+00:00" }, { "name": "utopia-php/orchestration", @@ -4105,16 +4099,16 @@ }, { "name": "utopia-php/platform", - "version": "0.7.7", + "version": "0.7.8", "source": { "type": "git", "url": "https://github.com/utopia-php/platform.git", - "reference": "8c43cd866148a7c4c495e3401268429e338004b3" + "reference": "e3a4536c46f10988b1a446ec6b8dd8a9914be854" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/platform/zipball/8c43cd866148a7c4c495e3401268429e338004b3", - "reference": "8c43cd866148a7c4c495e3401268429e338004b3", + "url": "https://api.github.com/repos/utopia-php/platform/zipball/e3a4536c46f10988b1a446ec6b8dd8a9914be854", + "reference": "e3a4536c46f10988b1a446ec6b8dd8a9914be854", "shasum": "" }, "require": { @@ -4123,7 +4117,7 @@ "php": ">=8.0", "utopia-php/cli": "0.15.*", "utopia-php/framework": "0.33.*", - "utopia-php/queue": "0.10.*" + "utopia-php/queue": "0.11.*" }, "require-dev": { "laravel/pint": "1.*", @@ -4149,9 +4143,9 @@ ], "support": { "issues": "https://github.com/utopia-php/platform/issues", - "source": "https://github.com/utopia-php/platform/tree/0.7.7" + "source": "https://github.com/utopia-php/platform/tree/0.7.8" }, - "time": "2025-05-20T09:23:44+00:00" + "time": "2025-05-30T10:05:43+00:00" }, { "name": "utopia-php/pools", @@ -4260,16 +4254,16 @@ }, { "name": "utopia-php/queue", - "version": "0.10.0", + "version": "0.11.0", "source": { "type": "git", "url": "https://github.com/utopia-php/queue.git", - "reference": "0eccc559168ea72241c39a4c482d868314666be1" + "reference": "06b5ced0eaed2ecc6aab6d8e1b4d96bff37a1ce5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/queue/zipball/0eccc559168ea72241c39a4c482d868314666be1", - "reference": "0eccc559168ea72241c39a4c482d868314666be1", + "url": "https://api.github.com/repos/utopia-php/queue/zipball/06b5ced0eaed2ecc6aab6d8e1b4d96bff37a1ce5", + "reference": "06b5ced0eaed2ecc6aab6d8e1b4d96bff37a1ce5", "shasum": "" }, "require": { @@ -4320,9 +4314,9 @@ ], "support": { "issues": "https://github.com/utopia-php/queue/issues", - "source": "https://github.com/utopia-php/queue/tree/0.10.0" + "source": "https://github.com/utopia-php/queue/tree/0.11.0" }, - "time": "2025-04-17T12:15:52+00:00" + "time": "2025-05-30T09:52:38+00:00" }, { "name": "utopia-php/registry", @@ -4378,16 +4372,16 @@ }, { "name": "utopia-php/storage", - "version": "0.18.12", + "version": "0.18.13", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "9a2556c39b5f4d9f8e79111fd34ec889b7bb1e97" + "reference": "3d8ce53ae042173bf230445e996056c5f65ded22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/9a2556c39b5f4d9f8e79111fd34ec889b7bb1e97", - "reference": "9a2556c39b5f4d9f8e79111fd34ec889b7bb1e97", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/3d8ce53ae042173bf230445e996056c5f65ded22", + "reference": "3d8ce53ae042173bf230445e996056c5f65ded22", "shasum": "" }, "require": { @@ -4430,9 +4424,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.12" + "source": "https://github.com/utopia-php/storage/tree/0.18.13" }, - "time": "2025-05-15T07:55:58+00:00" + "time": "2025-05-26T13:10:35+00:00" }, { "name": "utopia-php/swoole", @@ -4593,16 +4587,16 @@ }, { "name": "utopia-php/vcs", - "version": "0.10.2", + "version": "0.10.5", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "1f9823ebcb8fd098607de0074f18f48e28985012" + "reference": "b358439dc387f6097019eb83ebb9fc258fe9da05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/1f9823ebcb8fd098607de0074f18f48e28985012", - "reference": "1f9823ebcb8fd098607de0074f18f48e28985012", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/b358439dc387f6097019eb83ebb9fc258fe9da05", + "reference": "b358439dc387f6097019eb83ebb9fc258fe9da05", "shasum": "" }, "require": { @@ -4636,9 +4630,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.10.2" + "source": "https://github.com/utopia-php/vcs/tree/0.10.5" }, - "time": "2025-04-17T04:35:25+00:00" + "time": "2025-06-10T15:01:16+00:00" }, { "name": "utopia-php/websocket", @@ -4816,16 +4810,16 @@ "packages-dev": [ { "name": "appwrite/sdk-generator", - "version": "0.41.6", + "version": "0.41.17", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "bfcebb968c527e17fdf18d40b8986c83d9c18c93" + "reference": "ef5e9d952032deecffee7f825a941c40ed4c84b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/bfcebb968c527e17fdf18d40b8986c83d9c18c93", - "reference": "bfcebb968c527e17fdf18d40b8986c83d9c18c93", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/ef5e9d952032deecffee7f825a941c40ed4c84b8", + "reference": "ef5e9d952032deecffee7f825a941c40ed4c84b8", "shasum": "" }, "require": { @@ -4861,9 +4855,9 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "support": { "issues": "https://github.com/appwrite/sdk-generator/issues", - "source": "https://github.com/appwrite/sdk-generator/tree/0.41.6" + "source": "https://github.com/appwrite/sdk-generator/tree/0.41.17" }, - "time": "2025-06-12T03:27:26+00:00" + "time": "2025-07-18T08:18:48+00:00" }, { "name": "doctrine/annotations", @@ -5090,16 +5084,16 @@ }, { "name": "laravel/pint", - "version": "v1.22.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "941d1927c5ca420c22710e98420287169c7bcaf7" + "reference": "0345f3b05f136801af8c339f9d16ef29e6b4df8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/941d1927c5ca420c22710e98420287169c7bcaf7", - "reference": "941d1927c5ca420c22710e98420287169c7bcaf7", + "url": "https://api.github.com/repos/laravel/pint/zipball/0345f3b05f136801af8c339f9d16ef29e6b4df8a", + "reference": "0345f3b05f136801af8c339f9d16ef29e6b4df8a", "shasum": "" }, "require": { @@ -5110,10 +5104,10 @@ "php": "^8.2.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.75.0", - "illuminate/view": "^11.44.7", - "larastan/larastan": "^3.4.0", - "laravel-zero/framework": "^11.36.1", + "friendsofphp/php-cs-fixer": "^3.82.2", + "illuminate/view": "^11.45.1", + "larastan/larastan": "^3.5.0", + "laravel-zero/framework": "^11.45.0", "mockery/mockery": "^1.6.12", "nunomaduro/termwind": "^2.3.1", "pestphp/pest": "^2.36.0" @@ -5123,6 +5117,9 @@ ], "type": "project", "autoload": { + "files": [ + "overrides/Runner/Parallel/ProcessFactory.php" + ], "psr-4": { "App\\": "app/", "Database\\Seeders\\": "database/seeders/", @@ -5152,20 +5149,20 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2025-05-08T08:38:12+00:00" + "time": "2025-07-10T18:09:32+00:00" }, { "name": "matthiasmullie/minify", - "version": "1.3.73", + "version": "1.3.75", "source": { "type": "git", "url": "https://github.com/matthiasmullie/minify.git", - "reference": "cb7a9297b4ab070909cefade30ee95054d4ae87a" + "reference": "76ba4a5f555fd7bf4aa408af608e991569076671" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/cb7a9297b4ab070909cefade30ee95054d4ae87a", - "reference": "cb7a9297b4ab070909cefade30ee95054d4ae87a", + "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/76ba4a5f555fd7bf4aa408af608e991569076671", + "reference": "76ba4a5f555fd7bf4aa408af608e991569076671", "shasum": "" }, "require": { @@ -5176,8 +5173,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": ">=2.0", "matthiasmullie/scrapbook": ">=1.3", - "phpunit/phpunit": ">=4.8", - "squizlabs/php_codesniffer": ">=3.0" + "phpunit/phpunit": ">=4.8" }, "suggest": { "psr/cache-implementation": "Cache implementation to use with Minify::cache" @@ -5215,7 +5211,7 @@ ], "support": { "issues": "https://github.com/matthiasmullie/minify/issues", - "source": "https://github.com/matthiasmullie/minify/tree/1.3.73" + "source": "https://github.com/matthiasmullie/minify/tree/1.3.75" }, "funding": [ { @@ -5223,7 +5219,7 @@ "type": "github" } ], - "time": "2024-03-15T10:27:10+00:00" + "time": "2025-06-25T09:56:19+00:00" }, { "name": "matthiasmullie/path-converter", @@ -5280,16 +5276,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.13.1", + "version": "1.13.3", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c" + "reference": "faed855a7b5f4d4637717c2b3863e277116beb36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c", - "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/faed855a7b5f4d4637717c2b3863e277116beb36", + "reference": "faed855a7b5f4d4637717c2b3863e277116beb36", "shasum": "" }, "require": { @@ -5328,7 +5324,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.3" }, "funding": [ { @@ -5336,20 +5332,20 @@ "type": "tidelift" } ], - "time": "2025-04-29T12:36:36+00:00" + "time": "2025-07-05T12:25:42+00:00" }, { "name": "nikic/php-parser", - "version": "v5.4.0", + "version": "v5.5.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "447a020a1f875a434d62f2a401f53b82a396e494" + "reference": "ae59794362fe85e051a58ad36b289443f57be7a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", - "reference": "447a020a1f875a434d62f2a401f53b82a396e494", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ae59794362fe85e051a58ad36b289443f57be7a9", + "reference": "ae59794362fe85e051a58ad36b289443f57be7a9", "shasum": "" }, "require": { @@ -5392,9 +5388,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.5.0" }, - "time": "2024-12-30T11:07:19+00:00" + "time": "2025-05-31T08:24:38+00:00" }, { "name": "phar-io/manifest", @@ -7262,23 +7258,24 @@ }, { "name": "symfony/console", - "version": "v7.2.6", + "version": "v7.3.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218" + "reference": "9e27aecde8f506ba0fd1d9989620c04a87697101" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0e2e3f38c192e93e622e41ec37f4ca70cfedf218", - "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218", + "url": "https://api.github.com/repos/symfony/console/zipball/9e27aecde8f506ba0fd1d9989620c04a87697101", + "reference": "9e27aecde8f506ba0fd1d9989620c04a87697101", "shasum": "" }, "require": { "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^6.4|^7.0" + "symfony/string": "^7.2" }, "conflict": { "symfony/dependency-injection": "<6.4", @@ -7335,7 +7332,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.2.6" + "source": "https://github.com/symfony/console/tree/v7.3.1" }, "funding": [ { @@ -7351,11 +7348,11 @@ "type": "tidelift" } ], - "time": "2025-04-07T19:09:28+00:00" + "time": "2025-06-27T19:55:54+00:00" }, { "name": "symfony/filesystem", - "version": "v7.2.0", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -7401,7 +7398,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.2.0" + "source": "https://github.com/symfony/filesystem/tree/v7.3.0" }, "funding": [ { @@ -7421,16 +7418,16 @@ }, { "name": "symfony/finder", - "version": "v7.2.2", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "87a71856f2f56e4100373e92529eed3171695cfb" + "reference": "ec2344cf77a48253bbca6939aa3d2477773ea63d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", - "reference": "87a71856f2f56e4100373e92529eed3171695cfb", + "url": "https://api.github.com/repos/symfony/finder/zipball/ec2344cf77a48253bbca6939aa3d2477773ea63d", + "reference": "ec2344cf77a48253bbca6939aa3d2477773ea63d", "shasum": "" }, "require": { @@ -7465,7 +7462,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.2.2" + "source": "https://github.com/symfony/finder/tree/v7.3.0" }, "funding": [ { @@ -7481,20 +7478,20 @@ "type": "tidelift" } ], - "time": "2024-12-30T19:00:17+00:00" + "time": "2024-12-30T19:00:26+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.2.0", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" + "reference": "afb9a8038025e5dbc657378bfab9198d75f10fca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", - "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/afb9a8038025e5dbc657378bfab9198d75f10fca", + "reference": "afb9a8038025e5dbc657378bfab9198d75f10fca", "shasum": "" }, "require": { @@ -7532,7 +7529,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" + "source": "https://github.com/symfony/options-resolver/tree/v7.3.0" }, "funding": [ { @@ -7548,7 +7545,7 @@ "type": "tidelift" } ], - "time": "2024-11-20T11:17:29+00:00" + "time": "2025-04-04T13:12:05+00:00" }, { "name": "symfony/polyfill-ctype", @@ -7866,16 +7863,16 @@ }, { "name": "symfony/process", - "version": "v7.2.5", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "87b7c93e57df9d8e39a093d32587702380ff045d" + "reference": "40c295f2deb408d5e9d2d32b8ba1dd61e36f05af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/87b7c93e57df9d8e39a093d32587702380ff045d", - "reference": "87b7c93e57df9d8e39a093d32587702380ff045d", + "url": "https://api.github.com/repos/symfony/process/zipball/40c295f2deb408d5e9d2d32b8ba1dd61e36f05af", + "reference": "40c295f2deb408d5e9d2d32b8ba1dd61e36f05af", "shasum": "" }, "require": { @@ -7907,7 +7904,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.2.5" + "source": "https://github.com/symfony/process/tree/v7.3.0" }, "funding": [ { @@ -7923,20 +7920,20 @@ "type": "tidelift" } ], - "time": "2025-03-13T12:21:46+00:00" + "time": "2025-04-17T09:11:12+00:00" }, { "name": "symfony/string", - "version": "v7.2.6", + "version": "v7.3.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931" + "reference": "f3570b8c61ca887a9e2938e85cb6458515d2b125" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/a214fe7d62bd4df2a76447c67c6b26e1d5e74931", - "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931", + "url": "https://api.github.com/repos/symfony/string/zipball/f3570b8c61ca887a9e2938e85cb6458515d2b125", + "reference": "f3570b8c61ca887a9e2938e85cb6458515d2b125", "shasum": "" }, "require": { @@ -7994,7 +7991,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.2.6" + "source": "https://github.com/symfony/string/tree/v7.3.0" }, "funding": [ { @@ -8010,7 +8007,7 @@ "type": "tidelift" } ], - "time": "2025-04-20T20:18:16+00:00" + "time": "2025-04-20T20:19:01+00:00" }, { "name": "textalk/websocket", diff --git a/docker-compose.yml b/docker-compose.yml index 847e2fa72c..58b78fcd8e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -116,6 +116,7 @@ services: - _APP_OPTIONS_ROUTER_FORCE_HTTPS - _APP_OPENSSL_KEY_V1 - _APP_DOMAIN + - _APP_CONSOLE_DOMAIN - _APP_DOMAIN_TARGET_CNAME - _APP_DOMAIN_TARGET_AAAA - _APP_DOMAIN_TARGET_A @@ -213,7 +214,7 @@ services: appwrite-console: <<: *x-logging container_name: appwrite-console - image: appwrite/console:6.0.11 + image: appwrite/console:6.1.12 restart: unless-stopped networks: - appwrite @@ -323,7 +324,8 @@ services: depends_on: - redis - mariadb - - request-catcher + - request-catcher-sms + - request-catcher-webhook environment: - _APP_ENV - _APP_WORKER_PER_CORE @@ -454,6 +456,7 @@ services: - redis - mariadb environment: + - _APP_BROWSER_HOST - _APP_ENV - _APP_WORKER_PER_CORE - _APP_OPENSSL_KEY_V1 @@ -481,6 +484,7 @@ services: - _APP_OPTIONS_FORCE_HTTPS - _APP_OPTIONS_ROUTER_FORCE_HTTPS - _APP_DOMAIN + - _APP_CONSOLE_DOMAIN - _APP_STORAGE_DEVICE - _APP_STORAGE_S3_ACCESS_KEY - _APP_STORAGE_S3_SECRET @@ -934,7 +938,7 @@ services: appwrite-assistant: container_name: appwrite-assistant - image: appwrite/assistant:0.7.0 + image: appwrite/assistant:0.8.3 networks: - appwrite environment: @@ -951,7 +955,7 @@ services: hostname: exc1 <<: *x-logging stop_signal: SIGINT - image: openruntimes/executor:0.7.16 + image: openruntimes/executor:0.7.22 restart: unless-stopped networks: - appwrite @@ -974,7 +978,7 @@ services: - OPR_EXECUTOR_ENV=$_APP_ENV - OPR_EXECUTOR_RUNTIMES=$_APP_FUNCTIONS_RUNTIMES,$_APP_SITES_RUNTIMES - OPR_EXECUTOR_SECRET=$_APP_EXECUTOR_SECRET - - OPR_EXECUTOR_RUNTIME_VERSIONS=v2,v5 + - OPR_EXECUTOR_RUNTIME_VERSIONS=v5 - OPR_EXECUTOR_LOGGING_CONFIG=$_APP_LOGGING_CONFIG - OPR_EXECUTOR_STORAGE_DEVICE=$_APP_STORAGE_DEVICE - OPR_EXECUTOR_STORAGE_S3_ACCESS_KEY=$_APP_STORAGE_S3_ACCESS_KEY @@ -1075,15 +1079,24 @@ services: networks: - appwrite - request-catcher: # used mainly for dev tests + request-catcher-webhook: # used mainly for dev tests (mock HTTP webhook) image: appwrite/requestcatcher:1.0.0 - container_name: appwrite-requestcatcher + container_name: appwrite-requestcatcher-webhook <<: *x-logging ports: - "9504:5000" networks: - appwrite + request-catcher-sms: # used mainly for dev tests (mock SMS auth secret) + image: appwrite/requestcatcher:1.0.0 + container_name: appwrite-requestcatcher-sms + <<: *x-logging + ports: + - "9507:5000" + networks: + - appwrite + adminer: image: adminer container_name: appwrite-adminer diff --git a/docs/examples/1.7.x/console-cli/examples/databases/upsert-document.md b/docs/examples/1.7.x/console-cli/examples/databases/upsert-document.md new file mode 100644 index 0000000000..40932014ba --- /dev/null +++ b/docs/examples/1.7.x/console-cli/examples/databases/upsert-document.md @@ -0,0 +1,6 @@ +appwrite databases upsertDocument \ + --databaseId <DATABASE_ID> \ + --collectionId <COLLECTION_ID> \ + --documentId <DOCUMENT_ID> \ + --data '{ "key": "value" }' \ + diff --git a/docs/examples/1.7.x/console-cli/examples/databases/upsert-documents.md b/docs/examples/1.7.x/console-cli/examples/databases/upsert-documents.md index 3d0bd165d5..cb1677b14c 100644 --- a/docs/examples/1.7.x/console-cli/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/console-cli/examples/databases/upsert-documents.md @@ -1,4 +1,4 @@ appwrite databases upsertDocuments \ --databaseId <DATABASE_ID> \ --collectionId <COLLECTION_ID> \ - + --documents one two three diff --git a/docs/examples/1.7.x/console-cli/examples/proxy/create-redirect-rule.md b/docs/examples/1.7.x/console-cli/examples/proxy/create-redirect-rule.md index f975ce686e..ec9098a748 100644 --- a/docs/examples/1.7.x/console-cli/examples/proxy/create-redirect-rule.md +++ b/docs/examples/1.7.x/console-cli/examples/proxy/create-redirect-rule.md @@ -1,4 +1,6 @@ appwrite proxy createRedirectRule \ --domain '' \ --url https://example.com \ - --statusCode 301 + --statusCode 301 \ + --resourceId <RESOURCE_ID> \ + --resourceType site diff --git a/docs/examples/1.7.x/console-cli/examples/vcs/get-repository-contents.md b/docs/examples/1.7.x/console-cli/examples/vcs/get-repository-contents.md index 7d378d7efa..3ba8d75c91 100644 --- a/docs/examples/1.7.x/console-cli/examples/vcs/get-repository-contents.md +++ b/docs/examples/1.7.x/console-cli/examples/vcs/get-repository-contents.md @@ -2,3 +2,4 @@ appwrite vcs getRepositoryContents \ --installationId <INSTALLATION_ID> \ --providerRepositoryId <PROVIDER_REPOSITORY_ID> \ + diff --git a/docs/examples/1.7.x/server-dart/examples/databases/upsert-document.md b/docs/examples/1.7.x/server-dart/examples/databases/upsert-document.md new file mode 100644 index 0000000000..93e306ebce --- /dev/null +++ b/docs/examples/1.7.x/server-dart/examples/databases/upsert-document.md @@ -0,0 +1,16 @@ +import 'package:dart_appwrite/dart_appwrite.dart'; + +Client client = Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +Databases databases = Databases(client); + +Document result = await databases.upsertDocument( + databaseId: '<DATABASE_ID>', + collectionId: '<COLLECTION_ID>', + documentId: '<DOCUMENT_ID>', + data: {}, + permissions: ["read("any")"], // (optional) +); diff --git a/docs/examples/1.7.x/server-dart/examples/databases/upsert-documents.md b/docs/examples/1.7.x/server-dart/examples/databases/upsert-documents.md index 46611b3b1e..cd35014f63 100644 --- a/docs/examples/1.7.x/server-dart/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-dart/examples/databases/upsert-documents.md @@ -10,5 +10,5 @@ Databases databases = Databases(client); DocumentList result = await databases.upsertDocuments( databaseId: '<DATABASE_ID>', collectionId: '<COLLECTION_ID>', - documents: [], // (optional) + documents: [], ); diff --git a/docs/examples/1.7.x/server-dotnet/examples/databases/upsert-document.md b/docs/examples/1.7.x/server-dotnet/examples/databases/upsert-document.md new file mode 100644 index 0000000000..c0876bfa73 --- /dev/null +++ b/docs/examples/1.7.x/server-dotnet/examples/databases/upsert-document.md @@ -0,0 +1,18 @@ +using Appwrite; +using Appwrite.Models; +using Appwrite.Services; + +Client client = new Client() + .SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint + .SetProject("<YOUR_PROJECT_ID>") // Your project ID + .SetSession(""); // The user session to authenticate with + +Databases databases = new Databases(client); + +Document result = await databases.UpsertDocument( + databaseId: "<DATABASE_ID>", + collectionId: "<COLLECTION_ID>", + documentId: "<DOCUMENT_ID>", + data: [object], + permissions: ["read("any")"] // optional +); \ No newline at end of file diff --git a/docs/examples/1.7.x/server-dotnet/examples/databases/upsert-documents.md b/docs/examples/1.7.x/server-dotnet/examples/databases/upsert-documents.md index d9db60ce2d..6c124c16e5 100644 --- a/docs/examples/1.7.x/server-dotnet/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-dotnet/examples/databases/upsert-documents.md @@ -12,5 +12,5 @@ Databases databases = new Databases(client); DocumentList result = await databases.UpsertDocuments( databaseId: "<DATABASE_ID>", collectionId: "<COLLECTION_ID>", - documents: new List<object>() // optional + documents: new List<object>() ); \ No newline at end of file diff --git a/docs/examples/1.7.x/server-nodejs/examples/databases/upsert-document.md b/docs/examples/1.7.x/server-nodejs/examples/databases/upsert-document.md new file mode 100644 index 0000000000..fcc62d601c --- /dev/null +++ b/docs/examples/1.7.x/server-nodejs/examples/databases/upsert-document.md @@ -0,0 +1,16 @@ +const sdk = require('node-appwrite'); + +const client = new sdk.Client() + .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint + .setProject('<YOUR_PROJECT_ID>') // Your project ID + .setSession(''); // The user session to authenticate with + +const databases = new sdk.Databases(client); + +const result = await databases.upsertDocument( + '<DATABASE_ID>', // databaseId + '<COLLECTION_ID>', // collectionId + '<DOCUMENT_ID>', // documentId + {}, // data + ["read("any")"] // permissions (optional) +); diff --git a/docs/examples/1.7.x/server-nodejs/examples/databases/upsert-documents.md b/docs/examples/1.7.x/server-nodejs/examples/databases/upsert-documents.md index 5b4795627d..425b7ba51f 100644 --- a/docs/examples/1.7.x/server-nodejs/examples/databases/upsert-documents.md +++ b/docs/examples/1.7.x/server-nodejs/examples/databases/upsert-documents.md @@ -10,5 +10,5 @@ const databases = new sdk.Databases(client); const result = await databases.upsertDocuments( '<DATABASE_ID>', // databaseId '<COLLECTION_ID>', // collectionId - [] // documents (optional) + [] // documents ); diff --git a/docs/references/databases/decrement-document-attribute.md b/docs/references/databases/decrement-document-attribute.md new file mode 100644 index 0000000000..e0ed8140ea --- /dev/null +++ b/docs/references/databases/decrement-document-attribute.md @@ -0,0 +1 @@ +Decrement a specific attribute of a document by a given value. \ No newline at end of file diff --git a/docs/references/databases/increment-document-attribute.md b/docs/references/databases/increment-document-attribute.md new file mode 100644 index 0000000000..13bd612eed --- /dev/null +++ b/docs/references/databases/increment-document-attribute.md @@ -0,0 +1 @@ +Increment a specific attribute of a document by a given value. \ No newline at end of file diff --git a/docs/references/databases/update-documents.md b/docs/references/databases/update-documents.md index 5f560c6435..9ab8373d36 100644 --- a/docs/references/databases/update-documents.md +++ b/docs/references/databases/update-documents.md @@ -1 +1,3 @@ +**WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions. + Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated. \ No newline at end of file diff --git a/docs/references/vcs/get-repository-contents.md b/docs/references/vcs/get-repository-contents.md index ab5ef7f8da..176b4203d3 100644 --- a/docs/references/vcs/get-repository-contents.md +++ b/docs/references/vcs/get-repository-contents.md @@ -1 +1 @@ -Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work. +Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work. \ No newline at end of file diff --git a/docs/sdks/cli/CHANGELOG.md b/docs/sdks/cli/CHANGELOG.md index fa4d35e687..e32614cad0 100644 --- a/docs/sdks/cli/CHANGELOG.md +++ b/docs/sdks/cli/CHANGELOG.md @@ -1 +1,104 @@ -# Change Log \ No newline at end of file +# Change Log + +## 8.2.2 + +* Fix object comparison logic when pushing settings +* Type generation fixes: + * Dart: Fixed import casing to snake_case, removed `extends Document` and hardcoded attributes, removed unnecessary imports + * Java: Fixed indentation to 4 spaces, updated imports to `java.util.Objects`, fixed enum casing in strict mode as per [Oracle official docs](https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html) + * Javascript: Updated optional values formatting from `|null` to `| null` + * Kotlin: Fixed indentation to 4 spaces per [Kotlinlang official docs](https://kotlinlang.org/docs/coding-conventions.html#indentation) + * PHP: Fixed indentation to 4 spaces per [PHP Fig official docs](https://www.php-fig.org/psr/psr-2/) + * Swift: Fixed indentation to 4 spaces, improved `decodeIfPresent` usage for optionals, added missing `public` to `init` method + * Typescript: Fixed indentation to 4 spaces per [Typescript coding guidelines](https://github.com/microsoft/TypeScript/wiki/Coding-guidelines) + +## 8.2.1 + +* Added `--with-variables` option to the Sites command for adding/updating environment variables +* Fixed Functions environment variables not being pushed with `--with-variables` +* Removed `awaitPools` when wiping old variables + +> **Note:** Storing environment variables in the `vars` attribute of `appwrite.json` is now deprecated due to security risks. Variables are now synced directly from the `.env` file in the root directory of the function’s or site’s folder. + +## 8.2.0 + +* Add `encrypt` attribute support +* Add improved warnings on attribute recreation and deletion +* Fix `null` parsing error when using create attribute command +* Type generation fixes and improvements: + * Add `--strict` / `-s` flag to `appwrite types` command to generate types in strict mode. This automatically converts the casing of attributes to match the language's naming conventions + * Add automatic package import to `dart` language which uses package detection to import the correct package + * Add `Document` class extension to generated types in `dart` and `js` language to support internal attributes like `$id` and `$collectionId` etc. + * Add proper enum support to `js` language + * Fix indentation in `java`, `kotlin` and `swift` to use 2 spaces instead of 4 for consistency across all languages + * Fix doc comments to use correct syntax in various languages (for eg. `///` instead of `/*`) + * Update enums in `dart` to use lowerCamelCase in `strict` mode as per [constant_identifier_names](https://dart.dev/tools/diagnostics/constant_identifier_names?utm_source=dartdev&utm_medium=redir&utm_id=diagcode&utm_content=constant_identifier_names) + +## 8.1.1 + +* Fix circular dependency issue due to usage of `success` method in `utils.js` file from `parser.js` file +* Type generation fixes: + * Add ability to generate types directly to a specific file by passing a file path to `appwrite types output_path`, instead of just a directory + * Fix non-required attributes to not be null if default value is provided + * Fix `Models` import error + * Improve formatting and add auto-generated comments + +## 8.1.0 + +* Add multi-region support to `init` command +* Update `init` command to clear previous configuration in `appwrite.json` +* Update localConfig to store multi-region endpoint +* Fix throw error when creating unknown attribute instead of timing out +* Fix equal comparison of large numbers and BigNumber instances using proper equality checks +* Fix duplication of reasons when comparing localConfig with remoteConfig +* Fix `firstOrNull()` to `firstOrNull` in types generation for dart +* Refactor to use `isCloud()` method consistently + +## 8.0.2 + +* Add Type generation fixes: + * Properly handle enum attributes in dart, java and kotlin + * Fix initialisation of null attributes in dart's fromMap method + * Fix relationships and enums in swift + +## 8.0.1 + +* Add `resourceId` and `resourceType` attributes to `createRedirectRule` +* Add `providerReference` to vcs command for getting repository contents +* Add warning comment to `bulk updateDocuments` method +* Fix type generation for enums in Typescript and PHP language + +## 8.0.0 + +* Add `types` command to generate language specific typings for collections. Currently supports - `php`, `swift`, `dart`, `js`, `ts`, `kotlin` and `java` +* Update bulk operation docs to include experiment feature warnings +* Remove assistant service and commands + +## 7.0.0 + +* Add `sites` command +* Add `tokens` command +* Add `devKeys` support to `projects` command +* Add `init site`, `pull site` and `push site` commands +* Add bulk operation methods like `createDocuments`, `deleteDocuments` etc. +* Add new upsert methods: `upsertDocument` and `upsertDocuments` +* Update GET requests to not include content-type header + +## 6.2.3 + +* Fix hot swapping error in `python-ml` function + +## 6.2.2 + +* Fix GitHub builds by adding `qemu-system` package +* Fix attribute creation timed out + +## 6.2.1 + +* Add `listOrganizations` method to `organizations` service and fix init project command + +## 6.2.0 + +* Add specifications support to CLI +* Update package version +* Fix: Missed specifications param when updating a function \ No newline at end of file diff --git a/docs/sdks/dart/CHANGELOG.md b/docs/sdks/dart/CHANGELOG.md index 57a53e5f75..5b77784063 100644 --- a/docs/sdks/dart/CHANGELOG.md +++ b/docs/sdks/dart/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 16.1.0 + +* Add `gif` support to `ImageFormat` enum +* Add support for `dart38` and `flutter332` runtimes +* Add `upsertDocument()` method to Databases service +* Fix `convertTo()` method in `Document` and `Preferences` models to correctly accept `Map<String, dynamic>` +* Fix `upsertDocuments()` method to have `documents` attribute as required parameter + ## 16.0.0 * Add `<REGION>` to doc examples due to the new multi region endpoints diff --git a/docs/sdks/dotnet/CHANGELOG.md b/docs/sdks/dotnet/CHANGELOG.md index fa4d35e687..43c2eb6520 100644 --- a/docs/sdks/dotnet/CHANGELOG.md +++ b/docs/sdks/dotnet/CHANGELOG.md @@ -1 +1,63 @@ -# Change Log \ No newline at end of file +# Change Log + +## 0.14.0 + +* Refactor from Newtonsoft.Json to System.Text.Json for serialization/deserialization +* Update package dependencies in `Package.csproj.twig` +* Migrate all serialization/deserialization logic in `Client.cs.twig`, `Query.cs.twig`, and `Extensions.cs.twig` +* Update model attributes from `[JsonProperty]` to `[JsonPropertyName]` in `Model.cs.twig` +* Create new `ObjectToInferredTypesConverter.cs.twig` for proper object type handling +* Replace `JsonConverter` with `JsonConverter<object>` in `ValueClassConverter.cs.twig` +* Update error handling to use `JsonDocument` instead of `JObject` + +## 0.13.0 + +* Add `<REGION>` to doc examples due to the new multi region endpoints +* Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc. +* Add doc examples, class and methods for new `Sites` service +* Add doc examples, class and methods for new `Tokens` service +* Add enums for `BuildRuntime `, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType` +* Update enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329 +* Add `token` param to `getFilePreview` and `getFileView` for File tokens usage +* Add `queries` and `search` params to `listMemberships` method +* Remove `search` param from `listExecutions` method + +## 0.12.0 + +* fix: remove content-type from GET requests by @loks0n in https://github.com/appwrite/sdk-for-dotnet/pull/59 +* update: min and max are not optional in methods like `UpdateIntegerAttribute` etc. +* chore: regenerate sdk by @ChiragAgg5k in https://github.com/appwrite/sdk-for-dotnet/pull/60 +* chore: fix build error by @ChiragAgg5k in https://github.com/appwrite/sdk-for-dotnet/pull/61 + +## 0.11.0 + +* Add new push message parameters by @abnegate in https://github.com/appwrite/sdk-for-dotnet/pull/56 + +## 0.10.0 + +* fix: chunk upload by @byawitz in https://github.com/appwrite/sdk-for-dotnet/pull/52 + +## 0.9.0 + +* Support for Appwrite 1.6 +* Added `key` attribute to `Runtime` response model. +* Added `buildSize` attribute to `Deployments` response model. +* Added `scheduledAt` attribute to `Executions` response model. +* Added `scopes` attribute to `Functions` response model. +* Added `specifications` attribute to `Functions` response model. +* Added new response model for `Specifications`. +* Added new response model for `Builds`. +* Added `createJWT()` : Enables creating a JWT using the `userId`. +* Added `listSpecifications()`: Enables listing available runtime specifications. +* Added `deleteExecution()` : Enables deleting executions. +* Added `updateDeploymentBuild()`: Enables cancelling a deployment. +* Added `scheduledAt` parameter to `createExecution()`: Enables creating a delayed execution + +#### Breaking changes +You can find the new syntax for breaking changes in the [Appwrite API references](https://appwrite.io/docs/references). Select version `1.6.x`. +* Removed `otp` parameter from `deleteMFAAuthenticator`. +* Added `scopes` parameter for create/update function. +* Renamed `templateBranch` to `templateVersion` in `createFunction()`. +* Renamed `downloadDeployment()` to `getDeploymentDownload()` + +> **Please note: This version is compatible with Appwrite 1.6 and later only. If you do not update your Appwrite SDK, old SDKs will not break your app. Appwrite APIs are backwards compatible.** diff --git a/docs/sdks/flutter/CHANGELOG.md b/docs/sdks/flutter/CHANGELOG.md index 1a9b8c2e29..e94f5d0abf 100644 --- a/docs/sdks/flutter/CHANGELOG.md +++ b/docs/sdks/flutter/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 17.0.2 + +* Add `gif` support to `ImageFormat` enum +* Fix `convertTo()` method in `Document` and `Preferences` models to correctly accept `Map<String, dynamic>` + +## 17.0.1 + +* Fix `devKeys` support by conditionally including credentials during requests + ## 17.0.0 * Update `flutter_web_auth_2` dependency to version 4.1.0 diff --git a/docs/sdks/nodejs/CHANGELOG.md b/docs/sdks/nodejs/CHANGELOG.md index c8a8a16c8e..d7261b67d5 100644 --- a/docs/sdks/nodejs/CHANGELOG.md +++ b/docs/sdks/nodejs/CHANGELOG.md @@ -1,13 +1,68 @@ # Change Log +## 17.1.0 + +* Add `upsertDocument` method +* Add `dart-3.8` and `flutter-3.32` runtimes +* Add `gif` image format +* Update bulk operation methods to reflect warning message +* Fix file parameter handling in chunked upload method + ## 17.0.0 -* Add `<REGION>` to doc examples due to the new multi region endpoints +* Add `REGION` to doc examples due to the new multi region endpoints * Add doc examples and methods for bulk api transactions: `createDocuments`, `deleteDocuments` etc. * Add doc examples, class and methods for new `Sites` service * Add doc examples, class and methods for new `Tokens` service -* Add enums for `BuildRuntime `, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType` +* Add enums for `BuildRuntime`, `Adapter`, `Framework`, `DeploymentDownloadType` and `VCSDeploymentType` * Updates enum for `runtimes` with Pythonml312, Dart219, Flutter327 and Flutter329 * Add `token` param to `getFilePreview` and `getFileView` for File tokens usage * Add `queries` and `search` params to `listMemberships` method -* Removes `search` param from `listExecutions` method \ No newline at end of file +* Removes `search` param from `listExecutions` method + +## 16.0.0 + +* Fix: remove content-type from GET requests +* Update (breaking): min and max params are now optional in `updateFloatAttribute` and `updateIntegerAttribute` methods (changes their positioning in method definition) + +## 15.0.1 + +* Remove titles from all function descriptions +* Fix typing for collection "attribute" key +* Remove unnecessary awaits and asyncs +* Ensure `AppwriteException` response is always string + +## 15.0.0 + +* Fix: pong response & chunked upload + +## 14.2.0 + +* Add new push message parameters + +## 14.1.0 + +* Support updating attribute name and size + +## 14.0.0 + +* Support for Appwrite 1.6 +* Add `key` attribute to `Runtime` response model. +* Add `buildSize` attribute to `Deployments` response model +* Add `scheduledAt` attribute to `Executions` response model +* Add `scopes` attribute to `Functions` response model +* Add `specifications` attribute to `Functions` response model +* Add new response model for `Specifications` +* Add new response model for `Builds` +* Add `createJWT()` : Enables creating a JWT using the `userId` +* Add `listSpecifications()`: Enables listing available runtime specifications +* Add `deleteExecution()` : Enables deleting executions +* Add `updateDeploymentBuild()`: Enables cancelling a deployment +* Add `scheduledAt` parameter to `createExecution()`: Enables creating a delayed execution +* Breaking changes + * Remove `otp` parameter from `deleteMFAAuthenticator`. + * Add `scopes` parameter for create/update function. + * Rename `templateBranch` to `templateVersion` in `createFunction()`. + * Rename `downloadDeployment()` to `getDeploymentDownload()` + +> You can find the new syntax for breaking changes in the [Appwrite API references](https://appwrite.io/docs/references). Select version `1.6.x`. \ No newline at end of file diff --git a/docs/sdks/react-native/CHANGELOG.md b/docs/sdks/react-native/CHANGELOG.md index 1bc7d89373..6ab2975bf2 100644 --- a/docs/sdks/react-native/CHANGELOG.md +++ b/docs/sdks/react-native/CHANGELOG.md @@ -1,5 +1,23 @@ # Change log +## 0.10.1 + +* Fix URL based methods like `getFileViewURL`, `getFilePreviewURL` etc. by adding the missing `projectId` to searchParams +* Add `gif` to ImageFormat enum + +## 0.10.0 + +* Add generate file URL methods like`getFilePreviewURL`, `getFileViewURL` etc. +* Update (breaking) existing methods like `getFilePreview` to download the image instead of returning URLs + +## 0.9.2 + +* Fix `devKeys` by removing credentials from requests when the key is set + +## 0.9.1 + +* Add `setDevkey` and `upsertDocument` methods + ## 0.9.0 * Add `token` param to `getFilePreview` and `getFileView` for File tokens usage diff --git a/src/Appwrite/Deletes/Targets.php b/src/Appwrite/Deletes/Targets.php index 95e744ddf1..794ab0b87a 100644 --- a/src/Appwrite/Deletes/Targets.php +++ b/src/Appwrite/Deletes/Targets.php @@ -27,7 +27,7 @@ class Targets $database->deleteDocuments( 'subscribers', [ - Query::equal('targetInternalId', [$target->getInternalId()]), + Query::equal('targetInternalId', [$target->getSequence()]), Query::orderAsc(), ], Database::DELETE_BATCH_SIZE, @@ -35,7 +35,7 @@ class Targets $topicId = $subscriber->getAttribute('topicId'); $topicInternalId = $subscriber->getAttribute('topicInternalId'); $topic = $database->getDocument('topics', $topicId); - if (!$topic->isEmpty() && $topic->getInternalId() === $topicInternalId) { + if (!$topic->isEmpty() && $topic->getSequence() === $topicInternalId) { $totalAttribute = match ($target->getAttribute('providerType')) { MESSAGE_TYPE_EMAIL => 'emailTotal', MESSAGE_TYPE_SMS => 'smsTotal', diff --git a/src/Appwrite/Event/Database.php b/src/Appwrite/Event/Database.php index d2f70dddf2..838870345a 100644 --- a/src/Appwrite/Event/Database.php +++ b/src/Appwrite/Event/Database.php @@ -54,6 +54,16 @@ class Database extends Event return $this; } + /** + * Returns set database for this event. + * + * @return null|Document + */ + public function getDatabase(): ?Document + { + return $this->database; + } + /** * Set the collection for this database event. * diff --git a/src/Appwrite/Event/Event.php b/src/Appwrite/Event/Event.php index 2c735ef2d4..934647f7c3 100644 --- a/src/Appwrite/Event/Event.php +++ b/src/Appwrite/Event/Event.php @@ -320,7 +320,7 @@ class Event if ($this->project) { $trimmed['project'] = new Document([ '$id' => $this->project->getId(), - '$internalId' => $this->project->getInternalId(), + '$sequence' => $this->project->getSequence(), 'database' => $this->project->getAttribute('database') ]); } diff --git a/src/Appwrite/Extend/Exception.php b/src/Appwrite/Extend/Exception.php index 296434ed57..3af6d9962c 100644 --- a/src/Appwrite/Extend/Exception.php +++ b/src/Appwrite/Extend/Exception.php @@ -124,6 +124,8 @@ class Exception extends \Exception /** Membership */ public const MEMBERSHIP_NOT_FOUND = 'membership_not_found'; public const MEMBERSHIP_ALREADY_CONFIRMED = 'membership_already_confirmed'; + public const MEMBERSHIP_DELETION_PROHIBITED = 'membership_deletion_prohibited'; + public const MEMBERSHIP_DOWNGRADE_PROHIBITED = 'membership_downgrade_prohibited'; /** Avatars */ public const AVATAR_SET_NOT_FOUND = 'avatar_set_not_found'; diff --git a/src/Appwrite/GraphQL/Types/Mapper.php b/src/Appwrite/GraphQL/Types/Mapper.php index 3c7915bc96..68eec1eb35 100644 --- a/src/Appwrite/GraphQL/Types/Mapper.php +++ b/src/Appwrite/GraphQL/Types/Mapper.php @@ -226,7 +226,7 @@ class Mapper ]; if (!$rule['required']) { - $fields[$escapedKey]['defaultValue'] = $rule['default']; + $fields[$escapedKey]['defaultValue'] = $rule['default'] ?? null; } } @@ -267,48 +267,51 @@ class Mapper } switch ((!empty($validator)) ? $validator::class : '') { - case 'Appwrite\Network\Validator\CNAME': - case 'Appwrite\Task\Validator\Cron': - case 'Appwrite\Utopia\Database\Validator\CustomId': - case 'Utopia\Validator\Domain': - case 'Appwrite\Network\Validator\Email': + case 'Appwrite\Auth\Validator\Password': case 'Appwrite\Event\Validator\Event': case 'Appwrite\Event\Validator\FunctionEvent': + case 'Appwrite\Network\Validator\CNAME': + case 'Appwrite\Network\Validator\Email': + case 'Appwrite\Network\Validator\Redirect': + case 'Appwrite\Network\Validator\DNS': + case 'Appwrite\Network\Validator\Origin': + case 'Appwrite\Task\Validator\Cron': + case 'Appwrite\Utopia\Database\Validator\CustomId': + case 'Utopia\Database\Validator\Key': + case 'Utopia\Database\Validator\UID': + case 'Utopia\Validator\Domain': case 'Utopia\Validator\HexColor': case 'Utopia\Validator\Host': case 'Utopia\Validator\IP': - case 'Utopia\Database\Validator\Key': case 'Utopia\Validator\Origin': - case 'Appwrite\Auth\Validator\Password': case 'Utopia\Validator\Text': - case 'Utopia\Database\Validator\UID': case 'Utopia\Validator\URL': case 'Utopia\Validator\WhiteList': default: $type = Type::string(); break; - case 'Utopia\Database\Validator\Authorization': + case 'Appwrite\Utopia\Database\Validator\Queries\Attributes': case 'Appwrite\Utopia\Database\Validator\Queries\Base': case 'Appwrite\Utopia\Database\Validator\Queries\Buckets': case 'Appwrite\Utopia\Database\Validator\Queries\Collections': - case 'Appwrite\Utopia\Database\Validator\Queries\Attributes': - case 'Appwrite\Utopia\Database\Validator\Queries\Indexes': case 'Appwrite\Utopia\Database\Validator\Queries\Databases': case 'Appwrite\Utopia\Database\Validator\Queries\Deployments': - case 'Appwrite\Utopia\Database\Validator\Queries\Installations': - case 'Utopia\Database\Validator\Queries\Documents': case 'Appwrite\Utopia\Database\Validator\Queries\Executions': case 'Appwrite\Utopia\Database\Validator\Queries\Files': case 'Appwrite\Utopia\Database\Validator\Queries\Functions': - case 'Appwrite\Utopia\Database\Validator\Queries\Rules': + case 'Appwrite\Utopia\Database\Validator\Queries\Indexes': + case 'Appwrite\Utopia\Database\Validator\Queries\Installations': case 'Appwrite\Utopia\Database\Validator\Queries\Memberships': - case 'Utopia\Database\Validator\Permissions': case 'Appwrite\Utopia\Database\Validator\Queries\Projects': - case 'Utopia\Database\Validator\Queries': - case 'Utopia\Database\Validator\Roles': + case 'Appwrite\Utopia\Database\Validator\Queries\Rules': case 'Appwrite\Utopia\Database\Validator\Queries\Teams': case 'Appwrite\Utopia\Database\Validator\Queries\Users': case 'Appwrite\Utopia\Database\Validator\Queries\Variables': + case 'Utopia\Database\Validator\Authorization': + case 'Utopia\Database\Validator\Permissions': + case 'Utopia\Database\Validator\Queries': + case 'Utopia\Database\Validator\Queries\Documents': + case 'Utopia\Database\Validator\Roles': $type = Type::listOf(Type::string()); break; case 'Utopia\Validator\Boolean': diff --git a/src/Appwrite/Migration/Migration.php b/src/Appwrite/Migration/Migration.php index 26b0a0301f..9071e0cabe 100644 --- a/src/Appwrite/Migration/Migration.php +++ b/src/Appwrite/Migration/Migration.php @@ -157,7 +157,7 @@ abstract class Migration */ public function forEachDocument(callable $callback): void { - $projectInternalId = $this->project->getInternalId(); + $projectInternalId = $this->project->getSequence(); $collections = match ($projectInternalId) { 'console' => $this->collections['console'], @@ -210,7 +210,7 @@ abstract class Migration { $name ??= $id; - $collectionType = match ($this->project->getInternalId()) { + $collectionType = match ($this->project->getSequence()) { 'console' => 'console', default => 'projects', }; @@ -261,7 +261,7 @@ abstract class Migration ): void { $from ??= $collectionId; - $collectionType = match ($this->project->getInternalId()) { + $collectionType = match ($this->project->getSequence()) { 'console' => 'console', default => 'projects', }; @@ -326,7 +326,7 @@ abstract class Migration ): void { $from ??= $collectionId; - $collectionType = match ($this->project->getInternalId()) { + $collectionType = match ($this->project->getSequence()) { 'console' => 'console', default => 'projects', }; @@ -384,7 +384,7 @@ abstract class Migration { $from ??= $collectionId; - $collectionType = match ($this->project->getInternalId()) { + $collectionType = match ($this->project->getSequence()) { 'console' => 'console', default => 'projects', }; @@ -430,7 +430,7 @@ abstract class Migration */ protected function changeAttributeInternalType(string $collection, string $attribute, string $type): void { - $stmt = $this->pdo->prepare("ALTER TABLE `{$this->dbForProject->getDatabase()}`.`_{$this->project->getInternalId()}_{$collection}` MODIFY `$attribute` $type;"); + $stmt = $this->pdo->prepare("ALTER TABLE `{$this->dbForProject->getDatabase()}`.`_{$this->project->getSequence()}_{$collection}` MODIFY `$attribute` $type;"); try { $stmt->execute(); diff --git a/src/Appwrite/Migration/Version/V15.php b/src/Appwrite/Migration/Version/V15.php index 8eab916f19..15331e9a37 100644 --- a/src/Appwrite/Migration/Version/V15.php +++ b/src/Appwrite/Migration/Version/V15.php @@ -95,7 +95,7 @@ class V15 extends Migration $this->migrateStatsMetric('storage.files.delete', 'files.$all.requests.delete'); foreach ($this->documentsIterator('buckets') as $bucket) { - $bucketTable = "bucket_{$bucket->getInternalId()}"; + $bucketTable = "bucket_{$bucket->getSequence()}"; $this->createPermissionsColumn($bucketTable); $this->migrateDateTimeAttribute($bucketTable, '_createdAt'); @@ -178,7 +178,7 @@ class V15 extends Migration * Migrate every Database. */ foreach ($this->documentsIterator('databases') as $database) { - $databaseTable = "database_{$database->getInternalId()}"; + $databaseTable = "database_{$database->getSequence()}"; $this->createPermissionsColumn($databaseTable); $this->migrateDateTimeAttribute($databaseTable, '_createdAt'); $this->migrateDateTimeAttribute($databaseTable, '_updatedAt'); @@ -216,7 +216,7 @@ class V15 extends Migration */ Console::info("Migrating Collections of {$database->getId()} ({$database->getAttribute('name')})"); foreach ($this->documentsIterator($databaseTable) as $collection) { - $collectionTable = "{$databaseTable}_collection_{$collection->getInternalId()}"; + $collectionTable = "{$databaseTable}_collection_{$collection->getSequence()}"; $this->createPermissionsColumn($collectionTable); $this->migrateDateTimeAttribute($collectionTable, '_createdAt'); $this->migrateDateTimeAttribute($collectionTable, '_updatedAt'); @@ -277,7 +277,7 @@ class V15 extends Migration $this->removeWritePermissions($databaseTable); try { - $this->dbForProject->deleteAttribute("database_{$database->getInternalId()}", 'permission'); + $this->dbForProject->deleteAttribute("database_{$database->getSequence()}", 'permission'); } catch (\Throwable $th) { Console::warning("'permission' from {$databaseTable}: {$th->getMessage()}"); } @@ -293,7 +293,7 @@ class V15 extends Migration protected function removeWritePermissions(string $table): void { try { - $this->pdo->prepare("DELETE FROM `{$this->dbForProject->getDatabase()}`.`_{$this->project->getInternalId()}_{$table}_perms` WHERE _type = 'write'")->execute(); + $this->pdo->prepare("DELETE FROM `{$this->dbForProject->getDatabase()}`.`_{$this->project->getSequence()}_{$table}_perms` WHERE _type = 'write'")->execute(); } catch (\Throwable $th) { Console::warning("Remove 'write' permissions from {$table}: {$th->getMessage()}"); } @@ -309,7 +309,7 @@ class V15 extends Migration */ protected function getSQLColumnTypes(string $table): array { - $query = $this->pdo->prepare("SELECT COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '_{$this->project->getInternalId()}_{$table}' AND table_schema = '{$this->dbForProject->getDatabase()}'"); + $query = $this->pdo->prepare("SELECT COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '_{$this->project->getSequence()}_{$table}' AND table_schema = '{$this->dbForProject->getDatabase()}'"); $query->execute(); return array_reduce($query->fetchAll(), function (array $carry, array $item) { @@ -331,8 +331,8 @@ class V15 extends Migration if ($columns[$attribute] === 'int') { try { - $this->pdo->prepare("ALTER TABLE IF EXISTS `{$this->dbForProject->getDatabase()}`.`_{$this->project->getInternalId()}_{$table}` MODIFY {$attribute} VARCHAR(64)")->execute(); - $this->pdo->prepare("UPDATE `{$this->dbForProject->getDatabase()}`.`_{$this->project->getInternalId()}_{$table}` SET {$attribute} = IF({$attribute} = 0, NULL, FROM_UNIXTIME({$attribute}))")->execute(); + $this->pdo->prepare("ALTER TABLE IF EXISTS `{$this->dbForProject->getDatabase()}`.`_{$this->project->getSequence()}_{$table}` MODIFY {$attribute} VARCHAR(64)")->execute(); + $this->pdo->prepare("UPDATE `{$this->dbForProject->getDatabase()}`.`_{$this->project->getSequence()}_{$table}` SET {$attribute} = IF({$attribute} = 0, NULL, FROM_UNIXTIME({$attribute}))")->execute(); $columns[$attribute] = 'varchar'; } catch (\Throwable $th) { Console::warning($th->getMessage()); @@ -341,7 +341,7 @@ class V15 extends Migration if ($columns[$attribute] === 'varchar') { try { - $this->pdo->prepare("ALTER TABLE IF EXISTS `{$this->dbForProject->getDatabase()}`.`_{$this->project->getInternalId()}_{$table}` MODIFY {$attribute} DATETIME(3)")->execute(); + $this->pdo->prepare("ALTER TABLE IF EXISTS `{$this->dbForProject->getDatabase()}`.`_{$this->project->getSequence()}_{$table}` MODIFY {$attribute} DATETIME(3)")->execute(); } catch (\Throwable $th) { Console::warning($th->getMessage()); } @@ -387,7 +387,7 @@ class V15 extends Migration if (!array_key_exists('_permissions', $columns)) { try { - $this->pdo->prepare("ALTER TABLE IF EXISTS `{$this->dbForProject->getDatabase()}`.`_{$this->project->getInternalId()}_{$table}` ADD `_permissions` MEDIUMTEXT DEFAULT NULL")->execute(); + $this->pdo->prepare("ALTER TABLE IF EXISTS `{$this->dbForProject->getDatabase()}`.`_{$this->project->getSequence()}_{$table}` ADD `_permissions` MEDIUMTEXT DEFAULT NULL")->execute(); } catch (\Throwable $th) { Console::warning("Add '_permissions' column to '{$table}': {$th->getMessage()}"); } @@ -408,7 +408,7 @@ class V15 extends Migration { $table ??= $document->getCollection(); - $query = $this->pdo->prepare("SELECT * FROM `{$this->dbForProject->getDatabase()}`.`_{$this->project->getInternalId()}_{$table}_perms` WHERE _document = '{$document->getId()}'"); + $query = $this->pdo->prepare("SELECT * FROM `{$this->dbForProject->getDatabase()}`.`_{$this->project->getSequence()}_{$table}_perms` WHERE _document = '{$document->getId()}'"); $query->execute(); $results = $query->fetchAll(); $permissions = []; @@ -466,7 +466,7 @@ class V15 extends Migration Console::log("Migrating Collection \"{$id}\""); - $this->dbForProject->setNamespace("_{$this->project->getInternalId()}"); + $this->dbForProject->setNamespace("_{$this->project->getSequence()}"); switch ($id) { case '_metadata': @@ -746,7 +746,7 @@ class V15 extends Migration Permission::delete(Role::any()), ], 'functionId' => $function->getId(), - 'functionInternalId' => $function->getInternalId(), + 'functionInternalId' => $function->getSequence(), 'key' => (string) $key, 'value' => (string) $value, 'search' => implode(' ', [$variableId, $key, $function->getId()]) @@ -1470,9 +1470,9 @@ class V15 extends Migration $from = $this->pdo->quote($from); $to = $this->pdo->quote($to); - $this->pdo->prepare("UPDATE `{$this->dbForProject->getDatabase()}`.`_{$this->project->getInternalId()}_stats` SET metric = {$to} WHERE metric = {$from}")->execute(); + $this->pdo->prepare("UPDATE `{$this->dbForProject->getDatabase()}`.`_{$this->project->getSequence()}_stats` SET metric = {$to} WHERE metric = {$from}")->execute(); } catch (\Throwable $th) { - Console::warning("Migrating steps from {$this->dbForProject->getDatabase()}`.`_{$this->project->getInternalId()}_stats:" . $th->getMessage()); + Console::warning("Migrating steps from {$this->dbForProject->getDatabase()}`.`_{$this->project->getSequence()}_stats:" . $th->getMessage()); } } diff --git a/src/Appwrite/Migration/Version/V16.php b/src/Appwrite/Migration/Version/V16.php index 34407a0471..9d72af9563 100644 --- a/src/Appwrite/Migration/Version/V16.php +++ b/src/Appwrite/Migration/Version/V16.php @@ -45,7 +45,7 @@ class V16 extends Migration Console::log("Migrating Collection \"{$id}\""); - $this->dbForProject->setNamespace("_{$this->project->getInternalId()}"); + $this->dbForProject->setNamespace("_{$this->project->getSequence()}"); switch ($id) { case 'sessions': diff --git a/src/Appwrite/Migration/Version/V17.php b/src/Appwrite/Migration/Version/V17.php index f7cb08d6f4..fbbd4bfde0 100644 --- a/src/Appwrite/Migration/Version/V17.php +++ b/src/Appwrite/Migration/Version/V17.php @@ -44,7 +44,7 @@ class V17 extends Migration protected function migrateBuckets(): void { foreach ($this->documentsIterator('buckets') as $bucket) { - $id = "bucket_{$bucket->getInternalId()}"; + $id = "bucket_{$bucket->getSequence()}"; try { $this->dbForProject->updateAttribute($id, 'mimeType', Database::VAR_STRING, 255, true, false); @@ -67,7 +67,7 @@ class V17 extends Migration Console::log("Migrating Collection \"{$id}\""); - $this->dbForProject->setNamespace("_{$this->project->getInternalId()}"); + $this->dbForProject->setNamespace("_{$this->project->getSequence()}"); switch ($id) { case 'builds': diff --git a/src/Appwrite/Migration/Version/V18.php b/src/Appwrite/Migration/Version/V18.php index a5fae3789b..aa2ad35cca 100644 --- a/src/Appwrite/Migration/Version/V18.php +++ b/src/Appwrite/Migration/Version/V18.php @@ -26,7 +26,7 @@ class V18 extends Migration } Console::log('Migrating Project: ' . $this->project->getAttribute('name') . ' (' . $this->project->getId() . ')'); - $this->dbForProject->setNamespace("_{$this->project->getInternalId()}"); + $this->dbForProject->setNamespace("_{$this->project->getSequence()}"); $this->addDocumentSecurityToProject(); Console::info('Migrating Databases'); @@ -48,12 +48,12 @@ class V18 extends Migration private function migrateDatabases(): void { foreach ($this->documentsIterator('databases') as $database) { - $databaseTable = "database_{$database->getInternalId()}"; + $databaseTable = "database_{$database->getSequence()}"; Console::info("Migrating Collections of {$database->getId()} ({$database->getAttribute('name')})"); foreach ($this->documentsIterator($databaseTable) as $collection) { - $collectionTable = "{$databaseTable}_collection_{$collection->getInternalId()}"; + $collectionTable = "{$databaseTable}_collection_{$collection->getSequence()}"; foreach ($collection['attributes'] ?? [] as $attribute) { if ($attribute['type'] !== Database::VAR_FLOAT) { @@ -197,7 +197,7 @@ class V18 extends Migration * Set the bucket permission in the metadata table */ try { - $internalBucketId = "bucket_{$this->project->getInternalId()}"; + $internalBucketId = "bucket_{$this->project->getSequence()}"; $permissions = $document->getPermissions(); $fileSecurity = $document->getAttribute('fileSecurity', false); $this->dbForProject->updateCollection($internalBucketId, $permissions, $fileSecurity); @@ -224,8 +224,8 @@ class V18 extends Migration // Nonetheless, there's nothing else we can do here. break; } - $internalId = $user->getInternalId(); - $document->setAttribute('userId', $internalId); + $sequence = $user->getSequence(); + $document->setAttribute('userId', $sequence); $data = $document->getAttribute('data', []); $data['userId'] = $user->getId(); $document->setAttribute('data', $data); @@ -244,7 +244,7 @@ class V18 extends Migration /** * Create 'documentSecurity' column */ - $this->pdo->prepare("ALTER TABLE `{$this->dbForProject->getDatabase()}`.`_{$this->project->getInternalId()}__metadata` ADD COLUMN IF NOT EXISTS documentSecurity TINYINT(1);")->execute(); + $this->pdo->prepare("ALTER TABLE `{$this->dbForProject->getDatabase()}`.`_{$this->project->getSequence()}__metadata` ADD COLUMN IF NOT EXISTS documentSecurity TINYINT(1);")->execute(); } catch (\Throwable $th) { Console::warning($th->getMessage()); } @@ -253,7 +253,7 @@ class V18 extends Migration /** * Set 'documentSecurity' column to 1 if NULL */ - $this->pdo->prepare("UPDATE `{$this->dbForProject->getDatabase()}`.`_{$this->project->getInternalId()}__metadata` SET documentSecurity = 1 WHERE documentSecurity IS NULL")->execute(); + $this->pdo->prepare("UPDATE `{$this->dbForProject->getDatabase()}`.`_{$this->project->getSequence()}__metadata` SET documentSecurity = 1 WHERE documentSecurity IS NULL")->execute(); } catch (\Throwable $th) { Console::warning($th->getMessage()); } diff --git a/src/Appwrite/Migration/Version/V19.php b/src/Appwrite/Migration/Version/V19.php index cae27cc6ed..d4dda02d75 100644 --- a/src/Appwrite/Migration/Version/V19.php +++ b/src/Appwrite/Migration/Version/V19.php @@ -28,7 +28,7 @@ class V19 extends Migration } Console::log('Migrating Project: ' . $this->project->getAttribute('name') . ' (' . $this->project->getId() . ')'); - $this->dbForProject->setNamespace("_{$this->project->getInternalId()}"); + $this->dbForProject->setNamespace("_{$this->project->getSequence()}"); Console::info('Migrating Collections'); $this->migrateCollections(); @@ -100,7 +100,7 @@ class V19 extends Migration protected function migrateBuckets(): void { foreach ($this->documentsIterator('buckets') as $bucket) { - $id = "bucket_{$bucket->getInternalId()}"; + $id = "bucket_{$bucket->getSequence()}"; Console::log("Migrating Bucket {$id} {$bucket->getId()} ({$bucket->getAttribute('name')})"); try { @@ -121,7 +121,7 @@ class V19 extends Migration */ private function migrateCollections(): void { - $internalProjectId = $this->project->getInternalId(); + $internalProjectId = $this->project->getSequence(); $collectionType = match ($internalProjectId) { 'console' => 'console', default => 'projects', @@ -680,7 +680,7 @@ class V19 extends Migration case 'builds': $deploymentId = $document->getAttribute('deploymentId'); $deployment = $this->dbForProject->getDocument('deployments', $deploymentId); - $document->setAttribute('deploymentInternalId', $deployment->getInternalId()); + $document->setAttribute('deploymentInternalId', $deployment->getSequence()); $stdout = $document->getAttribute('stdout', ''); $stderr = $document->getAttribute('stderr', ''); @@ -692,12 +692,12 @@ class V19 extends Migration case 'deployments': $resourceId = $document->getAttribute('resourceId'); $function = $this->dbForProject->getDocument('functions', $resourceId); - $document->setAttribute('resourceInternalId', $function->getInternalId()); + $document->setAttribute('resourceInternalId', $function->getSequence()); $buildId = $document->getAttribute('buildId'); if (!empty($buildId)) { $build = $this->dbForProject->getDocument('builds', $buildId); - $document->setAttribute('buildInternalId', $build->getInternalId()); + $document->setAttribute('buildInternalId', $build->getSequence()); } $commands = $this->getFunctionCommands($function); @@ -707,11 +707,11 @@ class V19 extends Migration case 'executions': $functionId = $document->getAttribute('functionId'); $function = $this->dbForProject->getDocument('functions', $functionId); - $document->setAttribute('functionInternalId', $function->getInternalId()); + $document->setAttribute('functionInternalId', $function->getSequence()); $deploymentId = $document->getAttribute('deploymentId'); $deployment = $this->dbForProject->getDocument('deployments', $deploymentId); - $document->setAttribute('deploymentInternalId', $deployment->getInternalId()); + $document->setAttribute('deploymentInternalId', $deployment->getSequence()); break; case 'functions': $document->setAttribute('live', $document->getAttribute('live', true)); @@ -721,7 +721,7 @@ class V19 extends Migration if (!empty($deploymentId)) { $deployment = $this->dbForProject->getDocument('deployments', $deploymentId); - $document->setAttribute('deploymentInternalId', $deployment->getInternalId()); + $document->setAttribute('deploymentInternalId', $deployment->getSequence()); $document->setAttribute('entrypoint', $deployment->getAttribute('entrypoint')); } @@ -733,7 +733,7 @@ class V19 extends Migration 'region' => $project->getAttribute('region'), 'resourceType' => 'function', 'resourceId' => $document->getId(), - 'resourceInternalId' => $document->getInternalId(), + 'resourceInternalId' => $document->getSequence(), 'resourceUpdatedAt' => DateTime::now(), 'projectId' => $this->project->getId(), 'schedule' => $document->getAttribute('schedule'), @@ -741,7 +741,7 @@ class V19 extends Migration ])); $document->setAttribute('scheduleId', $schedule->getId()); - $document->setAttribute('scheduleInternalId', $schedule->getInternalId()); + $document->setAttribute('scheduleInternalId', $schedule->getSequence()); } break; @@ -799,7 +799,7 @@ class V19 extends Migration */ public function forEachDocument(callable $callback): void { - $internalProjectId = $this->project->getInternalId(); + $internalProjectId = $this->project->getSequence(); $collections = match ($internalProjectId) { 'console' => $this->collections['console'], diff --git a/src/Appwrite/Migration/Version/V20.php b/src/Appwrite/Migration/Version/V20.php index 3a9bba6772..9ff041eb33 100644 --- a/src/Appwrite/Migration/Version/V20.php +++ b/src/Appwrite/Migration/Version/V20.php @@ -36,13 +36,13 @@ class V20 extends Migration } Console::log('Migrating Project: ' . $this->project->getAttribute('name') . ' (' . $this->project->getId() . ')'); - $this->dbForProject->setNamespace("_{$this->project->getInternalId()}"); + $this->dbForProject->setNamespace("_{$this->project->getSequence()}"); Console::info('Migrating Collections'); $this->migrateCollections(); // No need to migrate stats for console - if ($this->project->getInternalId() !== 'console') { + if ($this->project->getSequence() !== 'console') { $this->migrateUsageMetrics('project.$all.network.requests', 'network.requests'); $this->migrateUsageMetrics('project.$all.network.outbound', 'network.outbound'); $this->migrateUsageMetrics('project.$all.network.inbound', 'network.inbound'); @@ -71,7 +71,7 @@ class V20 extends Migration */ private function migrateCollections(): void { - $internalProjectId = $this->project->getInternalId(); + $internalProjectId = $this->project->getSequence(); $collectionType = match ($internalProjectId) { 'console' => 'console', default => 'projects', @@ -510,7 +510,7 @@ class V20 extends Migration Console::log("Migrating Functions usage stats of {$function->getId()} ({$function->getAttribute('name')})"); $functionId = $function->getId(); - $functionInternalId = $function->getInternalId(); + $functionInternalId = $function->getSequence(); $this->migrateUsageMetrics("deployment.$functionId.storage.size", "function.$functionInternalId.deployments.storage"); $this->migrateUsageMetrics("builds.$functionId.compute.total", "$functionInternalId.builds"); @@ -536,22 +536,22 @@ class V20 extends Migration foreach ($this->documentsIterator('databases') as $database) { Console::log("Migrating Collections of {$database->getId()} ({$database->getAttribute('name')})"); - $databaseTable = "database_{$database->getInternalId()}"; + $databaseTable = "database_{$database->getSequence()}"; // Database level $databaseId = $database->getId(); - $databaseInternalId = $database->getInternalId(); + $databaseInternalId = $database->getSequence(); $this->migrateUsageMetrics("collections.$databaseId.count.total", "$databaseInternalId.collections"); $this->migrateUsageMetrics("documents.$databaseId.count.total", "$databaseInternalId.documents"); foreach ($this->documentsIterator($databaseTable) as $collection) { - $collectionTable = "{$databaseTable}_collection_{$collection->getInternalId()}"; + $collectionTable = "{$databaseTable}_collection_{$collection->getSequence()}"; Console::log("Migrating Collections of {$collectionTable} {$collection->getId()} ({$collection->getAttribute('name')})"); // Collection level $collectionId = $collection->getId(); - $collectionInternalId = $collection->getInternalId(); + $collectionInternalId = $collection->getSequence(); $this->migrateUsageMetrics("documents.$databaseId/$collectionId.count.total", "$databaseInternalId.$collectionInternalId.documents"); } @@ -573,12 +573,12 @@ class V20 extends Migration $this->migrateUsageMetrics('files.$all.storage.size', 'files.storage'); foreach ($this->documentsIterator('buckets') as $bucket) { - $id = "bucket_{$bucket->getInternalId()}"; + $id = "bucket_{$bucket->getSequence()}"; Console::log("Migrating Bucket {$id} {$bucket->getId()} ({$bucket->getAttribute('name')})"); // Bucket level $bucketId = $bucket->getId(); - $bucketInternalId = $bucket->getInternalId(); + $bucketInternalId = $bucket->getSequence(); $this->migrateUsageMetrics("files.$bucketId.count.total", "$bucketInternalId.files"); $this->migrateUsageMetrics("files.$bucketId.storage.size", "$bucketInternalId.files.storage"); @@ -605,7 +605,7 @@ class V20 extends Migration $target = new Document([ '$id' => ID::unique(), 'userId' => $document->getId(), - 'userInternalId' => $document->getInternalId(), + 'userInternalId' => $document->getSequence(), 'providerType' => MESSAGE_TYPE_EMAIL, 'identifier' => $document->getAttribute('email'), ]); @@ -620,7 +620,7 @@ class V20 extends Migration $target = new Document([ '$id' => ID::unique(), 'userId' => $document->getId(), - 'userInternalId' => $document->getInternalId(), + 'userInternalId' => $document->getSequence(), 'providerType' => MESSAGE_TYPE_SMS, 'identifier' => $document->getAttribute('phone'), ]); diff --git a/src/Appwrite/Migration/Version/V21.php b/src/Appwrite/Migration/Version/V21.php index 38e8a8d513..891d2a92fe 100644 --- a/src/Appwrite/Migration/Version/V21.php +++ b/src/Appwrite/Migration/Version/V21.php @@ -29,12 +29,12 @@ class V21 extends Migration } Console::log('Migrating Project: ' . $this->project->getAttribute('name') . ' (' . $this->project->getId() . ')'); - $this->dbForProject->setNamespace("_{$this->project->getInternalId()}"); + $this->dbForProject->setNamespace("_{$this->project->getSequence()}"); Console::info('Migrating Collections'); $this->migrateCollections(); - if ($this->project->getInternalId() !== 'console') { + if ($this->project->getSequence() !== 'console') { Console::info('Migrating Buckets'); $this->migrateBuckets(); } @@ -51,7 +51,7 @@ class V21 extends Migration */ private function migrateCollections(): void { - $internalProjectId = $this->project->getInternalId(); + $internalProjectId = $this->project->getSequence(); $collectionType = match ($internalProjectId) { 'console' => 'console', default => 'projects', @@ -251,7 +251,7 @@ class V21 extends Migration private function migrateBuckets(): void { $this->dbForProject->forEach('buckets', function (Document $bucket) { - $bucketId = 'bucket_' . $bucket['$internalId']; + $bucketId = 'bucket_' . $bucket['$sequence']; Console::log("Migrating Bucket {$bucketId} {$bucket->getId()} ({$bucket->getAttribute('name')})"); diff --git a/src/Appwrite/Migration/Version/V22.php b/src/Appwrite/Migration/Version/V22.php index 2a6a64ed48..ba9c9dc126 100644 --- a/src/Appwrite/Migration/Version/V22.php +++ b/src/Appwrite/Migration/Version/V22.php @@ -50,7 +50,7 @@ class V22 extends Migration */ private function migrateCollections(): void { - $projectInternalId = $this->project->getInternalId(); + $projectInternalId = $this->project->getSequence(); if (empty($projectInternalId)) { throw new Exception('Project ID is null'); @@ -150,9 +150,9 @@ class V22 extends Migration ]; foreach ($indexes as $index) { try { - $this->createIndexFromCollection($this->dbForProject, $id, $index); + $this->dbForProject->deleteIndex($id, $index); } catch (Throwable $th) { - Console::warning("Failed to create index \"$index\" from {$id}: {$th->getMessage()}"); + Console::warning("Failed to delete index \"$index\" from {$id}: {$th->getMessage()}"); } } $this->dbForProject->purgeCachedCollection($id); @@ -412,7 +412,7 @@ class V22 extends Migration 2. Fill "deploymentCreatedAt" with deployment's "$createdAt" --- Fetch latestDeployment using find() 3. Fill latestDeploymentId with latestDeployment's "$id" - 4. Fill latestDeploymentInternalId with latestDeployment's "$internalId" + 4. Fill latestDeploymentInternalId with latestDeployment's "$sequence" 5. Fill latestDeploymentCreatedAt with latestDeployment's "$createdAt" 6. Fill latestDeploymentStatus with latestDeployment's build's "status" */ @@ -451,7 +451,7 @@ class V22 extends Migration $document ->setAttribute('latestDeploymentId', $latestDeployment->getId()) - ->setAttribute('latestDeploymentInternalId', $latestDeployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $latestDeployment->getSequence()) ->setAttribute('latestDeploymentCreatedAt', $latestDeployment->getCreatedAt()) ->setAttribute('latestDeploymentStatus', $latestBuild->getAttribute('status', $document->getAttribute('latestDeploymentStatus', ''))); break; @@ -515,7 +515,7 @@ class V22 extends Migration private function cleanCollections(): void { - $projectInternalId = $this->project->getInternalId(); + $projectInternalId = $this->project->getSequence(); $collectionType = match ($projectInternalId) { 'console' => 'console', diff --git a/src/Appwrite/Network/Platform.php b/src/Appwrite/Network/Platform.php new file mode 100644 index 0000000000..ea64ff98c1 --- /dev/null +++ b/src/Appwrite/Network/Platform.php @@ -0,0 +1,159 @@ +<?php + +namespace Appwrite\Network; + +class Platform +{ + public const TYPE_UNKNOWN = 'unknown'; + public const TYPE_WEB = 'web'; + public const TYPE_FLUTTER_IOS = 'flutter-ios'; + public const TYPE_FLUTTER_ANDROID = 'flutter-android'; + public const TYPE_FLUTTER_MACOS = 'flutter-macos'; + public const TYPE_FLUTTER_WINDOWS = 'flutter-windows'; + public const TYPE_FLUTTER_LINUX = 'flutter-linux'; + public const TYPE_FLUTTER_WEB = 'flutter-web'; + public const TYPE_APPLE_IOS = 'apple-ios'; + public const TYPE_APPLE_MACOS = 'apple-macos'; + public const TYPE_APPLE_WATCHOS = 'apple-watchos'; + public const TYPE_APPLE_TVOS = 'apple-tvos'; + public const TYPE_ANDROID = 'android'; + public const TYPE_UNITY = 'unity'; + public const TYPE_REACT_NATIVE_IOS = 'react-native-ios'; + public const TYPE_REACT_NATIVE_ANDROID = 'react-native-android'; + public const TYPE_SCHEME = 'scheme'; + + public const SCHEME_HTTP = 'http'; + public const SCHEME_HTTPS = 'https'; + public const SCHEME_CHROME_EXTENSION = 'chrome-extension'; + public const SCHEME_FIREFOX_EXTENSION = 'moz-extension'; + public const SCHEME_SAFARI_EXTENSION = 'safari-web-extension'; + public const SCHEME_EDGE_EXTENSION = 'ms-browser-extension'; + public const SCHEME_IOS = 'appwrite-ios'; + public const SCHEME_MACOS = 'appwrite-macos'; + public const SCHEME_WATCHOS = 'appwrite-watchos'; + public const SCHEME_TVOS = 'appwrite-tvos'; + public const SCHEME_ANDROID = 'appwrite-android'; + public const SCHEME_WINDOWS = 'appwrite-windows'; + public const SCHEME_LINUX = 'appwrite-linux'; + + /** + * @var array<string, string> Map scheme types to user-friendly platform names. + */ + private static array $names = [ + self::SCHEME_HTTP => 'Web', + self::SCHEME_HTTPS => 'Web', + self::SCHEME_IOS => 'iOS', + self::SCHEME_MACOS => 'macOS', + self::SCHEME_WATCHOS => 'watchOS', + self::SCHEME_TVOS => 'tvOS', + self::SCHEME_ANDROID => 'Android', + self::SCHEME_WINDOWS => 'Windows', + self::SCHEME_LINUX => 'Linux', + self::SCHEME_CHROME_EXTENSION => 'Web (Chrome Extension)', + self::SCHEME_FIREFOX_EXTENSION => 'Web (Firefox Extension)', + self::SCHEME_SAFARI_EXTENSION => 'Web (Safari Extension)', + self::SCHEME_EDGE_EXTENSION => 'Web (Edge Extension)', + ]; + + /** + * Get user-friendly platform name from a scheme. + * + * @param string|null $scheme + * @return string Empty string if scheme is not found. + */ + public static function getNameByScheme(?string $scheme): string + { + return self::$names[$scheme] ?? ''; + } + + public static function getHostnames(array $platforms): array + { + $hostnames = []; + foreach ($platforms as $platform) { + $type = strtolower($platform['type'] ?? self::TYPE_UNKNOWN); + $hostname = strtolower($platform['hostname'] ?? ''); + $key = strtolower($platform['key'] ?? ''); + + switch ($type) { + case self::TYPE_WEB: + case self::TYPE_FLUTTER_WEB: + if (!empty($hostname)) { + $hostnames[] = $hostname; + } + break; + case self::TYPE_FLUTTER_IOS: + case self::TYPE_FLUTTER_ANDROID: + case self::TYPE_FLUTTER_MACOS: + case self::TYPE_FLUTTER_WINDOWS: + case self::TYPE_FLUTTER_LINUX: + case self::TYPE_ANDROID: + case self::TYPE_APPLE_IOS: + case self::TYPE_APPLE_MACOS: + case self::TYPE_APPLE_WATCHOS: + case self::TYPE_APPLE_TVOS: + case self::TYPE_REACT_NATIVE_IOS: + case self::TYPE_REACT_NATIVE_ANDROID: + case self::TYPE_UNITY: + if (!empty($key)) { + $hostnames[] = $key; + } + break; + default: + break; + } + } + return array_unique($hostnames); + } + + public static function getSchemes(array $platforms): array + { + $schemes = []; + foreach ($platforms as $platform) { + $type = strtolower($platform['type'] ?? self::TYPE_UNKNOWN); + $scheme = strtolower($platform['key'] ?? ''); + + switch ($type) { + case self::TYPE_SCHEME: + if (!empty($scheme) && preg_match('/^[a-z][a-z0-9+.-]*$/', $scheme)) { + $schemes[] = $scheme; + } + break; + case self::TYPE_WEB: + case self::TYPE_FLUTTER_WEB: + $schemes[] = self::SCHEME_HTTP; + $schemes[] = self::SCHEME_HTTPS; + break; + case self::TYPE_FLUTTER_IOS: + case self::TYPE_APPLE_IOS: + case self::TYPE_REACT_NATIVE_IOS: + $schemes[] = self::SCHEME_IOS; + break; + case self::TYPE_FLUTTER_ANDROID: + case self::TYPE_ANDROID: + case self::TYPE_REACT_NATIVE_ANDROID: + $schemes[] = self::SCHEME_ANDROID; + break; + case self::TYPE_FLUTTER_MACOS: + case self::TYPE_APPLE_MACOS: + $schemes[] = self::SCHEME_MACOS; + break; + case self::TYPE_FLUTTER_WINDOWS: + case self::TYPE_UNITY: + $schemes[] = self::SCHEME_WINDOWS; + break; + case self::TYPE_FLUTTER_LINUX: + $schemes[] = self::SCHEME_LINUX; + break; + case self::TYPE_APPLE_WATCHOS: + $schemes[] = self::SCHEME_WATCHOS; + break; + case self::TYPE_APPLE_TVOS: + $schemes[] = self::SCHEME_TVOS; + break; + default: + break; + } + } + return array_unique($schemes); + } +} diff --git a/src/Appwrite/Network/Validator/Origin.php b/src/Appwrite/Network/Validator/Origin.php index d41e9af2ad..7843a17f1c 100644 --- a/src/Appwrite/Network/Validator/Origin.php +++ b/src/Appwrite/Network/Validator/Origin.php @@ -2,150 +2,91 @@ namespace Appwrite\Network\Validator; +use Appwrite\Network\Platform; use Utopia\Validator; use Utopia\Validator\Hostname; class Origin extends Validator { - public const CLIENT_TYPE_UNKNOWN = 'unknown'; - public const CLIENT_TYPE_WEB = 'web'; - public const CLIENT_TYPE_FLUTTER_IOS = 'flutter-ios'; - public const CLIENT_TYPE_FLUTTER_ANDROID = 'flutter-android'; - public const CLIENT_TYPE_FLUTTER_MACOS = 'flutter-macos'; - public const CLIENT_TYPE_FLUTTER_WINDOWS = 'flutter-windows'; - public const CLIENT_TYPE_FLUTTER_LINUX = 'flutter-linux'; - public const CLIENT_TYPE_FLUTTER_WEB = 'flutter-web'; - public const CLIENT_TYPE_APPLE_IOS = 'apple-ios'; - public const CLIENT_TYPE_APPLE_MACOS = 'apple-macos'; - public const CLIENT_TYPE_APPLE_WATCHOS = 'apple-watchos'; - public const CLIENT_TYPE_APPLE_TVOS = 'apple-tvos'; - public const CLIENT_TYPE_ANDROID = 'android'; - public const CLIENT_TYPE_UNITY = 'unity'; - public const CLIENT_TYPE_REACT_NATIVE_IOS = 'react-native-ios'; - public const CLIENT_TYPE_REACT_NATIVE_ANDROID = 'react-native-android'; - - - public const SCHEME_TYPE_HTTP = 'http'; - public const SCHEME_TYPE_HTTPS = 'https'; - public const SCHEME_TYPE_IOS = 'appwrite-ios'; - public const SCHEME_TYPE_MACOS = 'appwrite-macos'; - public const SCHEME_TYPE_WATCHOS = 'appwrite-watchos'; - public const SCHEME_TYPE_TVOS = 'appwrite-tvos'; - public const SCHEME_TYPE_ANDROID = 'appwrite-android'; - public const SCHEME_TYPE_WINDOWS = 'appwrite-windows'; - public const SCHEME_TYPE_LINUX = 'appwrite-linux'; + protected array $hostnames = []; + protected array $schemes = []; + protected ?string $scheme = null; + protected ?string $host = null; + protected string $origin = ''; /** - * @var array + * Constructor + * + * @param array<\Utopia\Database\Document> $platforms */ - protected $platforms = [ - self::SCHEME_TYPE_HTTP => 'Web', - self::SCHEME_TYPE_HTTPS => 'Web', - self::SCHEME_TYPE_IOS => 'iOS', - self::SCHEME_TYPE_MACOS => 'macOS', - self::SCHEME_TYPE_WATCHOS => 'watchOS', - self::SCHEME_TYPE_TVOS => 'tvOS', - self::SCHEME_TYPE_ANDROID => 'Android', - self::SCHEME_TYPE_WINDOWS => 'Windows', - self::SCHEME_TYPE_LINUX => 'Linux', - ]; - - /** - * @var array - */ - protected $clients = [ - ]; - - /** - * @var string - */ - protected $client = self::CLIENT_TYPE_UNKNOWN; - - /** - * @var string - */ - protected $host = ''; - - /** - * @param string $target - */ - public function __construct($platforms) + public function __construct(array $platforms) { - foreach ($platforms as $platform) { - $type = (isset($platform['type'])) ? $platform['type'] : ''; - - switch ($type) { - case self::CLIENT_TYPE_WEB: - case self::CLIENT_TYPE_FLUTTER_WEB: - $this->clients[] = (isset($platform['hostname'])) ? $platform['hostname'] : ''; - break; - - case self::CLIENT_TYPE_FLUTTER_IOS: - case self::CLIENT_TYPE_FLUTTER_ANDROID: - case self::CLIENT_TYPE_FLUTTER_MACOS: - case self::CLIENT_TYPE_FLUTTER_WINDOWS: - case self::CLIENT_TYPE_FLUTTER_LINUX: - case self::CLIENT_TYPE_ANDROID: - case self::CLIENT_TYPE_APPLE_IOS: - case self::CLIENT_TYPE_APPLE_MACOS: - case self::CLIENT_TYPE_APPLE_WATCHOS: - case self::CLIENT_TYPE_APPLE_TVOS: - case self::CLIENT_TYPE_REACT_NATIVE_IOS: - case self::CLIENT_TYPE_REACT_NATIVE_ANDROID: - $this->clients[] = (isset($platform['key'])) ? $platform['key'] : ''; - break; - - default: - # code... - break; - } - } + $this->hostnames = Platform::getHostnames($platforms); + $this->schemes = Platform::getSchemes($platforms); } - public function getDescription(): string - { - if (!\array_key_exists($this->client, $this->platforms)) { - return 'Unsupported platform'; - } - - return 'Invalid Origin. Register your new client (' . $this->host . ') as a new ' - . $this->platforms[$this->client] . ' platform on your project console dashboard'; - } /** - * Check if Origin has been allowed - * for access to the API - * - * @param mixed $origin - * + * Check if Origin is valid. + * @param mixed $origin The Origin URI. * @return bool */ public function isValid($origin): bool { - if (!is_string($origin)) { + $this->origin = $origin; + $this->scheme = null; + $this->host = null; + + if (!is_string($origin) || empty($origin)) { return false; } - $scheme = \parse_url($origin, PHP_URL_SCHEME); - $host = \parse_url($origin, PHP_URL_HOST); + $this->scheme = $this->parseScheme($origin); + $this->host = strtolower(parse_url($origin, PHP_URL_HOST) ?? ''); - $this->host = $host; - $this->client = $scheme; + $webPlatforms = [ + Platform::SCHEME_HTTP, + Platform::SCHEME_HTTPS, + Platform::SCHEME_CHROME_EXTENSION, + Platform::SCHEME_FIREFOX_EXTENSION, + Platform::SCHEME_SAFARI_EXTENSION, + Platform::SCHEME_EDGE_EXTENSION, + ]; + if (in_array($this->scheme, $webPlatforms, true)) { + $validator = new Hostname($this->hostnames); + return $validator->isValid($this->host); + } - if (empty($host)) { + if (!empty($this->scheme) && in_array($this->scheme, $this->schemes, true)) { return true; } - $validator = new Hostname($this->clients); + return false; + } - return $validator->isValid($host); + /** + * Get Description + * @return string + */ + public function getDescription(): string + { + $platform = $this->scheme ? Platform::getNameByScheme($this->scheme) : ''; + $host = $this->host ? '(' . $this->host . ')' : ''; + + if (empty($this->host) && empty($this->scheme)) { + return 'Invalid Origin.'; + } + + if (empty($platform)) { + return 'Invalid Scheme. The scheme used (' . $this->scheme . ') in the Origin (' . $this->origin . ') is not supported. If you are using a custom scheme, please change it to `appwrite-callback-<PROJECT_ID>`'; + } + + return 'Invalid Origin. Register your new client ' . $host . ' as a new ' + . $platform . ' platform on your project console dashboard'; } /** * Is array - * - * Function will return true if object is array. - * * @return bool */ public function isArray(): bool @@ -155,13 +96,35 @@ class Origin extends Validator /** * Get Type - * - * Returns validator type. - * * @return string */ public function getType(): string { return self::TYPE_STRING; } + + /** + * Parses the scheme from a URI string. + * + * @param string $uri The URI string to parse. + * @return string|null The extracted scheme string (e.g., "http", "exp", "mailto") + */ + public function parseScheme(string $uri): ?string + { + $uri = trim($uri); + if ($uri === '') { + return null; // No scheme in empty string + } + + $scheme = parse_url($uri, PHP_URL_SCHEME); + if ($scheme === false) { + if (preg_match('/^([a-z][a-z0-9+.-]*):/i', $uri, $matches)) { + return $matches[1]; + } else { + return null; + } + } else { + return $scheme; + } + } } diff --git a/src/Appwrite/Network/Validator/Redirect.php b/src/Appwrite/Network/Validator/Redirect.php new file mode 100644 index 0000000000..162f4c7eb9 --- /dev/null +++ b/src/Appwrite/Network/Validator/Redirect.php @@ -0,0 +1,25 @@ +<?php + +namespace Appwrite\Network\Validator; + +use Appwrite\Network\Platform; + +class Redirect extends Origin +{ + /** + * Get Description + * @return string + */ + public function getDescription(): string + { + $platform = Platform::getNameByScheme($this->scheme); + $host = $this->host ? '(' . $this->host . ')' : ''; + + if (empty($this->host) && empty($this->scheme)) { + return 'Invalid URI.'; + } + + return 'Invalid URI. Register your new client ' . $host . ' as a new ' + . $platform . ' platform on your project console dashboard'; + } +} diff --git a/src/Appwrite/Platform/Action.php b/src/Appwrite/Platform/Action.php index 72c41582ea..e5a7cf7984 100644 --- a/src/Appwrite/Platform/Action.php +++ b/src/Appwrite/Platform/Action.php @@ -3,7 +3,10 @@ namespace Appwrite\Platform; use Swoole\Coroutine as Co; +use Utopia\CLI\Console; use Utopia\Database\Database; +use Utopia\Database\DateTime; +use Utopia\Database\Document; use Utopia\Database\Query; use Utopia\Platform\Action as UtopiaAction; @@ -16,6 +19,12 @@ class Action extends UtopiaAction */ protected mixed $logError; + protected array $filters = [ + 'subQueryKeys', 'subQueryWebhooks', 'subQueryPlatforms', 'subQueryProjectVariables', 'subQueryBlocks', 'subQueryDevKeys', // Project + 'subQueryAuthenticators', 'subQuerySessions', 'subQueryTokens', 'subQueryChallenges', 'subQueryMemberships', 'subQueryTargets', 'subQueryTopicTargets',// Users + 'subQueryVariables', // Sites + ]; + /** * Foreach Document * Call provided callback for each document in the collection @@ -87,4 +96,57 @@ class Action extends UtopiaAction $latestDocument = $results[array_key_last($results)]; } } + + public function disableSubqueries() + { + $filters = $this->filters; + + foreach ($filters as $filter) { + Database::addFilter( + $filter, + function (mixed $value) { + return; + }, + function (mixed $value, Document $document, Database $database) { + return []; + } + ); + } + } + + /** + * Dump Log Message + * + * Logs messages to console with timestamp, method context, and project details. + * Supports multiple log types: success, error, log, warning, and info (default). + * + * @param string $method The calling method name + * @param string $log The log message + * @param string $type The log type (success, error, log, warning, info) + * @param Document|null $project The project document for context + * @param string $collectionId The collection identifier + * @return void + */ + public function dump(string $method, string $log, string $type = 'info', ?Document $project = null, string $collectionId = ''): void + { + if (empty($project)) { + $project = new Document([]); + } + switch ($type) { + case 'success': + Console::success("[" . DateTime::now() . "] " . $method . ' ' . $type . ' ' . $project->getSequence() . ' ' . $project->getId() . ' ' . $collectionId . ' ' . $log); + break; + case 'error': + Console::error("[" . DateTime::now() . "] " . $method . ' ' . $type . ' ' . $project->getSequence() . ' ' . $project->getId() . ' ' . $collectionId . ' ' . $log); + break; + case 'log': + Console::log("[" . DateTime::now() . "] " . $method . ' ' . $type . ' ' . $project->getSequence() . ' ' . $project->getId() . ' ' . $collectionId . ' ' . $log); + break; + case 'warning': + Console::warning("[" . DateTime::now() . "] " . $method . ' ' . $type . ' ' . $project->getSequence() . ' ' . $project->getId() . ' ' . $collectionId . ' ' . $log); + break; + default: + Console::info("[" . DateTime::now() . "] " . $method . ' ' . $type . ' ' . $project->getSequence() . ' ' . $project->getId() . ' ' . $collectionId . ' ' . $log); + } + } } diff --git a/src/Appwrite/Platform/Modules/Compute/Base.php b/src/Appwrite/Platform/Modules/Compute/Base.php index 47529a142b..e58f2b8664 100644 --- a/src/Appwrite/Platform/Modules/Compute/Base.php +++ b/src/Appwrite/Platform/Modules/Compute/Base.php @@ -4,9 +4,9 @@ namespace Appwrite\Platform\Modules\Compute; use Appwrite\Event\Build; use Appwrite\Extend\Exception; -use Appwrite\Query; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Exception\Duplicate; use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Database\Helpers\Role; @@ -69,13 +69,13 @@ class Base extends Action Permission::delete(Role::any()), ], 'resourceId' => $function->getId(), - 'resourceInternalId' => $function->getInternalId(), + 'resourceInternalId' => $function->getSequence(), 'resourceType' => 'functions', 'entrypoint' => $entrypoint, 'buildCommands' => $function->getAttribute('commands', ''), 'type' => 'vcs', 'installationId' => $installation->getId(), - 'installationInternalId' => $installation->getInternalId(), + 'installationInternalId' => $installation->getSequence(), 'providerRepositoryId' => $providerRepositoryId, 'repositoryId' => $function->getAttribute('repositoryId', ''), 'repositoryInternalId' => $function->getAttribute('repositoryInternalId', ''), @@ -95,7 +95,7 @@ class Base extends Action $function = $function ->setAttribute('latestDeploymentId', $deployment->getId()) - ->setAttribute('latestDeploymentInternalId', $deployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $deployment->getSequence()) ->setAttribute('latestDeploymentCreatedAt', $deployment->getCreatedAt()) ->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); $dbForProject->updateDocument('functions', $function->getId(), $function); @@ -166,7 +166,7 @@ class Base extends Action Permission::delete(Role::any()), ], 'resourceId' => $site->getId(), - 'resourceInternalId' => $site->getInternalId(), + 'resourceInternalId' => $site->getSequence(), 'resourceType' => 'sites', 'buildCommands' => implode(' && ', $commands), 'buildOutput' => $site->getAttribute('outputDirectory', ''), @@ -174,7 +174,7 @@ class Base extends Action 'fallbackFile' => $site->getAttribute('fallbackFile', ''), 'type' => 'vcs', 'installationId' => $installation->getId(), - 'installationInternalId' => $installation->getInternalId(), + 'installationInternalId' => $installation->getSequence(), 'providerRepositoryId' => $providerRepositoryId, 'repositoryId' => $site->getAttribute('repositoryId', ''), 'repositoryInternalId' => $site->getAttribute('repositoryInternalId', ''), @@ -194,7 +194,7 @@ class Base extends Action $site = $site ->setAttribute('latestDeploymentId', $deployment->getId()) - ->setAttribute('latestDeploymentInternalId', $deployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $deployment->getSequence()) ->setAttribute('latestDeploymentCreatedAt', $deployment->getCreatedAt()) ->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); $dbForProject->updateDocument('sites', $site->getId(), $site); @@ -209,15 +209,15 @@ class Base extends Action fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'domain' => $domain, 'trigger' => 'deployment', 'type' => 'deployment', 'deploymentId' => $deployment->getId(), - 'deploymentInternalId' => $deployment->getInternalId(), + 'deploymentInternalId' => $deployment->getSequence(), 'deploymentResourceType' => 'site', 'deploymentResourceId' => $site->getId(), - 'deploymentResourceInternalId' => $site->getInternalId(), + 'deploymentResourceInternalId' => $site->getSequence(), 'deploymentVcsProviderBranch' => $providerBranch, 'status' => 'verified', 'certificateId' => '', @@ -227,6 +227,73 @@ class Base extends Action ])) ); + if (!empty($commitDetails['commitHash'])) { + $domain = "commit-" . substr($commitDetails['commitHash'], 0, 16) . ".{$sitesDomain}"; + $ruleId = md5($domain); + try { + Authorization::skip( + fn () => $dbForPlatform->createDocument('rules', new Document([ + '$id' => $ruleId, + 'projectId' => $project->getId(), + 'projectInternalId' => $project->getSequence(), + 'domain' => $domain, + 'type' => 'deployment', + 'trigger' => 'deployment', + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + 'deploymentResourceType' => 'site', + 'deploymentResourceId' => $site->getId(), + 'deploymentResourceInternalId' => $site->getSequence(), + 'deploymentVcsProviderBranch' => $providerBranch, + 'status' => 'verified', + 'certificateId' => '', + 'search' => implode(' ', [$ruleId, $domain]), + 'owner' => 'Appwrite', + 'region' => $project->getAttribute('region') + ])) + ); + } catch (Duplicate $err) { + // Ignore, rule already exists; will be updated by builds worker + } + } + + // VCS branch preview + if (!empty($providerBranch)) { + $branchPrefix = substr($providerBranch, 0, 16); + if (strlen($providerBranch) > 16) { + $remainingChars = substr($providerBranch, 16); + $branchPrefix .= '-' . substr(hash('sha256', $remainingChars), 0, 7); + } + $resourceProjectHash = substr(hash('sha256', $site->getId() . $project->getId()), 0, 7); + $domain = "branch-{$branchPrefix}-{$resourceProjectHash}.{$sitesDomain}"; + $ruleId = md5($domain); + try { + Authorization::skip( + fn () => $dbForPlatform->createDocument('rules', new Document([ + '$id' => $ruleId, + 'projectId' => $project->getId(), + 'projectInternalId' => $project->getSequence(), + 'domain' => $domain, + 'type' => 'deployment', + 'trigger' => 'deployment', + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + 'deploymentResourceType' => 'site', + 'deploymentResourceId' => $site->getId(), + 'deploymentResourceInternalId' => $site->getSequence(), + 'deploymentVcsProviderBranch' => $providerBranch, + 'status' => 'verified', + 'certificateId' => '', + 'search' => implode(' ', [$ruleId, $domain]), + 'owner' => 'Appwrite', + 'region' => $project->getAttribute('region') + ])) + ); + } catch (Duplicate $err) { + // Ignore, rule already exists; will be updated by builds worker + } + } + $queueForBuilds ->setType(BUILD_TYPE_DEPLOYMENT) ->setResource($site) @@ -235,38 +302,4 @@ class Base extends Action return $deployment; } - - protected function listRules(Document $project, array $queries, Database $database, callable $callback): void - { - $limit = 100; - $cursor = null; - - do { - $queries = \array_merge([ - Query::limit($limit), - Query::equal("projectInternalId", [$project->getInternalId()]) - ], $queries); - - if ($cursor !== null) { - $queries[] = Query::cursorAfter($cursor); - } - - $results = $database->find('rules', $queries); - - $total = \count($results); - if ($total > 0) { - $cursor = $results[$total - 1]; - } - - if ($total < $limit) { - $cursor = null; - } - - foreach ($results as $document) { - if (is_callable($callback)) { - $callback($document); - } - } - } while (!\is_null($cursor)); - } } diff --git a/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php b/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php index 16a94dc00c..114a24ef22 100644 --- a/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php +++ b/src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php @@ -57,7 +57,7 @@ class Get extends Action ->param('type', '', new WhiteList(['rules']), 'Resource type.') ->inject('response') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php index 1f3febbfef..f64a960507 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php @@ -87,7 +87,7 @@ class Create extends Action ->inject('deviceForLocal') ->inject('queueForBuilds') ->inject('plan') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -237,7 +237,7 @@ class Create extends Action Permission::update(Role::any()), Permission::delete(Role::any()), ], - 'resourceInternalId' => $function->getInternalId(), + 'resourceInternalId' => $function->getSequence(), 'resourceId' => $function->getId(), 'resourceType' => 'functions', 'entrypoint' => $entrypoint, @@ -252,7 +252,7 @@ class Create extends Action $function = $function ->setAttribute('latestDeploymentId', $deployment->getId()) - ->setAttribute('latestDeploymentInternalId', $deployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $deployment->getSequence()) ->setAttribute('latestDeploymentCreatedAt', $deployment->getCreatedAt()) ->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); $dbForProject->updateDocument('functions', $function->getId(), $function); @@ -274,7 +274,7 @@ class Create extends Action Permission::update(Role::any()), Permission::delete(Role::any()), ], - 'resourceInternalId' => $function->getInternalId(), + 'resourceInternalId' => $function->getSequence(), 'resourceId' => $function->getId(), 'resourceType' => 'functions', 'entrypoint' => $entrypoint, @@ -291,7 +291,7 @@ class Create extends Action $function = $function ->setAttribute('latestDeploymentId', $deployment->getId()) - ->setAttribute('latestDeploymentInternalId', $deployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $deployment->getSequence()) ->setAttribute('latestDeploymentCreatedAt', $deployment->getCreatedAt()) ->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); $dbForProject->updateDocument('functions', $function->getId(), $function); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php index 84878055d8..9e314d05c6 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Delete.php @@ -62,7 +62,7 @@ class Delete extends Action ->inject('queueForDeletes') ->inject('queueForEvents') ->inject('deviceForFunctions') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -101,7 +101,7 @@ class Delete extends Action if ($function->getAttribute('latestDeploymentId') === $deployment->getId()) { $latestDeployment = $dbForProject->findOne('deployments', [ Query::equal('resourceType', ['functions']), - Query::equal('resourceInternalId', [$function->getInternalId()]), + Query::equal('resourceInternalId', [$function->getSequence()]), Query::orderDesc('$createdAt'), ]); $function = $dbForProject->updateDocument( @@ -109,7 +109,7 @@ class Delete extends Action $function->getId(), $function ->setAttribute('latestDeploymentCreatedAt', $latestDeployment->isEmpty() ? '' : $latestDeployment->getCreatedAt()) - ->setAttribute('latestDeploymentInternalId', $latestDeployment->isEmpty() ? '' : $latestDeployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $latestDeployment->isEmpty() ? '' : $latestDeployment->getSequence()) ->setAttribute('latestDeploymentId', $latestDeployment->isEmpty() ? '' : $latestDeployment->getId()) ->setAttribute('latestDeploymentStatus', $latestDeployment->isEmpty() ? '' : $latestDeployment->getAttribute('status', '')) ); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Download/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Download/Get.php index 9456ff13a6..fd22248fa3 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Download/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Download/Get.php @@ -61,7 +61,7 @@ class Get extends Action ->inject('dbForProject') ->inject('deviceForFunctions') ->inject('deviceForBuilds') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -105,9 +105,11 @@ class Get extends Action $response ->setContentType('application/gzip') - ->addHeader('Cache-Control', 'private, max-age=3888000') // 45 days + ->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate') + ->addHeader('Expires', '0') + ->addHeader('Pragma', 'no-cache') ->addHeader('X-Peak', \memory_get_peak_usage()) - ->addHeader('Content-Disposition', 'attachment; filename="' . $deploymentId . '.tar.gz"'); + ->addHeader('Content-Disposition', 'attachment; filename="' . $deploymentId . '-' . $type . '.tar.gz"'); $size = $device->getFileSize($path); $rangeHeader = $request->getHeader('range'); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php index 8f739dd37f..28861f71f1 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php @@ -62,7 +62,7 @@ class Create extends Action ->inject('queueForEvents') ->inject('queueForBuilds') ->inject('deviceForFunctions') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -96,9 +96,9 @@ class Create extends Action $destination = $deviceForFunctions->getPath($deploymentId . '.' . \pathinfo('code.tar.gz', PATHINFO_EXTENSION)); $deviceForFunctions->transfer($path, $destination, $deviceForFunctions); - $deployment->removeAttribute('$internalId'); + $deployment->removeAttribute('$sequence'); $deployment = $dbForProject->createDocument('deployments', $deployment->setAttributes([ - '$internalId' => '', + '$sequence' => '', '$id' => $deploymentId, 'sourcePath' => $destination, 'totalSize' => $deployment->getAttribute('sourceSize', 0), @@ -115,7 +115,7 @@ class Create extends Action $function = $function ->setAttribute('latestDeploymentId', $deployment->getId()) - ->setAttribute('latestDeploymentInternalId', $deployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $deployment->getSequence()) ->setAttribute('latestDeploymentCreatedAt', $deployment->getCreatedAt()) ->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); $dbForProject->updateDocument('functions', $function->getId(), $function); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Get.php index e9c5240f5c..a79da7f908 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Get.php @@ -49,7 +49,7 @@ class Get extends Action ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Status/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Status/Update.php index c5436d1d05..e6b45b27de 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Status/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Status/Update.php @@ -59,7 +59,7 @@ class Update extends Action ->inject('project') ->inject('queueForEvents') ->inject('executor') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -97,7 +97,7 @@ class Update extends Action 'status' => 'canceled' ])); - if ($deployment->getInternalId() === $function->getAttribute('latestDeploymentInternalId', '')) { + if ($deployment->getSequence() === $function->getAttribute('latestDeploymentInternalId', '')) { $function = $function->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); $dbForProject->updateDocument('functions', $function->getId(), $function); } diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php index 55230bd4a5..4d93c8e8cd 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php @@ -75,7 +75,7 @@ class Create extends Base ->inject('project') ->inject('queueForBuilds') ->inject('gitHub') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -142,7 +142,7 @@ class Create extends Base Permission::delete(Role::any()), ], 'resourceId' => $function->getId(), - 'resourceInternalId' => $function->getInternalId(), + 'resourceInternalId' => $function->getSequence(), 'resourceType' => 'functions', 'entrypoint' => $function->getAttribute('entrypoint', ''), 'buildCommands' => $function->getAttribute('commands', ''), @@ -152,7 +152,7 @@ class Create extends Base $function = $function ->setAttribute('latestDeploymentId', $deployment->getId()) - ->setAttribute('latestDeploymentInternalId', $deployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $deployment->getSequence()) ->setAttribute('latestDeploymentCreatedAt', $deployment->getCreatedAt()) ->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); $dbForProject->updateDocument('functions', $function->getId(), $function); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php index 48f3894bb2..0ad9852722 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/Vcs/Create.php @@ -72,7 +72,7 @@ class Create extends Base ->inject('queueForEvents') ->inject('queueForBuilds') ->inject('gitHub') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/XList.php index 38f1f38e89..996df299d0 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Deployments/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Deployments/XList.php @@ -57,7 +57,7 @@ class XList extends Action ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -84,7 +84,7 @@ class XList extends Action } // Set resource queries - $queries[] = Query::equal('resourceInternalId', [$function->getInternalId()]); + $queries[] = Query::equal('resourceInternalId', [$function->getSequence()]); $queries[] = Query::equal('resourceType', ['functions']); /** diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php index fd1b2076a8..d502a78e07 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php @@ -94,7 +94,7 @@ class Create extends Base ->inject('queueForFunctions') ->inject('geodb') ->inject('executor') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -253,10 +253,10 @@ class Create extends Base $execution = new Document([ '$id' => $executionId, '$permissions' => !$user->isEmpty() ? [Permission::read(Role::user($user->getId()))] : [], - 'resourceInternalId' => $function->getInternalId(), + 'resourceInternalId' => $function->getSequence(), 'resourceId' => $function->getId(), 'resourceType' => 'functions', - 'deploymentInternalId' => $deployment->getInternalId(), + 'deploymentInternalId' => $deployment->getSequence(), 'deploymentId' => $deployment->getId(), 'trigger' => (!is_null($scheduledAt)) ? 'schedule' : 'http', 'status' => $status, // waiting / processing / completed / failed / scheduled @@ -305,7 +305,7 @@ class Create extends Base 'region' => $project->getAttribute('region'), 'resourceType' => ScheduleExecutions::getSupportedResource(), 'resourceId' => $execution->getId(), - 'resourceInternalId' => $execution->getInternalId(), + 'resourceInternalId' => $execution->getSequence(), 'resourceUpdatedAt' => DateTime::now(), 'projectId' => $project->getId(), 'schedule' => $scheduledAt, @@ -315,7 +315,7 @@ class Create extends Base $execution = $execution ->setAttribute('scheduleId', $schedule->getId()) - ->setAttribute('scheduleInternalId', $schedule->getInternalId()) + ->setAttribute('scheduleInternalId', $schedule->getSequence()) ->setAttribute('scheduledAt', $scheduledAt); $execution = Authorization::skip(fn () => $dbForProject->createDocument('executions', $execution)); @@ -386,7 +386,9 @@ class Create extends Base try { $version = $function->getAttribute('version', 'v2'); $command = $runtime['startCommand']; - $command = $version === 'v2' ? '' : 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $command . '"'; + $source = $deployment->getAttribute('buildPath', ''); + $extension = str_ends_with($source, '.tar') ? 'tar' : 'tar.gz'; + $command = $version === 'v2' ? '' : "cp /tmp/code.$extension /mnt/code/code.$extension && nohup helpers/start.sh \"$command\""; $executionResponse = $executor->createExecution( projectId: $project->getId(), deploymentId: $deployment->getId(), @@ -394,7 +396,7 @@ class Create extends Base variables: $vars, timeout: $function->getAttribute('timeout', 0), image: $runtime['image'], - source: $deployment->getAttribute('buildPath', ''), + source: $source, entrypoint: $deployment->getAttribute('entrypoint', ''), version: $version, path: $path, @@ -439,13 +441,13 @@ class Create extends Base $queueForStatsUsage ->addMetric(METRIC_EXECUTIONS, 1) ->addMetric(str_replace(['{resourceType}'], [RESOURCE_TYPE_FUNCTIONS], METRIC_RESOURCE_TYPE_EXECUTIONS), 1) - ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS), 1) + ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS), 1) ->addMetric(METRIC_EXECUTIONS_COMPUTE, (int)($execution->getAttribute('duration') * 1000)) // per project ->addMetric(str_replace(['{resourceType}'], [RESOURCE_TYPE_FUNCTIONS], METRIC_RESOURCE_TYPE_EXECUTIONS_COMPUTE), (int)($execution->getAttribute('duration') * 1000)) // per function - ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE), (int)($execution->getAttribute('duration') * 1000)) // per function + ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE), (int)($execution->getAttribute('duration') * 1000)) // per function ->addMetric(METRIC_EXECUTIONS_MB_SECONDS, (int)(($spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT) * $execution->getAttribute('duration', 0) * ($spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT))) ->addMetric(str_replace(['{resourceType}'], [RESOURCE_TYPE_FUNCTIONS], METRIC_RESOURCE_TYPE_EXECUTIONS_MB_SECONDS), (int)(($spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT) * $execution->getAttribute('duration', 0) * ($spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT))) - ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS), (int)(($spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT) * $execution->getAttribute('duration', 0) * ($spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT))) + ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS), (int)(($spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT) * $execution->getAttribute('duration', 0) * ($spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT))) ; $execution = Authorization::skip(fn () => $dbForProject->createDocument('executions', $execution)); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php index cd85b5e534..9c818cfacc 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Delete.php @@ -62,7 +62,7 @@ class Delete extends Base ->inject('dbForProject') ->inject('dbForPlatform') ->inject('queueForEvents') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -84,7 +84,7 @@ class Delete extends Base throw new Exception(Exception::EXECUTION_NOT_FOUND); } - if ($execution->getAttribute('resourceType') !== 'functions' && $execution->getAttribute('resourceInternalId') !== $function->getInternalId()) { + if ($execution->getAttribute('resourceType') !== 'functions' && $execution->getAttribute('resourceInternalId') !== $function->getSequence()) { throw new Exception(Exception::EXECUTION_NOT_FOUND); } $status = $execution->getAttribute('status'); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php index 892ce30f47..42d78f8ca8 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/Get.php @@ -52,7 +52,7 @@ class Get extends Base ->param('executionId', '', new UID(), 'Execution ID.') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -72,7 +72,7 @@ class Get extends Base $execution = $dbForProject->getDocument('executions', $executionId); - if ($execution->getAttribute('resourceType') !== 'functions' || $execution->getAttribute('resourceInternalId') !== $function->getInternalId()) { + if ($execution->getAttribute('resourceType') !== 'functions' || $execution->getAttribute('resourceInternalId') !== $function->getSequence()) { throw new Exception(Exception::EXECUTION_NOT_FOUND); } diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php index a31e95b1c8..46a41e6517 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Executions/XList.php @@ -58,7 +58,7 @@ class XList extends Base ->param('queries', [], new Executions(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Executions::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -83,7 +83,7 @@ class XList extends Base } // Set internal queries - $queries[] = Query::equal('resourceInternalId', [$function->getInternalId()]); + $queries[] = Query::equal('resourceInternalId', [$function->getSequence()]); $queries[] = Query::equal('resourceType', ['functions']); /** diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php index fd8da657eb..21a74f9a81 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php @@ -114,7 +114,7 @@ class Create extends Base ->inject('dbForPlatform') ->inject('request') ->inject('gitHub') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -222,7 +222,7 @@ class Create extends Base 'search' => implode(' ', [$functionId, $name, $runtime]), 'version' => 'v5', 'installationId' => $installation->getId(), - 'installationInternalId' => $installation->getInternalId(), + 'installationInternalId' => $installation->getSequence(), 'providerRepositoryId' => $providerRepositoryId, 'repositoryId' => '', 'repositoryInternalId' => '', @@ -237,7 +237,7 @@ class Create extends Base 'region' => $project->getAttribute('region'), 'resourceType' => 'function', 'resourceId' => $function->getId(), - 'resourceInternalId' => $function->getInternalId(), + 'resourceInternalId' => $function->getSequence(), 'resourceUpdatedAt' => DateTime::now(), 'projectId' => $project->getId(), 'schedule' => $function->getAttribute('schedule'), @@ -246,7 +246,7 @@ class Create extends Base ); $function->setAttribute('scheduleId', $schedule->getId()); - $function->setAttribute('scheduleInternalId', $schedule->getInternalId()); + $function->setAttribute('scheduleInternalId', $schedule->getSequence()); // Git connect logic if (!empty($providerRepositoryId)) { @@ -262,18 +262,18 @@ class Create extends Base Permission::delete(Role::team(ID::custom($teamId), 'developer')), ], 'installationId' => $installation->getId(), - 'installationInternalId' => $installation->getInternalId(), + 'installationInternalId' => $installation->getSequence(), 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'providerRepositoryId' => $providerRepositoryId, 'resourceId' => $function->getId(), - 'resourceInternalId' => $function->getInternalId(), + 'resourceInternalId' => $function->getSequence(), 'resourceType' => 'function', 'providerPullRequestIds' => [] ])); $function->setAttribute('repositoryId', $repository->getId()); - $function->setAttribute('repositoryInternalId', $repository->getInternalId()); + $function->setAttribute('repositoryInternalId', $repository->getSequence()); } $function = $dbForProject->updateDocument('functions', $function->getId(), $function); @@ -316,7 +316,7 @@ class Create extends Base $function = $function ->setAttribute('latestDeploymentId', $deployment->getId()) - ->setAttribute('latestDeploymentInternalId', $deployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $deployment->getSequence()) ->setAttribute('latestDeploymentCreatedAt', $deployment->getCreatedAt()) ->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); $dbForProject->updateDocument('functions', $function->getId(), $function); @@ -331,7 +331,7 @@ class Create extends Base Permission::delete(Role::any()), ], 'resourceId' => $function->getId(), - 'resourceInternalId' => $function->getInternalId(), + 'resourceInternalId' => $function->getSequence(), 'resourceType' => 'functions', 'entrypoint' => $function->getAttribute('entrypoint', ''), 'buildCommands' => $function->getAttribute('commands', ''), @@ -341,7 +341,7 @@ class Create extends Base $function = $function ->setAttribute('latestDeploymentId', $deployment->getId()) - ->setAttribute('latestDeploymentInternalId', $deployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $deployment->getSequence()) ->setAttribute('latestDeploymentCreatedAt', $deployment->getCreatedAt()) ->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); $dbForProject->updateDocument('functions', $function->getId(), $function); @@ -364,16 +364,16 @@ class Create extends Base fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'domain' => $domain, 'status' => 'verified', 'type' => 'deployment', 'trigger' => 'manual', 'deploymentId' => !isset($deployment) || $deployment->isEmpty() ? '' : $deployment->getId(), - 'deploymentInternalId' => !isset($deployment) || $deployment->isEmpty() ? '' : $deployment->getInternalId(), + 'deploymentInternalId' => !isset($deployment) || $deployment->isEmpty() ? '' : $deployment->getSequence(), 'deploymentResourceType' => 'function', 'deploymentResourceId' => $function->getId(), - 'deploymentResourceInternalId' => $function->getInternalId(), + 'deploymentResourceInternalId' => $function->getSequence(), 'deploymentVcsProviderBranch' => '', 'certificateId' => '', 'search' => implode(' ', [$ruleId, $domain]), diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php index 91da68538c..72d5589252 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Delete.php @@ -61,7 +61,7 @@ class Delete extends Base ->inject('queueForDeletes') ->inject('queueForEvents') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php index 6de71cfae6..8846329d27 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Deployment/Update.php @@ -5,7 +5,6 @@ namespace Appwrite\Platform\Modules\Functions\Http\Functions\Deployment; use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Compute\Base; -use Appwrite\Query; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; @@ -13,6 +12,7 @@ use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Database\Document; +use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; @@ -62,7 +62,7 @@ class Update extends Base ->inject('dbForProject') ->inject('queueForEvents') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -89,10 +89,8 @@ class Update extends Base throw new Exception(Exception::BUILD_NOT_READY); } - $oldDeploymentInternalId = $function->getAttribute('deploymentInternalId', ''); - $function = $dbForProject->updateDocument('functions', $function->getId(), new Document(array_merge($function->getArrayCopy(), [ - 'deploymentInternalId' => $deployment->getInternalId(), + 'deploymentInternalId' => $deployment->getSequence(), 'deploymentId' => $deployment->getId(), 'deploymentCreatedAt' => $deployment->getCreatedAt(), ]))); @@ -106,24 +104,21 @@ class Update extends Base Authorization::skip(fn () => $dbForPlatform->updateDocument('schedules', $schedule->getId(), $schedule)); $queries = [ - Query::equal('trigger', 'manual'), - Query::equal("type", ["deployment"]), - Query::equal("deploymentResourceType", ["function"]), - Query::equal("deploymentResourceInternalId", [$function->getInternalId()]), + Query::equal('trigger', ['manual']), + Query::equal('type', ['deployment']), + Query::equal('deploymentResourceType', ['function']), + Query::equal('deploymentResourceInternalId', [$function->getSequence()]), + Query::equal('deploymentVcsProviderBranch', ['']), + Query::equal('projectInternalId', [$project->getSequence()]) ]; - if (empty($oldDeploymentInternalId)) { - $queries[] = Query::equal("deploymentInternalId", [""]); - } else { - $queries[] = Query::equal("deploymentInternalId", [$oldDeploymentInternalId]); - } - - $this->listRules($project, $queries, $dbForPlatform, function (Document $rule) use ($dbForPlatform, $deployment) { + Authorization::skip(fn () => $dbForPlatform->foreach('rules', function (Document $rule) use ($dbForPlatform, $deployment) { $rule = $rule ->setAttribute('deploymentId', $deployment->getId()) - ->setAttribute('deploymentInternalId', $deployment->getInternalId()); - $dbForPlatform->updateDocument('rules', $rule->getId(), $rule); - }); + ->setAttribute('deploymentInternalId', $deployment->getSequence()); + + Authorization::skip(fn () => $dbForPlatform->updateDocument('rules', $rule->getId(), $rule)); + }, $queries)); $queueForEvents ->setParam('functionId', $function->getId()) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Get.php index 9ce6560fd0..e8da162b8a 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Get.php @@ -49,7 +49,7 @@ class Get extends Base ->param('functionId', '', new UID(), 'Function ID.') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php index a19ec1e278..aaff953af0 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/Update.php @@ -104,7 +104,7 @@ class Update extends Base ->inject('dbForPlatform') ->inject('gitHub') ->inject('executor') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -175,8 +175,8 @@ class Update extends Base // Git disconnect logic. Disconnecting only when providerRepositoryId is empty, allowing for continue updates without disconnecting git if ($isConnected && ($providerRepositoryId !== null && empty($providerRepositoryId))) { $repositories = $dbForPlatform->find('repositories', [ - Query::equal('projectInternalId', [$project->getInternalId()]), - Query::equal('resourceInternalId', [$function->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), + Query::equal('resourceInternalId', [$function->getSequence()]), Query::equal('resourceType', ['function']), Query::limit(100), ]); @@ -208,18 +208,18 @@ class Update extends Base Permission::delete(Role::team(ID::custom($teamId), 'developer')), ], 'installationId' => $installation->getId(), - 'installationInternalId' => $installation->getInternalId(), + 'installationInternalId' => $installation->getSequence(), 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'providerRepositoryId' => $providerRepositoryId, 'resourceId' => $function->getId(), - 'resourceInternalId' => $function->getInternalId(), + 'resourceInternalId' => $function->getSequence(), 'resourceType' => 'function', 'providerPullRequestIds' => [] ])); $repositoryId = $repository->getId(); - $repositoryInternalId = $repository->getInternalId(); + $repositoryInternalId = $repository->getSequence(); } $live = true; @@ -260,7 +260,7 @@ class Update extends Base 'commands' => $commands, 'scopes' => $scopes, 'installationId' => $installation->getId(), - 'installationInternalId' => $installation->getInternalId(), + 'installationInternalId' => $installation->getSequence(), 'providerRepositoryId' => $providerRepositoryId, 'repositoryId' => $repositoryId, 'repositoryInternalId' => $repositoryInternalId, diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Functions/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Functions/XList.php index cd0eba2c50..4b03a5b6cc 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Functions/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Functions/XList.php @@ -56,7 +56,7 @@ class XList extends Base ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Runtimes/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Runtimes/XList.php index bfccff0479..0690d1a139 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Runtimes/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Runtimes/XList.php @@ -47,7 +47,7 @@ class XList extends Base ] )) ->inject('response') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(Response $response) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Specifications/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Specifications/XList.php index 39186e7ab7..d76584534d 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Specifications/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Specifications/XList.php @@ -48,7 +48,7 @@ class XList extends Base )) ->inject('response') ->inject('plan') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(Response $response, array $plan) @@ -63,8 +63,8 @@ class XList extends Base $spec['enabled'] = in_array($spec['slug'], $plan['runtimeSpecifications']); } - $maxCpus = System::getEnv('_APP_FUNCTIONS_CPUS', 0); - $maxMemory = System::getEnv('_APP_FUNCTIONS_MEMORY', 0); + $maxCpus = System::getEnv('_APP_COMPUTE_CPUS', 0); + $maxMemory = System::getEnv('_APP_COMPUTE_MEMORY', 0); // Only add specs that are within the limits set by environment variables // Treat 0 as no limit diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Templates/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Templates/Get.php index 237898f6fa..f66322839b 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Templates/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Templates/Get.php @@ -49,7 +49,7 @@ class Get extends Base )) ->param('templateId', '', new Text(128), 'Template ID.') ->inject('response') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $templateId, Response $response) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Templates/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Templates/XList.php index 05b54a75d0..86e7f21362 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Templates/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Templates/XList.php @@ -53,7 +53,7 @@ class XList extends Base ->param('limit', 25, new Range(1, 5000), 'Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.', true) ->param('offset', 0, new Range(0, 5000), 'Offset the list of returned templates. Maximum offset is 5000.', true) ->inject('response') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(array $runtimes, array $usecases, int $limit, int $offset, Response $response) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Usage/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Usage/Get.php index e0d659c9ba..acb6995d6f 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Usage/Get.php @@ -55,7 +55,7 @@ class Get extends Base ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $functionId, string $range, Response $response, Database $dbForProject) @@ -70,17 +70,17 @@ class Get extends Base $stats = $usage = []; $days = $periods[$range]; $metrics = [ - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS_STORAGE), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_COMPUTE), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_MB_SECONDS), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_SUCCESS), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_FAILED), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS_STORAGE), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_COMPUTE), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_MB_SECONDS), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_SUCCESS), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_FAILED), ]; Authorization::skip(function () use ($dbForProject, $days, $metrics, &$stats) { diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Usage/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Usage/XList.php index e64fe9a600..6a4ded4db7 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Usage/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Usage/XList.php @@ -52,7 +52,7 @@ class XList extends Base ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $range, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php index 9300524c64..815d364dad 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Create.php @@ -65,7 +65,7 @@ class Create extends Base ->inject('dbForProject') ->inject('dbForPlatform') ->inject('project') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -96,7 +96,7 @@ class Create extends Base Permission::delete(Role::team(ID::custom($teamId), 'owner')), Permission::delete(Role::team(ID::custom($teamId), 'developer')), ], - 'resourceInternalId' => $function->getInternalId(), + 'resourceInternalId' => $function->getSequence(), 'resourceId' => $function->getId(), 'resourceType' => 'function', 'key' => $key, diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php index 3d6bfebcb9..35f9618edb 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Delete.php @@ -57,7 +57,7 @@ class Delete extends Base ->inject('response') ->inject('dbForProject') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -74,7 +74,7 @@ class Delete extends Base } $variable = $dbForProject->getDocument('variables', $variableId); - if ($variable === false || $variable->isEmpty() || $variable->getAttribute('resourceInternalId') !== $function->getInternalId() || $variable->getAttribute('resourceType') !== 'function') { + if ($variable === false || $variable->isEmpty() || $variable->getAttribute('resourceInternalId') !== $function->getSequence() || $variable->getAttribute('resourceType') !== 'function') { throw new Exception(Exception::VARIABLE_NOT_FOUND); } diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Get.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Get.php index 70cc66219a..3955b854e9 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Get.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Get.php @@ -53,7 +53,7 @@ class Get extends Base ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $functionId, string $variableId, Response $response, Database $dbForProject) @@ -68,7 +68,7 @@ class Get extends Base if ( $variable === false || $variable->isEmpty() || - $variable->getAttribute('resourceInternalId') !== $function->getInternalId() || + $variable->getAttribute('resourceInternalId') !== $function->getSequence() || $variable->getAttribute('resourceType') !== 'function' ) { throw new Exception(Exception::VARIABLE_NOT_FOUND); diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php index 4102022267..639b1c74d5 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/Update.php @@ -61,7 +61,7 @@ class Update extends Base ->inject('response') ->inject('dbForProject') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -81,7 +81,7 @@ class Update extends Base } $variable = $dbForProject->getDocument('variables', $variableId); - if ($variable === false || $variable->isEmpty() || $variable->getAttribute('resourceInternalId') !== $function->getInternalId() || $variable->getAttribute('resourceType') !== 'function') { + if ($variable === false || $variable->isEmpty() || $variable->getAttribute('resourceInternalId') !== $function->getSequence() || $variable->getAttribute('resourceType') !== 'function') { throw new Exception(Exception::VARIABLE_NOT_FOUND); } diff --git a/src/Appwrite/Platform/Modules/Functions/Http/Variables/XList.php b/src/Appwrite/Platform/Modules/Functions/Http/Variables/XList.php index 9c02cfe07c..29465b7572 100644 --- a/src/Appwrite/Platform/Modules/Functions/Http/Variables/XList.php +++ b/src/Appwrite/Platform/Modules/Functions/Http/Variables/XList.php @@ -53,7 +53,7 @@ class XList extends Base ->param('functionId', '', new UID(), 'Function unique ID.', false) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $functionId, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php index 0ecf1d3f73..890c8572d9 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Builds.php @@ -75,7 +75,7 @@ class Builds extends Action ->inject('log') ->inject('executor') ->inject('plan') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** @@ -209,6 +209,9 @@ class Builds extends Action Executor $executor, array $plan ): void { + $startTime = DateTime::now(); + $durationStart = \microtime(true); + $resourceKey = match ($resource->getCollection()) { 'functions' => 'functionId', 'sites' => 'siteId', @@ -260,11 +263,8 @@ class Builds extends Action ->setParam($resourceKey, $resource->getId()) ->setParam('deploymentId', $deployment->getId()); - $startTime = DateTime::now(); - $durationStart = \microtime(true); - if ($deployment->getAttribute('status') === 'canceled') { - Console::info('Build has been canceled'); + $this->cancelDeployment($deployment->getId(), $dbForProject, $queueForRealtime); return; } @@ -274,9 +274,8 @@ class Builds extends Action $deployment->setAttribute('status', 'processing'); $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); - if ($deployment->getInternalId() === $resource->getAttribute('latestDeploymentInternalId', '')) { - $resource = $resource->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); - $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), $resource); + if ($deployment->getSequence() === $resource->getAttribute('latestDeploymentInternalId', '')) { + $resource = $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), new Document(['latestDeploymentStatus' => $deployment->getAttribute('status', '')])); } $queueForRealtime @@ -392,7 +391,7 @@ class Builds extends Action Console::execute('mkdir -p ' . \escapeshellarg('/tmp/builds/' . $deploymentId), '', $stdout, $stderr); if ($dbForProject->getDocument('deployments', $deploymentId)->getAttribute('status') === 'canceled') { - Console::info('Build has been canceled'); + $this->cancelDeployment($deployment->getId(), $dbForProject, $queueForRealtime); return; } @@ -445,7 +444,7 @@ class Builds extends Action Console::execute('rsync -av --exclude \'.git\' ' . \escapeshellarg($tmpTemplateDirectory . '/' . $templateRootDirectory . '/') . ' ' . \escapeshellarg($tmpDirectory . '/' . $rootDirectory), '', $stdout, $stderr); // Commit and push - $exit = Console::execute('git config --global user.email "team@appwrite.io" && git config --global user.name "Appwrite" && cd ' . \escapeshellarg($tmpDirectory) . ' && git add . && git commit -m "Create ' . \escapeshellarg($resource->getAttribute('name', '')) . ' function" && git push origin ' . \escapeshellarg($branchName), '', $stdout, $stderr); + $exit = Console::execute('git config --global user.email "team@appwrite.io" && git config --global user.name "Appwrite" && cd ' . \escapeshellarg($tmpDirectory) . ' && git checkout -b ' . \escapeshellarg($branchName) . ' && git add . && git commit -m "Create ' . \escapeshellarg($resource->getAttribute('name', '')) . ' function" && git push origin ' . \escapeshellarg($branchName), '', $stdout, $stderr); if ($exit !== 0) { throw new \Exception('Unable to push code repository: ' . $stderr); @@ -524,9 +523,8 @@ class Builds extends Action $deployment->setAttribute('status', 'building'); $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); - if ($deployment->getInternalId() === $resource->getAttribute('latestDeploymentInternalId', '')) { - $resource = $resource->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); - $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), $resource); + if ($deployment->getSequence() === $resource->getAttribute('latestDeploymentInternalId', '')) { + $resource = $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), new Document(['latestDeploymentStatus' => $deployment->getAttribute('status', '')])); } $queueForRealtime @@ -658,7 +656,7 @@ class Builds extends Action $err = null; if ($dbForProject->getDocument('deployments', $deploymentId)->getAttribute('status') === 'canceled') { - Console::info('Build has been canceled'); + $this->cancelDeployment($deployment->getId(), $dbForProject, $queueForRealtime); return; } @@ -747,6 +745,13 @@ class Builds extends Action if ($separator !== false) { $logs = \substr($logs, 0, $separator); $insideSeparation = true; + + $leftover = \substr($logs, $separator + strlen('{APPWRITE_DETECTION_SEPARATOR_START}')); + $separator = \strpos($leftover, '{APPWRITE_DETECTION_SEPARATOR_END}'); + if ($separator !== false) { + $logs .= \substr($leftover, $separator + strlen('{APPWRITE_DETECTION_SEPARATOR_END}')); + $insideSeparation = false; + } } } else { $separator = \strpos($logs, '{APPWRITE_DETECTION_SEPARATOR_END}'); @@ -802,7 +807,7 @@ class Builds extends Action ]); if ($dbForProject->getDocument('deployments', $deploymentId)->getAttribute('status') === 'canceled') { - Console::info('Build has been canceled'); + $this->cancelDeployment($deployment->getId(), $dbForProject, $queueForRealtime); return; } @@ -810,9 +815,6 @@ class Builds extends Action throw $err; } - $endTime = DateTime::now(); - $durationEnd = \microtime(true); - $buildSizeLimit = (int)System::getEnv('_APP_COMPUTE_BUILD_SIZE_LIMIT', '2000000000'); if (isset($plan['buildSize'])) { $buildSizeLimit = $plan['buildSize'] * 1000 * 1000; @@ -821,10 +823,6 @@ class Builds extends Action throw new \Exception('Build size should be less than ' . number_format($buildSizeLimit / (1000 * 1000), 2) . ' MBs.'); } - /** Update the build document */ - $deployment->setAttribute('buildStartedAt', DateTime::format((new \DateTime())->setTimestamp(floor($response['startTime'])))); - $deployment->setAttribute('buildEndedAt', $endTime); - $deployment->setAttribute('buildDuration', \intval(\ceil($durationEnd - $durationStart))); $deployment->setAttribute('buildPath', $response['path']); $deployment->setAttribute('buildSize', $response['size']); $deployment->setAttribute('totalSize', $deployment->getAttribute('buildSize', 0) + $deployment->getAttribute('sourceSize', 0)); @@ -836,18 +834,10 @@ class Builds extends Action // Separate logs for SSR detection $detectionLogs = ''; - $separator = \strpos($logs, '{APPWRITE_DETECTION_SEPARATOR_START}'); - if ($separator !== false) { - $detectionLogs = \substr($logs, $separator + strlen('{APPWRITE_DETECTION_SEPARATOR}')); - $separatorEnd = \strpos($detectionLogs, '{APPWRITE_DETECTION_SEPARATOR_END}'); - $logs .= \substr($detectionLogs, $separatorEnd + strlen('{APPWRITE_DETECTION_SEPARATOR_END}')); - $detectionLogs = \substr($detectionLogs, 0, $separatorEnd); - $logs = \substr($logs, 0, $separator); - } - - if ($resource->getCollection() === 'sites') { - $date = \date('H:i:s'); - $logs .= "[$date] [appwrite] Screenshot capturing started. \n"; + if (\str_contains($logs, '{APPWRITE_DETECTION_SEPARATOR_START}')) { + [$logsBefore, $detectionLogsStart] = \explode('{APPWRITE_DETECTION_SEPARATOR_START}', $logs, 2); + [$detectionLogs, $logsAfter] = \explode('{APPWRITE_DETECTION_SEPARATOR_END}', $detectionLogsStart, 2); + $logs = ($logsBefore ?? '') . ($logsAfter ?? ''); } $deployment->setAttribute('buildLogs', $logs); @@ -866,9 +856,7 @@ class Builds extends Action $adapter = $resource->getAttribute('adapter', ''); if (empty($adapter)) { - $resource->setAttribute('adapter', $detection->getName()); - $resource->setAttribute('fallbackFile', $detection->getFallbackFile() ?? ''); - $resource = $dbForProject->updateDocument('sites', $resource->getId(), $resource); + $resource = $dbForProject->updateDocument('sites', $resource->getId(), new Document(['adapter' => $detection->getName(), 'fallbackFile' => $detection->getFallbackFile() ?? ''])); $deployment->setAttribute('adapter', $detection->getName()); $deployment->setAttribute('fallbackFile', $detection->getFallbackFile() ?? ''); @@ -878,18 +866,30 @@ class Builds extends Action } $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); - $queueForRealtime ->setPayload($deployment->getArrayCopy()) ->trigger(); + $this->afterBuildSuccess($queueForRealtime, $dbForProject, $deployment); + $logs = $deployment->getAttribute('buildLogs', ''); + + if ($resource->getCollection() === 'sites') { + $date = \date('H:i:s'); + $logs .= "[$date] [appwrite] Screenshot capturing started. \n"; + $deployment->setAttribute('buildLogs', $logs); + $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); + $queueForRealtime + ->setPayload($deployment->getArrayCopy()) + ->trigger(); + } + /** Screenshot site */ if ($resource->getCollection() === 'sites') { try { $rule = Authorization::skip(fn () => $dbForPlatform->findOne('rules', [ - Query::equal("projectInternalId", [$project->getInternalId()]), + Query::equal("projectInternalId", [$project->getSequence()]), Query::equal("type", ["deployment"]), - Query::equal('deploymentInternalId', [$deployment->getInternalId()]), + Query::equal('deploymentInternalId', [$deployment->getSequence()]), ])); if ($rule->isEmpty()) { @@ -928,9 +928,9 @@ class Builds extends Action str_replace(["{resourceType}"], [RESOURCE_TYPE_SITES], METRIC_RESOURCE_TYPE_EXECUTIONS), str_replace(["{resourceType}"], [RESOURCE_TYPE_SITES], METRIC_RESOURCE_TYPE_EXECUTIONS_COMPUTE), str_replace(["{resourceType}"], [RESOURCE_TYPE_SITES], METRIC_RESOURCE_TYPE_EXECUTIONS_MB_SECONDS), - str_replace(["{resourceType}", "{resourceInternalId}"], [RESOURCE_TYPE_SITES, $resource->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS), - str_replace(["{resourceType}", "{resourceInternalId}"], [RESOURCE_TYPE_SITES, $resource->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE), - str_replace(["{resourceType}", "{resourceInternalId}"], [RESOURCE_TYPE_SITES, $resource->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS), + str_replace(["{resourceType}", "{resourceInternalId}"], [RESOURCE_TYPE_SITES, $resource->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS), + str_replace(["{resourceType}", "{resourceInternalId}"], [RESOURCE_TYPE_SITES, $resource->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE), + str_replace(["{resourceType}", "{resourceInternalId}"], [RESOURCE_TYPE_SITES, $resource->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS), ], 'bannerDisabled' => true, 'projectCheckDisabled' => true, @@ -955,8 +955,9 @@ class Builds extends Action $config['sleep'] = $framework['screenshotSleep']; } + $browserEndpoint = Config::getParam('_APP_BROWSER_HOST', 'http://appwrite-browser:3000/v1'); $fetchResponse = $client->fetch( - url: 'http://appwrite-browser:3000/v1/screenshots', + url: $browserEndpoint . '/screenshots', method: 'POST', body: $config ); @@ -1000,7 +1001,7 @@ class Builds extends Action Permission::read(Role::team(ID::custom($teamId))), ], 'bucketId' => $bucket->getId(), - 'bucketInternalId' => $bucket->getInternalId(), + 'bucketInternalId' => $bucket->getSequence(), 'name' => $fileName, 'path' => $path, 'signature' => $deviceForFiles->getFileHash($path), @@ -1019,7 +1020,7 @@ class Builds extends Action 'metadata' => ['content_type' => $deviceForFiles->getFileMimeType($path)], ]); - Authorization::skip(fn () => $dbForPlatform->createDocument('bucket_' . $bucket->getInternalId(), $file)); + Authorization::skip(fn () => $dbForPlatform->createDocument('bucket_' . $bucket->getSequence(), $file)); $deployment->setAttribute($key, $fileId); } @@ -1028,6 +1029,7 @@ class Builds extends Action $date = \date('H:i:s'); $logs .= "[$date] [appwrite] Screenshot capturing finished. \n"; + $deployment->setAttribute('buildLogs', $logs); $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); $queueForRealtime @@ -1042,6 +1044,7 @@ class Builds extends Action $date = \date('H:i:s'); $logs .= "[$date] [appwrite] Screenshot capturing failed. Deployment will continue. \n"; + $deployment->setAttribute('buildLogs', $logs); $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); } } @@ -1055,9 +1058,8 @@ class Builds extends Action $deployment->setAttribute('status', 'ready'); $deployment = $dbForProject->updateDocument('deployments', $deploymentId, $deployment); - if ($deployment->getInternalId() === $resource->getAttribute('latestDeploymentInternalId', '')) { - $resource = $resource->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); - $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), $resource); + if ($deployment->getSequence() === $resource->getAttribute('latestDeploymentInternalId', '')) { + $resource = $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), new Document(['latestDeploymentStatus' => $deployment->getAttribute('status', '')])); } $queueForRealtime @@ -1071,69 +1073,81 @@ class Builds extends Action Console::success("Build id: $deploymentId created"); /** Set auto deploy */ + $activateBuild = false; if ($deployment->getAttribute('activate') === true) { - $resource->setAttribute('live', true); + // Check if current active deployment started later than this deployment + $resource = $dbForProject->getDocument($resource->getCollection(), $resource->getId()); + $currentActiveDeploymentId = $resource->getAttribute('deploymentId', ''); + if (!empty($currentActiveDeploymentId)) { + $currentActiveDeployment = $dbForProject->getDocument('deployments', $currentActiveDeploymentId); + if (!$currentActiveDeployment->isEmpty()) { + $currentActiveStartTime = $currentActiveDeployment->getCreatedAt(); + $deploymentStartTime = $deployment->getCreatedAt(); + + // Skip auto-activation if current active deployment started later than deployment that is being activated + if ($currentActiveStartTime < $deploymentStartTime) { + $activateBuild = true; + } else { + Console::info('Skipping auto-activation as current deployment is more recent'); + } + } + } else { + $activateBuild = true; + } + } + + if ($activateBuild) { switch ($resource->getCollection()) { case 'functions': - $oldDeploymentInternalId = $resource->getAttribute('deploymentInternalId', ''); - - $resource->setAttribute('deploymentId', $deployment->getId()); - $resource->setAttribute('deploymentInternalId', $deployment->getInternalId()); - $resource->setAttribute('deploymentCreatedAt', $deployment->getCreatedAt()); - $resource = $dbForProject->updateDocument('functions', $resource->getId(), $resource); + $resource = $dbForProject->updateDocument('functions', $resource->getId(), new Document([ + 'live' => true, + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + 'deploymentCreatedAt' => $deployment->getCreatedAt(), + ])); $queries = [ - Query::equal("projectInternalId", [$project->getInternalId()]), - Query::equal("type", ["deployment"]), - Query::equal("deploymentResourceInternalId", [$resource->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), + Query::equal('type', ['deployment']), + Query::equal('deploymentResourceInternalId', [$resource->getSequence()]), Query::equal('deploymentResourceType', ['function']), Query::equal('trigger', ['manual']), + Query::equal('deploymentVcsProviderBranch', ['']), ]; - if (empty($oldDeploymentInternalId)) { - $queries[] = Query::equal("deploymentInternalId", [""]); - } else { - $queries[] = Query::equal("deploymentInternalId", [$oldDeploymentInternalId]); - } - $rulesUpdated = false; - $this->listRules($project, $queries, $dbForPlatform, function (Document $rule) use ($dbForPlatform, $deployment, &$rulesUpdated) { + $dbForPlatform->forEach('rules', function (Document $rule) use ($dbForPlatform, $deployment, &$rulesUpdated) { $rulesUpdated = true; - $rule = $rule - ->setAttribute('deploymentId', $deployment->getId()) - ->setAttribute('deploymentInternalId', $deployment->getInternalId()); - $dbForPlatform->updateDocument('rules', $rule->getId(), $rule); - }); + $rule = $dbForPlatform->updateDocument('rules', $rule->getId(), new Document([ + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + ])); + }, $queries); break; case 'sites': - $oldDeploymentInternalId = $resource->getAttribute('deploymentInternalId', ''); - - $resource->setAttribute('deploymentId', $deployment->getId()); - $resource->setAttribute('deploymentInternalId', $deployment->getInternalId()); - $resource->setAttribute('deploymentScreenshotDark', $deployment->getAttribute('screenshotDark', '')); - $resource->setAttribute('deploymentScreenshotLight', $deployment->getAttribute('screenshotLight', '')); - $resource->setAttribute('deploymentCreatedAt', $deployment->getCreatedAt()); - $resource = $dbForProject->updateDocument('sites', $resource->getId(), $resource); + $resource = $dbForProject->updateDocument('sites', $resource->getId(), new Document([ + 'live' => true, + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + 'deploymentScreenshotDark' => $deployment->getAttribute('screenshotDark', ''), + 'deploymentScreenshotLight' => $deployment->getAttribute('screenshotLight', ''), + 'deploymentCreatedAt' => $deployment->getCreatedAt(), + ])); $queries = [ - Query::equal("projectInternalId", [$project->getInternalId()]), - Query::equal("type", ["deployment"]), - Query::equal("deploymentResourceInternalId", [$resource->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), + Query::equal('type', ['deployment']), + Query::equal('deploymentResourceInternalId', [$resource->getSequence()]), Query::equal('deploymentResourceType', ['site']), Query::equal('trigger', ['manual']), + Query::equal('deploymentVcsProviderBranch', ['']), ]; - if (empty($oldDeploymentInternalId)) { - $queries[] = Query::equal("deploymentInternalId", [""]); - } else { - $queries[] = Query::equal("deploymentInternalId", [$oldDeploymentInternalId]); - } - - $this->listRules($project, $queries, $dbForPlatform, function (Document $rule) use ($dbForPlatform, $deployment) { - $rule = $rule - ->setAttribute('deploymentId', $deployment->getId()) - ->setAttribute('deploymentInternalId', $deployment->getInternalId()); - $dbForPlatform->updateDocument('rules', $rule->getId(), $rule); - }); + $dbForPlatform->forEach('rules', function (Document $rule) use ($dbForPlatform, $deployment) { + $rule = $dbForPlatform->updateDocument('rules', $rule->getId(), new Document([ + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + ])); + }, $queries); break; } @@ -1144,22 +1158,28 @@ class Builds extends Action $branchName = $deployment->getAttribute('providerBranch'); if (!empty($branchName)) { $sitesDomain = System::getEnv('_APP_DOMAIN_SITES', ''); - $domain = "branch-{$branchName}-{$resource->getId()}-{$project->getId()}.{$sitesDomain}"; + $branchPrefix = substr($branchName, 0, 16); + if (strlen($branchName) > 16) { + $remainingChars = substr($branchName, 16); + $branchPrefix .= '-' . substr(hash('sha256', $remainingChars), 0, 7); + } + $resourceProjectHash = substr(hash('sha256', $resource->getId() . $project->getId()), 0, 7); + $domain = "branch-{$branchPrefix}-{$resourceProjectHash}.{$sitesDomain}"; $ruleId = md5($domain); try { $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'domain' => $domain, 'type' => 'deployment', 'trigger' => 'deployment', 'deploymentId' => $deployment->getId(), - 'deploymentInternalId' => $deployment->getInternalId(), + 'deploymentInternalId' => $deployment->getSequence(), 'deploymentResourceType' => 'site', 'deploymentResourceId' => $deployment->getId(), - 'deploymentResourceInternalId' => $deployment->getInternalId(), + 'deploymentResourceInternalId' => $deployment->getSequence(), 'deploymentVcsProviderBranch' => $branchName, 'status' => 'verified', 'certificateId' => '', @@ -1168,31 +1188,41 @@ class Builds extends Action 'region' => $project->getAttribute('region') ])); } catch (Duplicate $err) { - $rule = $dbForPlatform->getDocument('rules', $ruleId); - $rule = $rule - ->setAttribute('deploymentId', $deployment->getId()) - ->setAttribute('deploymentInternalId', $deployment->getInternalId()); - $dbForPlatform->updateDocument('rules', $rule->getId(), $rule); + $rule = $dbForPlatform->updateDocument('rules', $ruleId, new Document([ + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + ])); } - $this->listRules($project, [ - Query::equal("projectInternalId", [$project->getInternalId()]), - Query::equal("type", ["deployment"]), - Query::equal("deploymentResourceInternalId", [$resource->getInternalId()]), + $queries = [ + Query::equal('projectInternalId', [$project->getSequence()]), + Query::equal('type', ['deployment']), + Query::equal('deploymentResourceInternalId', [$resource->getSequence()]), Query::equal('deploymentResourceType', ['site']), - Query::equal("deploymentVcsProviderBranch", [$branchName]), - Query::equal("trigger", ['manual']), - ], $dbForPlatform, function (Document $rule) use ($dbForPlatform, $deployment) { - $rule = $rule - ->setAttribute('deploymentId', $deployment->getId()) - ->setAttribute('deploymentInternalId', $deployment->getInternalId()); - $dbForPlatform->updateDocument('rules', $rule->getId(), $rule); - }); + Query::equal('deploymentVcsProviderBranch', [$branchName]), + Query::equal('trigger', ['manual']), + ]; + + $dbForPlatform->foreach('rules', function (Document $rule) use ($dbForPlatform, $deployment) { + $rule = $dbForPlatform->updateDocument('rules', $rule->getId(), new Document([ + 'deploymentId' => $deployment->getId(), + 'deploymentInternalId' => $deployment->getSequence(), + ])); + }, $queries); } } + $endTime = DateTime::now(); + $durationEnd = \microtime(true); + $deployment->setAttribute('buildEndedAt', $endTime); + $deployment->setAttribute('buildDuration', \intval(\ceil($durationEnd - $durationStart))); + $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); + $queueForRealtime + ->setPayload($deployment->getArrayCopy()) + ->trigger(); + if ($dbForProject->getDocument('deployments', $deploymentId)->getAttribute('status') === 'canceled') { - Console::info('Build has been canceled'); + $this->cancelDeployment($deployment->getId(), $dbForProject, $queueForRealtime); return; } @@ -1215,7 +1245,7 @@ class Builds extends Action Console::error($th->getTraceAsString()); if ($dbForProject->getDocument('deployments', $deploymentId)->getAttribute('status') === 'canceled') { - Console::info('Build has been canceled'); + $this->cancelDeployment($deployment->getId(), $dbForProject, $queueForRealtime); return; } @@ -1225,16 +1255,12 @@ class Builds extends Action $message = "" . $message; } - $separator = \strpos($message, '{APPWRITE_DETECTION_SEPARATOR_START}'); - if ($separator !== false) { - $error = \substr($message, $separator + strlen('{APPWRITE_DETECTION_SEPARATOR_START}')); - $message = \substr($message, 0, $separator); - $message .= "\n" . $error; - } + $message = \str_replace('{APPWRITE_DETECTION_SEPARATOR_START}', '', $message); + $message = \str_replace('{APPWRITE_DETECTION_SEPARATOR_END}', '', $message); // Combine with previous logs if deployment got past build process $previousLogs = ''; - if (!empty($deployment->getAttribute('buildEndedAt', ''))) { + if (!is_null($deployment->getAttribute('buildSize', null))) { $previousLogs = $deployment->getAttribute('buildLogs', ''); if (!empty($previousLogs)) { $message = $previousLogs . "\n" . $message; @@ -1250,9 +1276,8 @@ class Builds extends Action $deployment->setAttribute('buildLogs', $message); $deployment = $dbForProject->updateDocument('deployments', $deploymentId, $deployment); - if ($deployment->getInternalId() === $resource->getAttribute('latestDeploymentInternalId', '')) { - $resource = $resource->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); - $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), $resource); + if ($deployment->getSequence() === $resource->getAttribute('latestDeploymentInternalId', '')) { + $resource = $dbForProject->updateDocument($resource->getCollection(), $resource->getId(), new Document(['latestDeploymentStatus' => $deployment->getAttribute('status', '')])); } $queueForRealtime @@ -1278,6 +1303,8 @@ class Builds extends Action protected function sendUsage(Document $resource, Document $deployment, Document $project, StatsUsage $queue): void { + $spec = Config::getParam('specifications')[$resource->getAttribute('specification', APP_COMPUTE_SPECIFICATION_DEFAULT)]; + switch ($deployment->getAttribute('status')) { case 'ready': $queue @@ -1285,8 +1312,8 @@ class Builds extends Action ->addMetric(METRIC_BUILDS_COMPUTE_SUCCESS, (int)$deployment->getAttribute('buildDuration', 0) * 1000) ->addMetric(str_replace(['{resourceType}'], [$deployment->getAttribute('resourceType')], METRIC_RESOURCE_TYPE_BUILDS_SUCCESS), 1) // per function ->addMetric(str_replace(['{resourceType}'], [$deployment->getAttribute('resourceType')], METRIC_RESOURCE_TYPE_BUILDS_COMPUTE_SUCCESS), (int)$deployment->getAttribute('buildDuration', 0) * 1000) - ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_SUCCESS), 1) // per function - ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_COMPUTE_SUCCESS), (int)$deployment->getAttribute('buildDuration', 0) * 1000); + ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_SUCCESS), 1) // per function + ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_COMPUTE_SUCCESS), (int)$deployment->getAttribute('buildDuration', 0) * 1000); break; case 'failed': $queue @@ -1294,8 +1321,8 @@ class Builds extends Action ->addMetric(METRIC_BUILDS_COMPUTE_FAILED, (int)$deployment->getAttribute('buildDuration', 0) * 1000) ->addMetric(str_replace(['{resourceType}'], [$deployment->getAttribute('resourceType')], METRIC_RESOURCE_TYPE_BUILDS_FAILED), 1) // per function ->addMetric(str_replace(['{resourceType}'], [$deployment->getAttribute('resourceType')], METRIC_RESOURCE_TYPE_BUILDS_COMPUTE_FAILED), (int)$deployment->getAttribute('buildDuration', 0) * 1000) - ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_FAILED), 1) // per function - ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_COMPUTE_FAILED), (int)$deployment->getAttribute('buildDuration', 0) * 1000); + ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_FAILED), 1) // per function + ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_COMPUTE_FAILED), (int)$deployment->getAttribute('buildDuration', 0) * 1000); break; } @@ -1308,14 +1335,29 @@ class Builds extends Action ->addMetric(str_replace(['{resourceType}'], [$deployment->getAttribute('resourceType')], METRIC_RESOURCE_TYPE_BUILDS_STORAGE), $deployment->getAttribute('buildSize', 0)) ->addMetric(str_replace(['{resourceType}'], [$deployment->getAttribute('resourceType')], METRIC_RESOURCE_TYPE_BUILDS_COMPUTE), (int)$deployment->getAttribute('buildDuration', 0) * 1000) ->addMetric(str_replace(['{resourceType}'], [$deployment->getAttribute('resourceType')], METRIC_RESOURCE_TYPE_BUILDS_MB_SECONDS), (int)(($spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT) * $deployment->getAttribute('buildDuration', 0) * ($spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT))) - ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS), 1) // per function - ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE), $deployment->getAttribute('buildSize', 0)) - ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_COMPUTE), (int)$deployment->getAttribute('buildDuration', 0) * 1000) - ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_MB_SECONDS), (int)(($spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT) * $deployment->getAttribute('buildDuration', 0) * ($spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT))) + ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS), 1) // per function + ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE), $deployment->getAttribute('buildSize', 0)) + ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_COMPUTE), (int)$deployment->getAttribute('buildDuration', 0) * 1000) + ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [$deployment->getAttribute('resourceType'), $resource->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_MB_SECONDS), (int)(($spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT) * $deployment->getAttribute('buildDuration', 0) * ($spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT))) ->setProject($project) ->trigger(); } + /** + * Hook to run after build success + * + * @param Realtime $queueForRealtime + * @param Database $dbForProject + * @param Document $deployment + * @return void + */ + protected function afterBuildSuccess(Realtime $queueForRealtime, Database $dbForProject, Document &$deployment): void + { + assert($queueForRealtime instanceof Realtime); + assert($dbForProject instanceof Database); + assert($deployment instanceof Document); + } + protected function getRuntime(Document $resource, string $version): array { $runtimes = Config::getParam($version === 'v2' ? 'runtimes-v2' : 'runtimes', []); @@ -1427,13 +1469,14 @@ class Builds extends Action $name = "{$resourceName} ({$projectName})"; $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; - $hostname = System::getEnv('_APP_DOMAIN'); + $hostname = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); $projectId = $project->getId(); + $region = $project->getAttribute('region', 'default'); $resourceId = $resource->getId(); $providerTargetUrl = match ($resource->getCollection()) { - 'functions' => "{$protocol}://{$hostname}/console/project-{$projectId}/functions/function-{$resourceId}", - 'sites' => "{$protocol}://{$hostname}/console/project-{$projectId}/sites/site-{$resourceId}", + 'functions' => "{$protocol}://{$hostname}/console/project-{$region}-{$projectId}/functions/function-{$resourceId}", + 'sites' => "{$protocol}://{$hostname}/console/project-{$region}-{$projectId}/sites/site-{$resourceId}", default => throw new \Exception('Invalid resource type') }; @@ -1469,9 +1512,9 @@ class Builds extends Action }; $rule = Authorization::skip(fn () => $dbForPlatform->findOne('rules', [ - Query::equal("projectInternalId", [$project->getInternalId()]), + Query::equal("projectInternalId", [$project->getSequence()]), Query::equal("type", ["deployment"]), - Query::equal("deploymentInternalId", [$deployment->getInternalId()]), + Query::equal("deploymentInternalId", [$deployment->getSequence()]), ])); $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; @@ -1491,37 +1534,21 @@ class Builds extends Action } } - protected function listRules(Document $project, array $queries, Database $database, callable $callback): void + private function cancelDeployment(string $deploymentId, Database $dbForProject, Realtime $queueForRealtime) { - $limit = 100; - $cursor = null; + Console::info('Build has been canceled'); - do { - $queries = \array_merge([ - Query::limit($limit), - Query::equal("projectInternalId", [$project->getInternalId()]) - ], $queries); + $deployment = $dbForProject->getDocument('deployments', $deploymentId); - if ($cursor !== null) { - $queries[] = Query::cursorAfter($cursor); - } + $logs = $deployment->getAttribute('buildLogs', ''); + $date = \date('H:i:s'); + $logs .= "[$date] [appwrite] Build has been canceled. \n"; - $results = $database->find('rules', $queries); + $deployment->setAttribute('buildLogs', $logs); + $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $deployment); - $total = \count($results); - if ($total > 0) { - $cursor = $results[$total - 1]; - } - - if ($total < $limit) { - $cursor = null; - } - - foreach ($results as $document) { - if (is_callable($callback)) { - $callback($document); - } - } - } while (!\is_null($cursor)); + $queueForRealtime + ->setPayload($deployment->getArrayCopy()) + ->trigger(); } } diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php index 43f7d4ac02..9332453eea 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Create.php @@ -57,7 +57,7 @@ class Create extends Action ->inject('user') ->inject('response') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $projectId, string $name, ?string $expire, Document $user, Response $response, Database $dbForPlatform) @@ -76,7 +76,7 @@ class Create extends Action Permission::update(Role::user($user->getId())), Permission::delete(Role::user($user->getId())), ], - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'projectId' => $project->getId(), 'name' => $name, 'expire' => $expire, diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php index f6cb966f50..2bfea6c55b 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Delete.php @@ -49,7 +49,7 @@ class Delete extends Action ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $projectId, string $keyId, Response $response, Database $dbForPlatform) @@ -63,7 +63,7 @@ class Delete extends Action $key = $dbForPlatform->getDocument('devKeys', $keyId); - if ($key === false || $key->isEmpty() || $key->getAttribute('projectInternalId') !== $project->getInternalId()) { + if ($key === false || $key->isEmpty() || $key->getAttribute('projectInternalId') !== $project->getSequence()) { throw new Exception(Exception::KEY_NOT_FOUND); } diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php index bd472b26e7..29cda90f66 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Get.php @@ -49,7 +49,7 @@ class Get extends Action ->param('keyId', '', new UID(), 'Key unique ID.') ->inject('response') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $projectId, string $keyId, Response $response, Database $dbForPlatform) @@ -63,7 +63,7 @@ class Get extends Action $key = $dbForPlatform->getDocument('devKeys', $keyId); - if ($key === false || $key->isEmpty() || $key->getAttribute('projectInternalId') !== $project->getInternalId()) { + if ($key === false || $key->isEmpty() || $key->getAttribute('projectInternalId') !== $project->getSequence()) { throw new Exception(Exception::KEY_NOT_FOUND); } diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php index d5e6839174..b13bc535dd 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/Update.php @@ -52,7 +52,7 @@ class Update extends Action ->param('expire', null, new DatetimeValidator(), 'Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.') ->inject('response') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $projectId, string $keyId, string $name, ?string $expire, Response $response, Database $dbForPlatform) { @@ -65,7 +65,7 @@ class Update extends Action $key = $dbForPlatform->getDocument('devKeys', $keyId); - if ($key === false || $key->isEmpty() || $key->getAttribute('projectInternalId') !== $project->getInternalId()) { + if ($key === false || $key->isEmpty() || $key->getAttribute('projectInternalId') !== $project->getSequence()) { throw new Exception(Exception::KEY_NOT_FOUND); } diff --git a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php index 864531d32d..209387018b 100644 --- a/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php +++ b/src/Appwrite/Platform/Modules/Projects/Http/DevKeys/XList.php @@ -53,7 +53,7 @@ class XList extends Action ->param('queries', [], new DevKeys(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', DevKeys::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $projectId, ?array $queries, Response $response, Database $dbForPlatform) @@ -71,7 +71,7 @@ class XList extends Action throw new Exception(Exception::GENERAL_QUERY_INVALID, $e->getMessage()); } - $queries[] = Query::equal('projectInternalId', [$project->getInternalId()]); + $queries[] = Query::equal('projectInternalId', [$project->getSequence()]); $keys = $dbForPlatform->find('devKeys', $queries); diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php index e4d0d2899f..4efe8176f6 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php @@ -66,7 +66,7 @@ class Create extends Action ->inject('queueForCertificates') ->inject('queueForEvents') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $domain, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform) @@ -153,7 +153,7 @@ class Create extends Action $rule = new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'domain' => $domain->get(), 'status' => $status, 'type' => 'api', diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Function/Create.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Function/Create.php index 6c5a87a68d..1c8fe7b04d 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Function/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Function/Create.php @@ -71,7 +71,7 @@ class Create extends Action ->inject('queueForEvents') ->inject('dbForPlatform') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $domain, string $functionId, string $branch, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform, Database $dbForProject) @@ -165,16 +165,16 @@ class Create extends Action $rule = new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'domain' => $domain->get(), 'status' => $status, 'type' => 'deployment', 'trigger' => 'manual', 'deploymentId' => $deployment->isEmpty() ? '' : $deployment->getId(), - 'deploymentInternalId' => $deployment->isEmpty() ? '' : $deployment->getInternalId(), + 'deploymentInternalId' => $deployment->isEmpty() ? '' : $deployment->getSequence(), 'deploymentResourceType' => 'function', 'deploymentResourceId' => $function->getId(), - 'deploymentResourceInternalId' => $function->getInternalId(), + 'deploymentResourceInternalId' => $function->getSequence(), 'deploymentVcsProviderBranch' => $branch, 'certificateId' => '', 'search' => implode(' ', [$ruleId, $domain->get(), $branch]), diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Redirect/Create.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Redirect/Create.php index d0c9dbbbe3..580d92bc74 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Redirect/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Redirect/Create.php @@ -14,6 +14,7 @@ use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Exception\Duplicate; use Utopia\Database\Helpers\ID; +use Utopia\Database\Validator\UID; use Utopia\Domains\Domain; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; @@ -65,15 +66,18 @@ class Create extends Action ->param('domain', null, new ValidatorDomain(), 'Domain name.') ->param('url', null, new URL(), 'Target URL of redirection') ->param('statusCode', null, new WhiteList([301, 302, 307, 308]), 'Status code of redirection') + ->param('resourceId', '', new UID(), 'ID of parent resource.') + ->param('resourceType', '', new WhiteList(['site', 'function']), 'Type of parent resource.') ->inject('response') ->inject('project') ->inject('queueForCertificates') ->inject('queueForEvents') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->inject('dbForProject') + ->callback($this->action(...)); } - public function action(string $domain, string $url, int $statusCode, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform) + public function action(string $domain, string $url, int $statusCode, string $resourceId, string $resourceType, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform, Database $dbForProject) { $deniedDomains = [ 'localhost', @@ -116,6 +120,15 @@ class Create extends Action throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'Domain may not start with http:// or https://.'); } + $collection = match ($resourceType) { + 'site' => 'sites', + 'function' => 'functions' + }; + $resource = $dbForProject->getDocument($collection, $resourceId); + if ($resource->isEmpty()) { + throw new Exception(Exception::RULE_RESOURCE_NOT_FOUND); + } + // TODO: @christyjacob remove once we migrate the rules in 1.7.x $ruleId = System::getEnv('_APP_RULES_FORMAT') === 'md5' ? md5($domain->get()) : ID::unique(); @@ -157,13 +170,16 @@ class Create extends Action $rule = new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'domain' => $domain->get(), 'status' => $status, 'type' => 'redirect', 'trigger' => 'manual', 'redirectUrl' => $url, 'redirectStatusCode' => $statusCode, + 'deploymentResourceType' => $resourceType, + 'deploymentResourceId' => $resource->getId(), + 'deploymentResourceInternalId' => $resource->getSequence(), 'certificateId' => '', 'search' => implode(' ', [$ruleId, $domain->get()]), 'owner' => $owner, diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php index 894c954a32..7a5a1f4952 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php @@ -71,7 +71,7 @@ class Create extends Action ->inject('queueForEvents') ->inject('dbForPlatform') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $domain, string $siteId, string $branch, Response $response, Document $project, Certificate $queueForCertificates, Event $queueForEvents, Database $dbForPlatform, Database $dbForProject) @@ -165,16 +165,16 @@ class Create extends Action $rule = new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'domain' => $domain->get(), 'status' => $status, 'type' => 'deployment', 'trigger' => 'manual', 'deploymentId' => $deployment->isEmpty() ? '' : $deployment->getId(), - 'deploymentInternalId' => $deployment->isEmpty() ? '' : $deployment->getInternalId(), + 'deploymentInternalId' => $deployment->isEmpty() ? '' : $deployment->getSequence(), 'deploymentResourceType' => 'site', 'deploymentResourceId' => $site->getId(), - 'deploymentResourceInternalId' => $site->getInternalId(), + 'deploymentResourceInternalId' => $site->getSequence(), 'deploymentVcsProviderBranch' => $branch, 'certificateId' => '', 'search' => implode(' ', [$ruleId, $domain->get(), $branch]), diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php index 13b1e0c830..65a0fcf143 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php @@ -86,7 +86,7 @@ class Create extends Action ->inject('deviceForLocal') ->inject('queueForBuilds') ->inject('plan') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -246,7 +246,7 @@ class Create extends Action Permission::update(Role::any()), Permission::delete(Role::any()), ], - 'resourceInternalId' => $site->getInternalId(), + 'resourceInternalId' => $site->getSequence(), 'resourceId' => $site->getId(), 'resourceType' => 'sites', 'buildCommands' => \implode(' && ', $commands), @@ -263,7 +263,7 @@ class Create extends Action $site = $site ->setAttribute('latestDeploymentId', $deployment->getId()) - ->setAttribute('latestDeploymentInternalId', $deployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $deployment->getSequence()) ->setAttribute('latestDeploymentCreatedAt', $deployment->getCreatedAt()) ->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); $dbForProject->updateDocument('sites', $site->getId(), $site); @@ -278,15 +278,15 @@ class Create extends Action fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'domain' => $domain, 'type' => 'deployment', 'trigger' => 'deployment', 'deploymentId' => $deployment->isEmpty() ? '' : $deployment->getId(), - 'deploymentInternalId' => $deployment->isEmpty() ? '' : $deployment->getInternalId(), + 'deploymentInternalId' => $deployment->isEmpty() ? '' : $deployment->getSequence(), 'deploymentResourceType' => 'site', 'deploymentResourceId' => $site->getId(), - 'deploymentResourceInternalId' => $site->getInternalId(), + 'deploymentResourceInternalId' => $site->getSequence(), 'status' => 'verified', 'certificateId' => '', 'search' => implode(' ', [$ruleId, $domain]), @@ -312,7 +312,7 @@ class Create extends Action Permission::update(Role::any()), Permission::delete(Role::any()), ], - 'resourceInternalId' => $site->getInternalId(), + 'resourceInternalId' => $site->getSequence(), 'resourceId' => $site->getId(), 'resourceType' => 'sites', 'buildCommands' => \implode(' && ', $commands), @@ -331,7 +331,7 @@ class Create extends Action $site = $site ->setAttribute('latestDeploymentId', $deployment->getId()) - ->setAttribute('latestDeploymentInternalId', $deployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $deployment->getSequence()) ->setAttribute('latestDeploymentCreatedAt', $deployment->getCreatedAt()) ->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); $dbForProject->updateDocument('sites', $site->getId(), $site); @@ -343,14 +343,20 @@ class Create extends Action fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'domain' => $domain, 'type' => 'deployment', 'trigger' => 'deployment', - 'value' => $deployment->getId(), + 'deploymentId' => $deployment->isEmpty() ? '' : $deployment->getId(), + 'deploymentInternalId' => $deployment->isEmpty() ? '' : $deployment->getSequence(), + 'deploymentResourceType' => 'site', + 'deploymentResourceId' => $site->getId(), + 'deploymentResourceInternalId' => $site->getSequence(), 'status' => 'verified', 'certificateId' => '', 'search' => implode(' ', [$ruleId, $domain]), + 'owner' => 'Appwrite', + 'region' => $project->getAttribute('region') ])) ); } else { diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php index 27db10c484..dfc0f0c976 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Delete.php @@ -62,7 +62,7 @@ class Delete extends Action ->inject('queueForDeletes') ->inject('queueForEvents') ->inject('deviceForSites') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -101,7 +101,7 @@ class Delete extends Action if ($site->getAttribute('latestDeploymentId') === $deployment->getId()) { $latestDeployment = $dbForProject->findOne('deployments', [ Query::equal('resourceType', ['sites']), - Query::equal('resourceInternalId', [$site->getInternalId()]), + Query::equal('resourceInternalId', [$site->getSequence()]), Query::orderDesc('$createdAt'), ]); $site = $dbForProject->updateDocument( @@ -109,7 +109,7 @@ class Delete extends Action $site->getId(), $site ->setAttribute('latestDeploymentCreatedAt', $latestDeployment->isEmpty() ? '' : $latestDeployment->getCreatedAt()) - ->setAttribute('latestDeploymentInternalId', $latestDeployment->isEmpty() ? '' : $latestDeployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $latestDeployment->isEmpty() ? '' : $latestDeployment->getSequence()) ->setAttribute('latestDeploymentId', $latestDeployment->isEmpty() ? '' : $latestDeployment->getId()) ->setAttribute('latestDeploymentStatus', $latestDeployment->isEmpty() ? '' : $latestDeployment->getAttribute('status', '')) ); diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Download/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Download/Get.php index e83af0bab6..5a87ce453f 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Download/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Download/Get.php @@ -60,7 +60,7 @@ class Get extends Action ->inject('dbForProject') ->inject('deviceForSites') ->inject('deviceForBuilds') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -99,12 +99,14 @@ class Get extends Action } if (!$device->exists($path)) { - throw new Exception(Exception::BUILD_NOT_FOUND); + throw new Exception(Exception::DEPLOYMENT_NOT_FOUND); } $response ->setContentType('application/gzip') - ->addHeader('Expires', \date('D, d M Y H:i:s', \time() + (60 * 60 * 24 * 45)) . ' GMT') // 45 days cache + ->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate') + ->addHeader('Expires', '0') + ->addHeader('Pragma', 'no-cache') ->addHeader('X-Peak', \memory_get_peak_usage()) ->addHeader('Content-Disposition', 'attachment; filename="' . $deploymentId . '-' . $type . '.tar.gz"'); diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php index bff0735328..22a7a47390 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php @@ -65,7 +65,7 @@ class Create extends Action ->inject('queueForEvents') ->inject('queueForBuilds') ->inject('deviceForSites') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -110,9 +110,9 @@ class Create extends Action $commands[] = $site->getAttribute('buildCommand', ''); } - $deployment->removeAttribute('$internalId'); + $deployment->removeAttribute('$sequence'); $deployment = $dbForProject->createDocument('deployments', $deployment->setAttributes([ - '$internalId' => '', + '$sequence' => '', '$id' => $deploymentId, 'sourcePath' => $destination, 'totalSize' => $deployment->getAttribute('sourceSize', 0), @@ -134,7 +134,7 @@ class Create extends Action $site = $site ->setAttribute('latestDeploymentId', $deployment->getId()) - ->setAttribute('latestDeploymentInternalId', $deployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $deployment->getSequence()) ->setAttribute('latestDeploymentCreatedAt', $deployment->getCreatedAt()) ->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); $dbForProject->updateDocument('sites', $site->getId(), $site); @@ -150,15 +150,15 @@ class Create extends Action fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'domain' => $domain, 'type' => 'deployment', 'trigger' => 'deployment', 'deploymentId' => $deployment->isEmpty() ? '' : $deployment->getId(), - 'deploymentInternalId' => $deployment->isEmpty() ? '' : $deployment->getInternalId(), + 'deploymentInternalId' => $deployment->isEmpty() ? '' : $deployment->getSequence(), 'deploymentResourceType' => 'site', 'deploymentResourceId' => $site->getId(), - 'deploymentResourceInternalId' => $site->getInternalId(), + 'deploymentResourceInternalId' => $site->getSequence(), 'status' => 'verified', 'certificateId' => '', 'owner' => 'Appwrite', diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Get.php index d280231159..d583c62fb1 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Get.php @@ -49,7 +49,7 @@ class Get extends Action ->param('deploymentId', '', new UID(), 'Deployment ID.') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, string $deploymentId, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Status/Update.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Status/Update.php index 2c6da43893..a447e54f8d 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Status/Update.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Status/Update.php @@ -57,7 +57,7 @@ class Update extends Action ->inject('project') ->inject('queueForEvents') ->inject('executor') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -95,7 +95,7 @@ class Update extends Action 'status' => 'canceled' ])); - if ($deployment->getInternalId() === $site->getAttribute('latestDeploymentInternalId', '')) { + if ($deployment->getSequence() === $site->getAttribute('latestDeploymentInternalId', '')) { $site = $site->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); $dbForProject->updateDocument('sites', $site->getId(), $site); } diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php index 5b29521ce5..a2040d830b 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php @@ -77,7 +77,7 @@ class Create extends Base ->inject('queueForEvents') ->inject('queueForBuilds') ->inject('gitHub') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -153,7 +153,7 @@ class Create extends Base Permission::delete(Role::any()), ], 'resourceId' => $site->getId(), - 'resourceInternalId' => $site->getInternalId(), + 'resourceInternalId' => $site->getSequence(), 'resourceType' => 'sites', 'buildCommands' => \implode(' && ', $commands), 'buildOutput' => $site->getAttribute('outputDirectory', ''), @@ -165,7 +165,7 @@ class Create extends Base $site = $site ->setAttribute('latestDeploymentId', $deployment->getId()) - ->setAttribute('latestDeploymentInternalId', $deployment->getInternalId()) + ->setAttribute('latestDeploymentInternalId', $deployment->getSequence()) ->setAttribute('latestDeploymentCreatedAt', $deployment->getCreatedAt()) ->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', '')); $dbForProject->updateDocument('sites', $site->getId(), $site); @@ -180,15 +180,15 @@ class Create extends Base fn () => $dbForPlatform->createDocument('rules', new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'domain' => $domain, 'type' => 'deployment', 'trigger' => 'deployment', 'deploymentId' => $deployment->isEmpty() ? '' : $deployment->getId(), - 'deploymentInternalId' => $deployment->isEmpty() ? '' : $deployment->getInternalId(), + 'deploymentInternalId' => $deployment->isEmpty() ? '' : $deployment->getSequence(), 'deploymentResourceType' => 'site', 'deploymentResourceId' => $site->getId(), - 'deploymentResourceInternalId' => $site->getInternalId(), + 'deploymentResourceInternalId' => $site->getSequence(), 'status' => 'verified', 'certificateId' => '', 'owner' => 'Appwrite', diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php index eb6fdf4094..ddad5d793a 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/Vcs/Create.php @@ -72,7 +72,7 @@ class Create extends Base ->inject('queueForEvents') ->inject('queueForBuilds') ->inject('gitHub') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/XList.php index d7cfc1d3ad..a1a79ec155 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Deployments/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Deployments/XList.php @@ -57,7 +57,7 @@ class XList extends Action ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, array $queries, string $search, Response $response, Database $dbForProject) @@ -79,7 +79,7 @@ class XList extends Action } // Set resource queries - $queries[] = Query::equal('resourceInternalId', [$site->getInternalId()]); + $queries[] = Query::equal('resourceInternalId', [$site->getSequence()]); $queries[] = Query::equal('resourceType', ['sites']); /** diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Frameworks/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Frameworks/XList.php index cf2bb8c62b..a042fd6e7c 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Frameworks/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Frameworks/XList.php @@ -46,7 +46,7 @@ class XList extends Base ] )) ->inject('response') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(Response $response) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Logs/Delete.php b/src/Appwrite/Platform/Modules/Sites/Http/Logs/Delete.php index a411cee91f..0f53985039 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Logs/Delete.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Logs/Delete.php @@ -55,7 +55,7 @@ class Delete extends Base ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, string $logId, Response $response, Database $dbForProject, Event $queueForEvents) @@ -71,7 +71,7 @@ class Delete extends Base throw new Exception(Exception::LOG_NOT_FOUND); } - if ($log->getAttribute('resourceType') !== 'sites' && $log->getAttribute('resourceInternalId') !== $site->getInternalId()) { + if ($log->getAttribute('resourceType') !== 'sites' && $log->getAttribute('resourceInternalId') !== $site->getSequence()) { throw new Exception(Exception::LOG_NOT_FOUND); } diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Logs/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Logs/Get.php index 3d1ace2d20..935e790113 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Logs/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Logs/Get.php @@ -50,7 +50,7 @@ class Get extends Base ->param('logId', '', new UID(), 'Log ID.') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, string $logId, Response $response, Database $dbForProject) @@ -63,7 +63,7 @@ class Get extends Base $log = $dbForProject->getDocument('executions', $logId); - if ($log->getAttribute('resourceType') !== 'sites' && $log->getAttribute('resourceInternalId') !== $site->getInternalId()) { + if ($log->getAttribute('resourceType') !== 'sites' && $log->getAttribute('resourceInternalId') !== $site->getSequence()) { throw new Exception(Exception::LOG_NOT_FOUND); } diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Logs/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Logs/XList.php index a873d32603..f9bee3e425 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Logs/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Logs/XList.php @@ -57,7 +57,7 @@ class XList extends Base ->param('queries', [], new Logs(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Executions::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, array $queries, Response $response, Database $dbForProject) @@ -75,7 +75,7 @@ class XList extends Base } // Set internal queries - $queries[] = Query::equal('resourceInternalId', [$site->getInternalId()]); + $queries[] = Query::equal('resourceInternalId', [$site->getSequence()]); $queries[] = Query::equal('resourceType', ['sites']); /** diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php index c509799024..9be95441cb 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php @@ -89,7 +89,7 @@ class Create extends Base ->inject('project') ->inject('queueForEvents') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -154,7 +154,7 @@ class Create extends Base 'search' => implode(' ', [$siteId, $name, $framework]), 'fallbackFile' => $fallbackFile, 'installationId' => $installation->getId(), - 'installationInternalId' => $installation->getInternalId(), + 'installationInternalId' => $installation->getSequence(), 'providerRepositoryId' => $providerRepositoryId, 'repositoryId' => '', 'repositoryInternalId' => '', @@ -180,18 +180,18 @@ class Create extends Base Permission::delete(Role::team(ID::custom($teamId), 'developer')), ], 'installationId' => $installation->getId(), - 'installationInternalId' => $installation->getInternalId(), + 'installationInternalId' => $installation->getSequence(), 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'providerRepositoryId' => $providerRepositoryId, 'resourceId' => $site->getId(), - 'resourceInternalId' => $site->getInternalId(), + 'resourceInternalId' => $site->getSequence(), 'resourceType' => 'site', 'providerPullRequestIds' => [] ])); $site->setAttribute('repositoryId', $repository->getId()); - $site->setAttribute('repositoryInternalId', $repository->getInternalId()); + $site->setAttribute('repositoryInternalId', $repository->getSequence()); } $site = $dbForProject->updateDocument('sites', $site->getId(), $site); diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Delete.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Delete.php index 37666215e5..ed9b059c33 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Delete.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Delete.php @@ -58,7 +58,7 @@ class Delete extends Base ->inject('dbForProject') ->inject('queueForDeletes') ->inject('queueForEvents') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php index 7f1681c0f1..bb6bd4f632 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Deployment/Update.php @@ -5,13 +5,14 @@ namespace Appwrite\Platform\Modules\Sites\Http\Sites\Deployment; use Appwrite\Event\Event; use Appwrite\Extend\Exception; use Appwrite\Platform\Modules\Compute\Base; -use Appwrite\Query; use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; use Utopia\Database\Database; use Utopia\Database\Document; +use Utopia\Database\Query; +use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; @@ -59,7 +60,7 @@ class Update extends Base ->inject('dbForProject') ->inject('queueForEvents') ->inject('dbForPlatform') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -86,10 +87,8 @@ class Update extends Base throw new Exception(Exception::BUILD_NOT_READY); } - $oldDeploymentInternalId = $site->getAttribute('deploymentInternalId', ''); - $site = $dbForProject->updateDocument('sites', $site->getId(), new Document(array_merge($site->getArrayCopy(), [ - 'deploymentInternalId' => $deployment->getInternalId(), + 'deploymentInternalId' => $deployment->getSequence(), 'deploymentId' => $deployment->getId(), 'deploymentScreenshotDark' => $deployment->getAttribute('screenshotDark', ''), 'deploymentScreenshotLight' => $deployment->getAttribute('screenshotLight', ''), @@ -97,24 +96,21 @@ class Update extends Base ]))); $queries = [ - Query::equal('trigger', 'manual'), - Query::equal("type", ["deployment"]), - Query::equal("deploymentResourceType", ["site"]), - Query::equal("deploymentResourceInternalId", [$site->getInternalId()]), + Query::equal('trigger', ['manual']), + Query::equal('type', ['deployment']), + Query::equal('deploymentResourceType', ['site']), + Query::equal('deploymentResourceInternalId', [$site->getSequence()]), + Query::equal('deploymentVcsProviderBranch', ['']), + Query::equal('projectInternalId', [$project->getSequence()]) ]; - if (empty($oldDeploymentInternalId)) { - $queries[] = Query::equal("deploymentInternalId", [""]); - } else { - $queries[] = Query::equal("deploymentInternalId", [$oldDeploymentInternalId]); - } - - $this->listRules($project, $queries, $dbForPlatform, function (Document $rule) use ($dbForPlatform, $deployment) { + Authorization::skip(fn () => $dbForPlatform->foreach('rules', function (Document $rule) use ($dbForPlatform, $deployment) { $rule = $rule ->setAttribute('deploymentId', $deployment->getId()) - ->setAttribute('deploymentInternalId', $deployment->getInternalId()); - $dbForPlatform->updateDocument('rules', $rule->getId(), $rule); - }); + ->setAttribute('deploymentInternalId', $deployment->getSequence()); + + Authorization::skip(fn () => $dbForPlatform->updateDocument('rules', $rule->getId(), $rule)); + }, $queries)); $queueForEvents ->setParam('siteId', $site->getId()) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Get.php index 88ff5f1d51..d86d98ef71 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Get.php @@ -49,7 +49,7 @@ class Get extends Base ->param('siteId', '', new UID(), 'Site ID.') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php index 212b410178..80354d5067 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php @@ -97,7 +97,7 @@ class Update extends Base ->inject('dbForPlatform') ->inject('gitHub') ->inject('executor') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -173,8 +173,8 @@ class Update extends Base // Git disconnect logic. Disconnecting only when providerRepositoryId is empty, allowing for continue updates without disconnecting git if ($isConnected && ($providerRepositoryId !== null && empty($providerRepositoryId))) { $repositories = $dbForPlatform->find('repositories', [ - Query::equal('projectInternalId', [$project->getInternalId()]), - Query::equal('resourceInternalId', [$site->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), + Query::equal('resourceInternalId', [$site->getSequence()]), Query::equal('resourceType', ['site']), Query::limit(100), ]); @@ -206,18 +206,18 @@ class Update extends Base Permission::delete(Role::team(ID::custom($teamId), 'developer')), ], 'installationId' => $installation->getId(), - 'installationInternalId' => $installation->getInternalId(), + 'installationInternalId' => $installation->getSequence(), 'projectId' => $project->getId(), - 'projectInternalId' => $project->getInternalId(), + 'projectInternalId' => $project->getSequence(), 'providerRepositoryId' => $providerRepositoryId, 'resourceId' => $site->getId(), - 'resourceInternalId' => $site->getInternalId(), + 'resourceInternalId' => $site->getSequence(), 'resourceType' => 'site', 'providerPullRequestIds' => [] ])); $repositoryId = $repository->getId(); - $repositoryInternalId = $repository->getInternalId(); + $repositoryInternalId = $repository->getSequence(); } $live = true; @@ -256,7 +256,7 @@ class Update extends Base 'buildCommand' => $buildCommand, 'outputDirectory' => $outputDirectory, 'installationId' => $installation->getId(), - 'installationInternalId' => $installation->getInternalId(), + 'installationInternalId' => $installation->getSequence(), 'providerRepositoryId' => $providerRepositoryId, 'repositoryId' => $repositoryId, 'repositoryInternalId' => $repositoryInternalId, diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/XList.php index 0a3b257f59..988a2d2e20 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/XList.php @@ -56,7 +56,7 @@ class XList extends Base ->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(array $queries, string $search, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Specifications/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Specifications/XList.php index 2a9447f8c6..4bda37df73 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Specifications/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Specifications/XList.php @@ -48,7 +48,7 @@ class XList extends Base )) ->inject('response') ->inject('plan') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(Response $response, array $plan) @@ -63,8 +63,8 @@ class XList extends Base $spec['enabled'] = in_array($spec['slug'], $plan['runtimeSpecifications']); } - $maxCpus = System::getEnv('_APP_FUNCTIONS_CPUS', 0); - $maxMemory = System::getEnv('_APP_FUNCTIONS_MEMORY', 0); + $maxCpus = System::getEnv('_APP_COMPUTE_CPUS', 0); + $maxMemory = System::getEnv('_APP_COMPUTE_MEMORY', 0); // Only add specs that are within the limits set by environment variables // Treat 0 as no limit diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Templates/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Templates/Get.php index a4066fb787..633ef31e68 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Templates/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Templates/Get.php @@ -49,7 +49,7 @@ class Get extends Base )) ->param('templateId', '', new Text(128), 'Template ID.') ->inject('response') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $templateId, Response $response) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Templates/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Templates/XList.php index 414ecc9987..4fe00f3edf 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Templates/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Templates/XList.php @@ -53,7 +53,7 @@ class XList extends Base ->param('limit', 25, new Range(1, 5000), 'Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.', true) ->param('offset', 0, new Range(0, 5000), 'Offset the list of returned templates. Maximum offset is 5000.', true) ->inject('response') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php index 8bf19a9c28..af96c10457 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Usage/Get.php @@ -55,7 +55,7 @@ class Get extends Base ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -74,20 +74,20 @@ class Get extends Base $stats = $usage = []; $days = $periods[$range]; $metrics = [ - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getInternalId()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getInternalId()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS_STORAGE), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_COMPUTE), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_MB_SECONDS), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_SUCCESS), - str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_FAILED), - str_replace(['{siteInternalId}'], [$site->getInternalId()], METRIC_SITES_ID_REQUESTS), - str_replace(['{siteInternalId}'], [$site->getInternalId()], METRIC_SITES_ID_INBOUND), - str_replace(['{siteInternalId}'], [$site->getInternalId()], METRIC_SITES_ID_OUTBOUND), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS_STORAGE), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_COMPUTE), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_MB_SECONDS), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_SUCCESS), + str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_SITES, $site->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_FAILED), + str_replace(['{siteInternalId}'], [$site->getSequence()], METRIC_SITES_ID_REQUESTS), + str_replace(['{siteInternalId}'], [$site->getSequence()], METRIC_SITES_ID_INBOUND), + str_replace(['{siteInternalId}'], [$site->getSequence()], METRIC_SITES_ID_OUTBOUND), ]; diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Usage/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Usage/XList.php index e37d3e792e..d36cc56ae5 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Usage/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Usage/XList.php @@ -52,7 +52,7 @@ class XList extends Base ->param('range', '30d', new WhiteList(['24h', '30d', '90d']), 'Date range.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $range, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Create.php b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Create.php index ff1a5c50ec..ef504fe663 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Create.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Create.php @@ -62,7 +62,7 @@ class Create extends Base ->inject('response') ->inject('dbForProject') ->inject('project') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, string $key, string $value, bool $secret, Response $response, Database $dbForProject, Document $project) @@ -85,7 +85,7 @@ class Create extends Base Permission::delete(Role::team(ID::custom($teamId), 'owner')), Permission::delete(Role::team(ID::custom($teamId), 'developer')), ], - 'resourceInternalId' => $site->getInternalId(), + 'resourceInternalId' => $site->getSequence(), 'resourceId' => $site->getId(), 'resourceType' => 'site', 'key' => $key, diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Delete.php b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Delete.php index e4594a7c3d..be0addb34c 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Delete.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Delete.php @@ -54,7 +54,7 @@ class Delete extends Base ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, string $variableId, Response $response, Database $dbForProject) @@ -66,7 +66,7 @@ class Delete extends Base } $variable = $dbForProject->getDocument('variables', $variableId); - if ($variable === false || $variable->isEmpty() || $variable->getAttribute('resourceInternalId') !== $site->getInternalId() || $variable->getAttribute('resourceType') !== 'site') { + if ($variable === false || $variable->isEmpty() || $variable->getAttribute('resourceInternalId') !== $site->getSequence() || $variable->getAttribute('resourceType') !== 'site') { throw new Exception(Exception::VARIABLE_NOT_FOUND); } diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Get.php b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Get.php index a14129d432..11eb546092 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Get.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Get.php @@ -53,7 +53,7 @@ class Get extends Base ->param('variableId', '', new UID(), 'Variable unique ID.', false) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $siteId, string $variableId, Response $response, Database $dbForProject) @@ -68,7 +68,7 @@ class Get extends Base if ( $variable === false || $variable->isEmpty() || - $variable->getAttribute('resourceInternalId') !== $site->getInternalId() || + $variable->getAttribute('resourceInternalId') !== $site->getSequence() || $variable->getAttribute('resourceType') !== 'site' ) { throw new Exception(Exception::VARIABLE_NOT_FOUND); diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Update.php b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Update.php index cd438a0ebb..3cf2e2f85f 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Variables/Update.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Variables/Update.php @@ -58,7 +58,7 @@ class Update extends Base ->param('secret', null, new Boolean(), 'Secret variables can be updated or deleted, but only sites can read them during build and runtime.', true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -77,7 +77,7 @@ class Update extends Base } $variable = $dbForProject->getDocument('variables', $variableId); - if ($variable === false || $variable->isEmpty() || $variable->getAttribute('resourceInternalId') !== $site->getInternalId() || $variable->getAttribute('resourceType') !== 'site') { + if ($variable === false || $variable->isEmpty() || $variable->getAttribute('resourceInternalId') !== $site->getSequence() || $variable->getAttribute('resourceType') !== 'site') { throw new Exception(Exception::VARIABLE_NOT_FOUND); } diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Variables/XList.php b/src/Appwrite/Platform/Modules/Sites/Http/Variables/XList.php index 15e21296a5..51ab355c75 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Variables/XList.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Variables/XList.php @@ -53,7 +53,7 @@ class XList extends Base ->param('siteId', '', new UID(), 'Site unique ID.', false) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php index 565ab7bab7..5708f1b83b 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Action.php @@ -29,14 +29,15 @@ class Action extends UtopiaAction $fileSecurity = $bucket->getAttribute('fileSecurity', false); if ($fileSecurity) { - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); } else { - $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId)); + $file = Authorization::skip(fn () => $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId)); } if ($file->isEmpty()) { throw new Exception(Exception::STORAGE_FILE_NOT_FOUND); } + return [ 'bucket' => $bucket, 'file' => $file, diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Create.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Create.php index fb96849ed2..fe7a0187e9 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Create.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/Create.php @@ -65,7 +65,7 @@ class Create extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $bucketId, string $fileId, ?string $expire, Response $response, Database $dbForProject, Event $queueForEvents): void @@ -94,7 +94,7 @@ class Create extends Action '$id' => ID::unique(), 'secret' => Auth::tokenGenerator(128), 'resourceId' => $bucketId . ':' . $fileId, - 'resourceInternalId' => $bucket->getInternalId() . ':' . $file->getInternalId(), + 'resourceInternalId' => $bucket->getSequence() . ':' . $file->getSequence(), 'resourceType' => TOKENS_RESOURCE_TYPE_FILES, 'expire' => $expire, ])); diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/XList.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/XList.php index 38fe10e2d9..231164d6ee 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/XList.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/XList.php @@ -55,7 +55,7 @@ class XList extends Action ->param('queries', [], new FileTokens(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', FileTokens::ALLOWED_ATTRIBUTES), true) ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $bucketId, string $fileId, array $queries, Response $response, Database $dbForProject) @@ -64,7 +64,7 @@ class XList extends Action $queries = Query::parseQueries($queries); $queries[] = Query::equal('resourceType', [TOKENS_RESOURCE_TYPE_FILES]); - $queries[] = Query::equal('resourceInternalId', [$bucket->getInternalId() . ':' . $file->getInternalId()]); + $queries[] = Query::equal('resourceInternalId', [$bucket->getSequence() . ':' . $file->getSequence()]); // Get cursor document if there was a cursor query $cursor = \array_filter($queries, function ($query) { return \in_array($query->getMethod(), [Query::TYPE_CURSOR_AFTER, Query::TYPE_CURSOR_BEFORE]); diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Delete.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Delete.php index fcac9a6b24..c36df367ee 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Delete.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Delete.php @@ -58,7 +58,7 @@ class Delete extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $tokenId, Response $response, Database $dbForProject, Event $queueForEvents) diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Get.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Get.php index 66b9c1b5cb..4da9e125f2 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Get.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Get.php @@ -50,7 +50,7 @@ class Get extends Action ->param('tokenId', '', new UID(), 'Token ID.') ->inject('response') ->inject('dbForProject') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $tokenId, Response $response, Database $dbForProject) diff --git a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Update.php b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Update.php index c341831c0d..7a15708011 100644 --- a/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Update.php +++ b/src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Update.php @@ -61,7 +61,7 @@ class Update extends Action ->inject('response') ->inject('dbForProject') ->inject('queueForEvents') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $tokenId, ?string $expire, Response $response, Database $dbForProject, Event $queueForEvents) diff --git a/src/Appwrite/Platform/Tasks/Doctor.php b/src/Appwrite/Platform/Tasks/Doctor.php index b543555477..20eeb0826e 100644 --- a/src/Appwrite/Platform/Tasks/Doctor.php +++ b/src/Appwrite/Platform/Tasks/Doctor.php @@ -34,7 +34,7 @@ class Doctor extends Action $this ->desc('Validate server health') ->inject('register') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(Registry $register): void diff --git a/src/Appwrite/Platform/Tasks/Install.php b/src/Appwrite/Platform/Tasks/Install.php index c7b1f72453..c3b4e33593 100644 --- a/src/Appwrite/Platform/Tasks/Install.php +++ b/src/Appwrite/Platform/Tasks/Install.php @@ -31,7 +31,7 @@ class Install extends Action ->param('image', 'appwrite', new Text(0), 'Main appwrite docker image', true) ->param('interactive', 'Y', new Text(1), 'Run an interactive session', true) ->param('no-start', false, new Boolean(true), 'Run an interactive session', true) - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $httpPort, string $httpsPort, string $organization, string $image, string $interactive, bool $noStart): void diff --git a/src/Appwrite/Platform/Tasks/Maintenance.php b/src/Appwrite/Platform/Tasks/Maintenance.php index fd9d05dec9..e6def793b5 100644 --- a/src/Appwrite/Platform/Tasks/Maintenance.php +++ b/src/Appwrite/Platform/Tasks/Maintenance.php @@ -4,9 +4,11 @@ namespace Appwrite\Platform\Tasks; use Appwrite\Event\Certificate; use Appwrite\Event\Delete; +use DateInterval; +use DateTime; use Utopia\CLI\Console; use Utopia\Database\Database; -use Utopia\Database\DateTime; +use Utopia\Database\DateTime as DatabaseDateTime; use Utopia\Database\Document; use Utopia\Database\Query; use Utopia\Platform\Action; @@ -27,7 +29,7 @@ class Maintenance extends Action ->inject('console') ->inject('queueForCertificates') ->inject('queueForDeletes') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(Database $dbForPlatform, Document $console, Certificate $queueForCertificates, Delete $queueForDeletes): void @@ -58,29 +60,35 @@ class Maintenance extends Action Console::info('Setting loop start time to ' . $next->format("Y-m-d H:i:s.v") . '. Delaying for ' . $delay . ' seconds.'); Console::loop(function () use ($interval, $cacheRetention, $schedulesDeletionRetention, $usageStatsRetentionHourly, $dbForPlatform, $console, $queueForDeletes, $queueForCertificates) { - $time = DateTime::now(); + $time = DatabaseDateTime::now(); Console::info("[{$time}] Notifying workers with maintenance tasks every {$interval} seconds"); + // Iterate through project only if it was accessed in last 30 days + $dateInterval = DateInterval::createFromDateString('30 days'); + $before30days = (new DateTime())->sub($dateInterval); + $dbForPlatform->foreach( 'projects', function (Document $project) use ($queueForDeletes, $usageStatsRetentionHourly) { $queueForDeletes ->setType(DELETE_TYPE_MAINTENANCE) ->setProject($project) - ->setUsageRetentionHourlyDateTime(DateTime::addSeconds(new \DateTime(), -1 * $usageStatsRetentionHourly)) + ->setUsageRetentionHourlyDateTime(DatabaseDateTime::addSeconds(new \DateTime(), -1 * $usageStatsRetentionHourly)) ->trigger(); }, [ Query::equal('region', [System::getEnv('_APP_REGION', 'default')]), Query::limit(100), + Query::greaterThanEqual('accessedAt', DatabaseDateTime::format($before30days)), + Query::orderAsc('teamInternalId'), ] ); $queueForDeletes ->setType(DELETE_TYPE_MAINTENANCE) ->setProject($console) - ->setUsageRetentionHourlyDateTime(DateTime::addSeconds(new \DateTime(), -1 * $usageStatsRetentionHourly)) + ->setUsageRetentionHourlyDateTime(DatabaseDateTime::addSeconds(new \DateTime(), -1 * $usageStatsRetentionHourly)) ->trigger(); $this->notifyDeleteConnections($queueForDeletes); @@ -94,13 +102,13 @@ class Maintenance extends Action { $queueForDeletes ->setType(DELETE_TYPE_REALTIME) - ->setDatetime(DateTime::addSeconds(new \DateTime(), -60)) + ->setDatetime(DatabaseDateTime::addSeconds(new \DateTime(), -60)) ->trigger(); } private function renewCertificates(Database $dbForPlatform, Certificate $queueForCertificate): void { - $time = DateTime::now(); + $time = DatabaseDateTime::now(); $certificates = $dbForPlatform->find('certificates', [ Query::lessThan('attempts', 5), // Maximum 5 attempts @@ -129,7 +137,7 @@ class Maintenance extends Action { $queueForDeletes ->setType(DELETE_TYPE_CACHE_BY_TIMESTAMP) - ->setDatetime(DateTime::addSeconds(new \DateTime(), -1 * $interval)) + ->setDatetime(DatabaseDateTime::addSeconds(new \DateTime(), -1 * $interval)) ->trigger(); } @@ -137,7 +145,7 @@ class Maintenance extends Action { $queueForDeletes ->setType(DELETE_TYPE_SCHEDULES) - ->setDatetime(DateTime::addSeconds(new \DateTime(), -1 * $interval)) + ->setDatetime(DatabaseDateTime::addSeconds(new \DateTime(), -1 * $interval)) ->trigger(); } } diff --git a/src/Appwrite/Platform/Tasks/QueueRetry.php b/src/Appwrite/Platform/Tasks/QueueRetry.php index f8099dcb00..442fa39823 100644 --- a/src/Appwrite/Platform/Tasks/QueueRetry.php +++ b/src/Appwrite/Platform/Tasks/QueueRetry.php @@ -24,7 +24,7 @@ class QueueRetry extends Action ->param('name', '', new Text(100), 'Queue name') ->param('limit', 0, new Wildcard(), 'jobs limit', true) ->inject('publisher') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index a0009fd59f..98a1ae6a10 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -46,7 +46,7 @@ class SDKs extends Action ->param('git', null, new Nullable(new WhiteList(['yes', 'no'])), 'Should we use git push?', optional: true) ->param('production', null, new Nullable(new WhiteList(['yes', 'no'])), 'Should we push to production?', optional: true) ->param('message', null, new Nullable(new Text(256)), 'Commit Message', optional: true) - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(?string $selectedPlatform, ?string $selectedSDK, ?string $version, ?string $git, ?string $production, ?string $message): void @@ -64,7 +64,7 @@ class SDKs extends Action $message ??= Console::confirm('Please enter your commit message:'); } - if (!in_array($version, ['0.6.x', '0.7.x', '0.8.x', '0.9.x', '0.10.x', '0.11.x', '0.12.x', '0.13.x', '0.14.x', '0.15.x', '1.0.x', '1.1.x', '1.2.x', '1.3.x', '1.4.x', '1.5.x', '1.6.x', '1.7.x', 'latest'])) { + if (!\in_array($version, ['0.6.x', '0.7.x', '0.8.x', '0.9.x', '0.10.x', '0.11.x', '0.12.x', '0.13.x', '0.14.x', '0.15.x', '1.0.x', '1.1.x', '1.2.x', '1.3.x', '1.4.x', '1.5.x', '1.6.x', '1.7.x', '1.8.x', 'latest'])) { throw new \Exception('Unknown version given'); } @@ -251,7 +251,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ->setDiscord(APP_SOCIAL_DISCORD_CHANNEL, APP_SOCIAL_DISCORD) ->setDefaultHeaders([ 'X-Appwrite-Response-Format' => '1.7.0', - ]); + ]) + ->setExclude($language['exclude'] ?? []); // Make sure we have a clean slate. // Otherwise, all files in this dir will be pushed, @@ -271,6 +272,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND $gitUrl = 'git@github.com:aw-tests/' . $language['gitRepoName'] . '.git'; } + $repoBranch = $language['repoBranch'] ?? 'main'; if ($git && !empty($gitUrl)) { \exec('rm -rf ' . $target . ' && \ mkdir -p ' . $target . ' && \ @@ -278,8 +280,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND git init && \ git remote add origin ' . $gitUrl . ' && \ git fetch origin && \ - git checkout main || git checkout -b main && \ - git pull origin main && \ + git checkout ' . $repoBranch . ' || git checkout -b ' . $repoBranch . ' && \ + git pull origin ' . $repoBranch . ' && \ git checkout ' . $gitBranch . ' || git checkout -b ' . $gitBranch . ' && \ git fetch origin ' . $gitBranch . ' || git push -u origin ' . $gitBranch . ' && \ git pull origin ' . $gitBranch . ' && \ diff --git a/src/Appwrite/Platform/Tasks/SSL.php b/src/Appwrite/Platform/Tasks/SSL.php index ae1c93a360..651cb4de11 100644 --- a/src/Appwrite/Platform/Tasks/SSL.php +++ b/src/Appwrite/Platform/Tasks/SSL.php @@ -24,7 +24,7 @@ class SSL extends Action ->param('domain', System::getEnv('_APP_DOMAIN', ''), new Hostname(), 'Domain to generate certificate for. If empty, main domain will be used.', true) ->param('skip-check', true, new Boolean(true), 'If DNS and renew check should be skipped. Defaults to true, and when true, all jobs will result in certificate generation attempt.', true) ->inject('queueForCertificates') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $domain, bool|string $skipCheck, Certificate $queueForCertificates): void diff --git a/src/Appwrite/Platform/Tasks/ScheduleBase.php b/src/Appwrite/Platform/Tasks/ScheduleBase.php index 286ffe45cb..7686815868 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleBase.php +++ b/src/Appwrite/Platform/Tasks/ScheduleBase.php @@ -26,6 +26,7 @@ abstract class ScheduleBase extends Action protected array $schedules = []; protected BrokerPool $publisher; + protected ?BrokerPool $publisherRedis = null; private ?Histogram $collectSchedulesTelemetryDuration = null; private ?Gauge $collectSchedulesTelemetryCount = null; @@ -72,6 +73,13 @@ abstract class ScheduleBase extends Action Console::success(APP_NAME . ' ' . \ucfirst(static::getSupportedResource()) . ' scheduler v1 has started'); $this->publisher = new BrokerPool($pools->get('publisher')); + + try { + $this->publisherRedis = new BrokerPool($pools->get('publisherRedis')); + } catch (\Throwable) { + $this->publisherRedis = null; + } + $this->scheduleTelemetryCount = $telemetry->createGauge('task.schedule.count'); $this->collectSchedulesTelemetryDuration = $telemetry->createHistogram('task.schedule.collect_schedules.duration', 's'); $this->collectSchedulesTelemetryCount = $telemetry->createGauge('task.schedule.collect_schedules.count'); @@ -79,16 +87,16 @@ abstract class ScheduleBase extends Action // start with "0" to load all active documents. $lastSyncUpdate = "0"; - $this->collectSchedules($pools, $dbForPlatform, $getProjectDB, $lastSyncUpdate); + $this->collectSchedules($dbForPlatform, $getProjectDB, $lastSyncUpdate); Console::success("Starting timers at " . DateTime::now()); /** * The timer synchronize $schedules copy with database collection. */ - Timer::tick(static::UPDATE_TIMER * 1000, function () use ($pools, $dbForPlatform, $getProjectDB, &$lastSyncUpdate) { + Timer::tick(static::UPDATE_TIMER * 1000, function () use ($dbForPlatform, $getProjectDB, &$lastSyncUpdate) { $time = DateTime::now(); Console::log("Sync tick: Running at $time"); - $this->collectSchedules($pools, $dbForPlatform, $getProjectDB, $lastSyncUpdate); + $this->collectSchedules($dbForPlatform, $getProjectDB, $lastSyncUpdate); }); while (true) { @@ -103,7 +111,7 @@ abstract class ScheduleBase extends Action } } - private function collectSchedules(Group $pools, Database $dbForPlatform, callable $getProjectDB, string &$lastSyncUpdate): void + private function collectSchedules(Database $dbForPlatform, callable $getProjectDB, string &$lastSyncUpdate): void { // If we haven't synced yet, load all active schedules $initialLoad = $lastSyncUpdate === "0"; @@ -115,7 +123,7 @@ abstract class ScheduleBase extends Action * @throws Exception * @var Document $schedule */ - $getSchedule = function (Document $schedule) use ($pools, $dbForPlatform, $getProjectDB): array { + $getSchedule = function (Document $schedule) use ($dbForPlatform, $getProjectDB): array { $project = $dbForPlatform->getDocument('projects', $schedule->getAttribute('projectId')); $resource = $getProjectDB($project)->getDocument( @@ -124,7 +132,7 @@ abstract class ScheduleBase extends Action ); return [ - '$internalId' => $schedule->getInternalId(), + '$sequence' => $schedule->getSequence(), '$id' => $schedule->getId(), 'resourceId' => $schedule->getAttribute('resourceId'), 'schedule' => $schedule->getAttribute('schedule'), @@ -175,19 +183,19 @@ abstract class ScheduleBase extends Action $total = $total + $sum; foreach ($results as $document) { - $localDocument = $this->schedules[$document->getInternalId()] ?? null; + $localDocument = $this->schedules[$document->getSequence()] ?? null; if ($localDocument !== null) { if (!$document['active']) { Console::info("Removing: {$document['resourceType']}::{$document['resourceId']}"); - unset($this->schedules[$document->getInternalId()]); + unset($this->schedules[$document->getSequence()]); } elseif (strtotime($localDocument['resourceUpdatedAt']) !== strtotime($document['resourceUpdatedAt'])) { Console::info("Updating: {$document['resourceType']}::{$document['resourceId']}"); - $this->schedules[$document->getInternalId()] = $getSchedule($document); + $this->schedules[$document->getSequence()] = $getSchedule($document); } } else { try { - $this->schedules[$document->getInternalId()] = $getSchedule($document); + $this->schedules[$document->getSequence()] = $getSchedule($document); } catch (\Throwable $th) { $collectionId = static::getCollectionId(); Console::error("Failed to load schedule for project {$document['projectId']} {$collectionId} {$document['resourceId']}"); diff --git a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php index 6bf2f93afe..acb2dd3070 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php @@ -6,6 +6,7 @@ use Appwrite\Event\Func; use Swoole\Coroutine as Co; use Utopia\Database\Database; use Utopia\Pools\Group; +use Utopia\System\System; class ScheduleExecutions extends ScheduleBase { @@ -29,9 +30,16 @@ class ScheduleExecutions extends ScheduleBase protected function enqueueResources(Group $pools, Database $dbForPlatform, callable $getProjectDB): void { - $queueForFunctions = new Func($this->publisher); $intervalEnd = (new \DateTime())->modify('+' . self::ENQUEUE_TIMER . ' seconds'); + $isRedisFallback = \str_contains(System::getEnv('_APP_WORKER_REDIS_FALLBACK', ''), 'functions'); + + $queueForFunctions = new Func( + $isRedisFallback + ? $this->publisherRedis + : $this->publisher + ); + foreach ($this->schedules as $schedule) { if (!$schedule['active']) { $dbForPlatform->deleteDocument( @@ -39,7 +47,7 @@ class ScheduleExecutions extends ScheduleBase $schedule['$id'], ); - unset($this->schedules[$schedule['$internalId']]); + unset($this->schedules[$schedule['$sequence']]); continue; } @@ -81,7 +89,7 @@ class ScheduleExecutions extends ScheduleBase $schedule['$id'], ); - unset($this->schedules[$schedule['$internalId']]); + unset($this->schedules[$schedule['$sequence']]); } } } diff --git a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php index 19e068107a..7a3363d74d 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php @@ -8,6 +8,7 @@ use Utopia\CLI\Console; use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Pools\Group; +use Utopia\System\System; class ScheduleFunctions extends ScheduleBase { @@ -76,7 +77,7 @@ class ScheduleFunctions extends ScheduleBase } foreach ($delayedExecutions as $delay => $schedules) { - \go(function () use ($delay, $schedules, $pools, $dbForPlatform) { + \go(function () use ($delay, $schedules, $dbForPlatform) { \sleep($delay); // in seconds foreach ($schedules as $delayConfig) { @@ -90,7 +91,13 @@ class ScheduleFunctions extends ScheduleBase $this->updateProjectAccess($schedule['project'], $dbForPlatform); - $queueForFunctions = new Func($this->publisher); + $isRedisFallback = \str_contains(System::getEnv('_APP_WORKER_REDIS_FALLBACK', ''), 'functions'); + + $queueForFunctions = new Func( + $isRedisFallback + ? $this->publisherRedis + : $this->publisher + ); $queueForFunctions ->setType('schedule') diff --git a/src/Appwrite/Platform/Tasks/ScheduleMessages.php b/src/Appwrite/Platform/Tasks/ScheduleMessages.php index 5e65f7a8a6..af15f9583f 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleMessages.php +++ b/src/Appwrite/Platform/Tasks/ScheduleMessages.php @@ -40,7 +40,7 @@ class ScheduleMessages extends ScheduleBase continue; } - \go(function () use ($schedule, $scheduledAt, $pools, $dbForPlatform) { + \go(function () use ($schedule, $scheduledAt, $dbForPlatform) { $queueForMessaging = new Messaging($this->publisher); $this->updateProjectAccess($schedule['project'], $dbForPlatform); @@ -57,7 +57,7 @@ class ScheduleMessages extends ScheduleBase ); $this->recordEnqueueDelay($scheduledAt); - unset($this->schedules[$schedule['$internalId']]); + unset($this->schedules[$schedule['$sequence']]); }); } } diff --git a/src/Appwrite/Platform/Tasks/Screenshot.php b/src/Appwrite/Platform/Tasks/Screenshot.php index 3a9c9a64f5..5a4d8a76b7 100644 --- a/src/Appwrite/Platform/Tasks/Screenshot.php +++ b/src/Appwrite/Platform/Tasks/Screenshot.php @@ -21,7 +21,7 @@ class Screenshot extends Action $this ->desc('Create Site template screenshot') ->param('templateId', '', new Text(128), 'Template ID.') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $templateId): void diff --git a/src/Appwrite/Platform/Tasks/StatsResources.php b/src/Appwrite/Platform/Tasks/StatsResources.php index ca2a6860ff..b64dd61f86 100644 --- a/src/Appwrite/Platform/Tasks/StatsResources.php +++ b/src/Appwrite/Platform/Tasks/StatsResources.php @@ -45,7 +45,7 @@ class StatsResources extends Action ->inject('dbForPlatform') ->inject('logError') ->inject('queueForStatsResources') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(Database $dbForPlatform, callable $logError, EventStatsResources $queue): void @@ -53,11 +53,14 @@ class StatsResources extends Action $this->logError = $logError; $this->dbForPlatform = $dbForPlatform; + $this->disableSubqueries(); + Console::title("Stats resources V1"); Console::success('Stats resources: started'); $interval = (int) System::getEnv('_APP_STATS_RESOURCES_INTERVAL', '3600'); + Console::loop(function () use ($queue) { Authorization::disable(); Authorization::setDefaultStatus(false); @@ -73,7 +76,7 @@ class StatsResources extends Action $queue ->setProject($project) ->trigger(); - Console::success('project: ' . $project->getId() . '(' . $project->getInternalId() . ')' . ' queued'); + Console::success('project: ' . $project->getId() . '(' . $project->getSequence() . ')' . ' queued'); }); }, $interval); diff --git a/src/Appwrite/Platform/Tasks/Upgrade.php b/src/Appwrite/Platform/Tasks/Upgrade.php index dfd10d347e..d6159d2718 100644 --- a/src/Appwrite/Platform/Tasks/Upgrade.php +++ b/src/Appwrite/Platform/Tasks/Upgrade.php @@ -23,7 +23,7 @@ class Upgrade extends Install ->param('image', 'appwrite', new Text(0), 'Main appwrite docker image', true) ->param('interactive', 'Y', new Text(1), 'Run an interactive session', true) ->param('no-start', false, new Boolean(true), 'Run an interactive session', true) - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(string $httpPort, string $httpsPort, string $organization, string $image, string $interactive, bool $noStart): void diff --git a/src/Appwrite/Platform/Tasks/Vars.php b/src/Appwrite/Platform/Tasks/Vars.php index 70ae550ef9..542b5bdc9f 100644 --- a/src/Appwrite/Platform/Tasks/Vars.php +++ b/src/Appwrite/Platform/Tasks/Vars.php @@ -18,7 +18,7 @@ class Vars extends Action { $this ->desc('List all the server environment variables') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action(): void diff --git a/src/Appwrite/Platform/Workers/Audits.php b/src/Appwrite/Platform/Workers/Audits.php index 76309145b8..04b562a219 100644 --- a/src/Appwrite/Platform/Workers/Audits.php +++ b/src/Appwrite/Platform/Workers/Audits.php @@ -12,13 +12,13 @@ use Utopia\Database\Exception\Authorization; use Utopia\Database\Exception\Structure; use Utopia\Platform\Action; use Utopia\Queue\Message; +use Utopia\Queue\Result\Commit; +use Utopia\Queue\Result\NoCommit; use Utopia\System\System; class Audits extends Action { - protected const BATCH_SIZE_DEVELOPMENT = 1; // smaller batch size for development - protected const BATCH_SIZE_PRODUCTION = 5_000; - protected const BATCH_AGGREGATION_INTERVAL = 60; // in seconds + protected const int BATCH_AGGREGATION_INTERVAL = 60; // in seconds private int $lastTriggeredTime = 0; @@ -27,9 +27,7 @@ class Audits extends Action protected function getBatchSize(): int { - return System::getEnv('_APP_ENV', 'development') === 'development' - ? self::BATCH_SIZE_DEVELOPMENT - : self::BATCH_SIZE_PRODUCTION; + return intval(System::getEnv('_APP_QUEUE_PREFETCH_COUNT', 1)); } public static function getName(): string @@ -47,7 +45,7 @@ class Audits extends Action ->inject('message') ->inject('getProjectDB') ->inject('project') - ->callback([$this, 'action']); + ->callback($this->action(...)); $this->lastTriggeredTime = time(); } @@ -57,13 +55,13 @@ class Audits extends Action * @param Message $message * @param callable $getProjectDB * @param Document $project - * @return void + * @return Commit|NoCommit * @throws Throwable * @throws \Utopia\Database\Exception * @throws Authorization * @throws Structure */ - public function action(Message $message, callable $getProjectDB, Document $project): void + public function action(Message $message, callable $getProjectDB, Document $project): Commit|NoCommit { $payload = $message->getPayload() ?? []; @@ -91,7 +89,7 @@ class Audits extends Action // Create event data $eventData = [ - 'userId' => $user->getInternalId(), + 'userId' => $user->getSequence(), 'event' => $event, 'resource' => $resource, 'userAgent' => $userAgent, @@ -108,13 +106,13 @@ class Audits extends Action 'timestamp' => date("Y-m-d H:i:s", $message->getTimestamp()), ]; - if (isset($this->logs[$project->getInternalId()])) { - $this->logs[$project->getInternalId()]['logs'][] = $eventData; + if (isset($this->logs[$project->getSequence()])) { + $this->logs[$project->getSequence()]['logs'][] = $eventData; } else { - $this->logs[$project->getInternalId()] = [ + $this->logs[$project->getSequence()] = [ 'project' => new Document([ '$id' => $project->getId(), - '$internalId' => $project->getInternalId(), + '$sequence' => $project->getSequence(), 'database' => $project->getAttribute('database'), ]), 'logs' => [$eventData] @@ -123,29 +121,32 @@ class Audits extends Action // Check if we should process the batch by checking both for the batch size and the elapsed time $batchSize = $this->getBatchSize(); - $shouldProcessBatch = \count($this->logs) >= $batchSize; - if (!$shouldProcessBatch && \count($this->logs) > 0) { + $logCount = array_reduce($this->logs, fn (int $current, $logs) => $current + count($logs['logs']), 0); + $shouldProcessBatch = $logCount >= $batchSize; + if (!$shouldProcessBatch && $logCount > 0) { $shouldProcessBatch = (\time() - $this->lastTriggeredTime) >= self::BATCH_AGGREGATION_INTERVAL; } - if ($shouldProcessBatch) { - try { - foreach ($this->logs as $internalId => $projectLogs) { - $dbForProject = $getProjectDB($projectLogs['project']); - - Console::log('Processing batch with ' . count($projectLogs['logs']) . ' events'); - $audit = new Audit($dbForProject); - - $audit->logBatch($projectLogs['logs']); - Console::success('Audit logs processed successfully'); - - unset($this->logs[$internalId]); - } - } catch (Throwable $e) { - Console::error('Error processing audit logs: ' . $e->getMessage()); - } finally { - $this->lastTriggeredTime = time(); - } + if (!$shouldProcessBatch) { + return new NoCommit(); } + + try { + foreach ($this->logs as $sequence => $projectLogs) { + $dbForProject = $getProjectDB($projectLogs['project']); + + Console::log('Processing batch with ' . count($projectLogs['logs']) . ' events'); + $audit = new Audit($dbForProject); + + $audit->logBatch($projectLogs['logs']); + Console::success('Audit logs processed successfully'); + + unset($this->logs[$sequence]); + } + } catch (Throwable $e) { + Console::error('Error processing audit logs: ' . $e->getMessage()); + } + $this->lastTriggeredTime = time(); + return new Commit(); } } diff --git a/src/Appwrite/Platform/Workers/Certificates.php b/src/Appwrite/Platform/Workers/Certificates.php index 0dce51cb52..a9104e0017 100644 --- a/src/Appwrite/Platform/Workers/Certificates.php +++ b/src/Appwrite/Platform/Workers/Certificates.php @@ -255,7 +255,7 @@ class Certificates extends Action $certificate = new Document(\array_merge($certificateDocument->getArrayCopy(), $certificate->getArrayCopy())); $certificate = $dbForPlatform->updateDocument('certificates', $certificate->getId(), $certificate); } else { - $certificate->removeAttribute('$internalId'); + $certificate->removeAttribute('$sequence'); $certificate = $dbForPlatform->createDocument('certificates', $certificate); } diff --git a/src/Appwrite/Platform/Workers/Databases.php b/src/Appwrite/Platform/Workers/Databases.php index b2691b420e..896ec6d32d 100644 --- a/src/Appwrite/Platform/Workers/Databases.php +++ b/src/Appwrite/Platform/Workers/Databases.php @@ -38,7 +38,7 @@ class Databases extends Action ->inject('dbForProject') ->inject('queueForRealtime') ->inject('log') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** @@ -64,6 +64,14 @@ class Databases extends Action $document = new Document($payload['document'] ?? []); $database = new Document($payload['database'] ?? []); + Console::info("Processing database operation: \n" . \json_encode([ + 'type' => $type, + 'projectId' => $project->getId(), + 'databaseId' => $database->getId(), + 'collectionId' => $collection->getId(), + 'documentId' => $document->getId(), + ], JSON_PRETTY_PRINT)); + $log->addTag('projectId', $project->getId()); $log->addTag('type', $type); @@ -82,6 +90,14 @@ class Databases extends Action DATABASE_TYPE_DELETE_INDEX => $this->deleteIndex($database, $collection, $document, $project, $dbForPlatform, $dbForProject, $queueForRealtime), default => throw new Exception('No database operation for type: ' . \strval($type)), }; + + Console::info("Finished processing database operation: \n" . \json_encode([ + 'type' => $type, + 'projectId' => $project->getId(), + 'databaseId' => $database->getId(), + 'collectionId' => $collection->getId(), + 'documentId' => $document->getId(), + ], JSON_PRETTY_PRINT)); } /** @@ -116,6 +132,7 @@ class Databases extends Action $projectId = $project->getId(); $event = "databases.[databaseId].collections.[collectionId].attributes.[attributeId].update"; + /** * TODO @christyjacob4 verify if this is still the case * Fetch attribute from the database, since with Resque float values are loosing informations. @@ -147,15 +164,15 @@ class Databases extends Action try { switch ($type) { case Database::VAR_RELATIONSHIP: - $relatedCollection = $dbForProject->getDocument('database_' . $database->getInternalId(), $options['relatedCollection']); + $relatedCollection = $dbForProject->getDocument('database_' . $database->getSequence(), $options['relatedCollection']); if ($relatedCollection->isEmpty()) { throw new DatabaseException('Collection not found'); } if ( !$dbForProject->createRelationship( - collection: 'database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), - relatedCollection: 'database_' . $database->getInternalId() . '_collection_' . $relatedCollection->getInternalId(), + collection: 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), + relatedCollection: 'database_' . $database->getSequence() . '_collection_' . $relatedCollection->getSequence(), type: $options['relationType'], twoWay: $options['twoWay'], id: $key, @@ -167,12 +184,12 @@ class Databases extends Action } if ($options['twoWay']) { - $relatedAttribute = $dbForProject->getDocument('attributes', $database->getInternalId() . '_' . $relatedCollection->getInternalId() . '_' . $options['twoWayKey']); + $relatedAttribute = $dbForProject->getDocument('attributes', $database->getSequence() . '_' . $relatedCollection->getSequence() . '_' . $options['twoWayKey']); $dbForProject->updateDocument('attributes', $relatedAttribute->getId(), $relatedAttribute->setAttribute('status', 'available')); } break; default: - if (!$dbForProject->createAttribute('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $key, $type, $size, $required, $default, $signed, $array, $format, $formatOptions, $filters)) { + if (!$dbForProject->createAttribute('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $key, $type, $size, $required, $default, $signed, $array, $format, $formatOptions, $filters)) { throw new Exception('Failed to create Attribute'); } } @@ -207,10 +224,10 @@ class Databases extends Action $this->trigger($database, $collection, $project, $event, $queueForRealtime, $attribute); if (! $relatedCollection->isEmpty()) { - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $relatedCollection->getId()); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $relatedCollection->getId()); } - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); } } @@ -257,18 +274,18 @@ class Databases extends Action try { if ($type === Database::VAR_RELATIONSHIP) { if ($options['twoWay']) { - $relatedCollection = $dbForProject->getDocument('database_' . $database->getInternalId(), $options['relatedCollection']); + $relatedCollection = $dbForProject->getDocument('database_' . $database->getSequence(), $options['relatedCollection']); if ($relatedCollection->isEmpty()) { throw new DatabaseException('Collection not found'); } - $relatedAttribute = $dbForProject->getDocument('attributes', $database->getInternalId() . '_' . $relatedCollection->getInternalId() . '_' . $options['twoWayKey']); + $relatedAttribute = $dbForProject->getDocument('attributes', $database->getSequence() . '_' . $relatedCollection->getSequence() . '_' . $options['twoWayKey']); } - if (!$dbForProject->deleteRelationship('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $key)) { + if (!$dbForProject->deleteRelationship('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $key)) { $dbForProject->updateDocument('attributes', $relatedAttribute->getId(), $relatedAttribute->setAttribute('status', 'stuck')); throw new DatabaseException('Failed to delete Relationship'); } - } elseif (!$dbForProject->deleteAttribute('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $key)) { + } elseif (!$dbForProject->deleteAttribute('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $key)) { throw new DatabaseException('Failed to delete Attribute'); } @@ -365,10 +382,10 @@ class Databases extends Action } } } finally { - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); if (! $relatedCollection->isEmpty()) { - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $relatedCollection->getId()); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $relatedCollection->getId()); } } } @@ -408,7 +425,7 @@ class Databases extends Action $project = $dbForPlatform->getDocument('projects', $projectId); try { - if (!$dbForProject->createIndex('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $key, $type, $attributes, $lengths, $orders)) { + if (!$dbForProject->createIndex('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $key, $type, $attributes, $lengths, $orders)) { throw new DatabaseException('Failed to create Index'); } $dbForProject->updateDocument('indexes', $index->getId(), $index->setAttribute('status', 'available')); @@ -426,7 +443,7 @@ class Databases extends Action throw $e; } finally { $this->trigger($database, $collection, $project, $event, $queueForRealtime, null, $index); - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collectionId); } } @@ -461,7 +478,7 @@ class Databases extends Action $project = $dbForPlatform->getDocument('projects', $projectId); try { - if ($status !== 'failed' && !$dbForProject->deleteIndex('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $key)) { + if ($status !== 'failed' && !$dbForProject->deleteIndex('database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), $key)) { throw new DatabaseException('Failed to delete index'); } $dbForProject->deleteDocument('indexes', $index->getId()); @@ -482,7 +499,7 @@ class Databases extends Action } finally { $this->trigger($database, $collection, $project, $event, $queueForRealtime, null, $index); - $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collection->getId()); + $dbForProject->purgeCachedDocument('database_' . $database->getSequence(), $collection->getId()); } } @@ -495,11 +512,11 @@ class Databases extends Action */ protected function deleteDatabase(Document $database, Document $project, $dbForProject): void { - $this->deleteByGroup('database_' . $database->getInternalId(), [], $dbForProject, function ($collection) use ($database, $project, $dbForProject) { + $this->deleteByGroup('database_' . $database->getSequence(), [], $dbForProject, function ($collection) use ($database, $project, $dbForProject) { $this->deleteCollection($database, $collection, $project, $dbForProject); }); - $dbForProject->deleteCollection('database_' . $database->getInternalId()); + $dbForProject->deleteCollection('database_' . $database->getSequence()); } /** @@ -522,10 +539,10 @@ class Databases extends Action } $collectionId = $collection->getId(); - $collectionInternalId = $collection->getInternalId(); - $databaseInternalId = $database->getInternalId(); + $collectionInternalId = $collection->getSequence(); + $databaseInternalId = $database->getSequence(); - $dbForProject->deleteCollection('database_' . $databaseInternalId . '_collection_' . $collection->getInternalId()); + $dbForProject->deleteCollection('database_' . $databaseInternalId . '_collection_' . $collection->getSequence()); /** * Related collections relating to current collection diff --git a/src/Appwrite/Platform/Workers/Deletes.php b/src/Appwrite/Platform/Workers/Deletes.php index 43bc55583d..aa511c2209 100644 --- a/src/Appwrite/Platform/Workers/Deletes.php +++ b/src/Appwrite/Platform/Workers/Deletes.php @@ -34,7 +34,7 @@ use Utopia\System\System; class Deletes extends Action { - protected array $selects = ['$internalId', '$id', '$collection', '$permissions', '$updatedAt']; + protected array $selects = ['$sequence', '$id', '$collection', '$permissions', '$updatedAt']; public static function getName(): string { @@ -277,7 +277,7 @@ class Deletes extends Action $this->deleteByGroup( 'subscribers', [ - Query::equal('topicInternalId', [$topic->getInternalId()]), + Query::equal('topicInternalId', [$topic->getSequence()]), Query::orderAsc(), ], $getProjectDB($project) @@ -298,7 +298,7 @@ class Deletes extends Action private function deleteSessionTargets(Document $project, callable $getProjectDB, Document $session): void { - Targets::delete($getProjectDB($project), Query::equal('sessionInternalId', [$session->getInternalId()])); + Targets::delete($getProjectDB($project), Query::equal('sessionInternalId', [$session->getSequence()])); } /** @@ -434,7 +434,7 @@ class Deletes extends Action public function deleteMemberships(callable $getProjectDB, Document $document, Document $project): void { $dbForProject = $getProjectDB($project); - $teamInternalId = $document->getInternalId(); + $teamInternalId = $document->getSequence(); // Delete Memberships $this->deleteByGroup( @@ -466,7 +466,7 @@ class Deletes extends Action { $projects = $dbForPlatform->find('projects', [ - Query::equal('teamInternalId', [$document->getInternalId()]), + Query::equal('teamInternalId', [$document->getSequence()]), Query::equal('region', [System::getEnv('_APP_REGION', 'default')]) ]); @@ -495,9 +495,9 @@ class Deletes extends Action * @throws Authorization * @throws DatabaseException */ - private function deleteProject(Database $dbForPlatform, callable $getProjectDB, Device $deviceForFiles, Device $deviceForSites, Device $deviceForFunctions, Device $deviceForBuilds, Device $deviceForCache, CertificatesAdapter $certificates, Document $document): void + protected function deleteProject(Database $dbForPlatform, callable $getProjectDB, Device $deviceForFiles, Device $deviceForSites, Device $deviceForFunctions, Device $deviceForBuilds, Device $deviceForCache, CertificatesAdapter $certificates, Document $document): void { - $projectInternalId = $document->getInternalId(); + $projectInternalId = $document->getSequence(); $projectId = $document->getId(); try { @@ -637,7 +637,7 @@ class Deletes extends Action private function deleteUser(callable $getProjectDB, Document $document, Document $project): void { $userId = $document->getId(); - $userInternalId = $document->getInternalId(); + $userInternalId = $document->getSequence(); $dbForProject = $getProjectDB($project); // Delete all sessions of this user from the sessions table and update the sessions field of the user record @@ -769,7 +769,7 @@ class Deletes extends Action { $dbForProject = $getProjectDB($project); $siteId = $document->getId(); - $siteInternalId = $document->getInternalId(); + $siteInternalId = $document->getSequence(); /** * Delete rules for site @@ -779,7 +779,7 @@ class Deletes extends Action Query::equal('type', ['deployment']), Query::equal('deploymentResourceType', ['site']), Query::equal('deploymentResourceInternalId', [$siteInternalId]), - Query::equal('projectInternalId', [$project->getInternalId()]) + Query::equal('projectInternalId', [$project->getSequence()]) ], $dbForPlatform, function (Document $document) use ($dbForPlatform, $certificates) { $this->deleteRule($dbForPlatform, $document, $certificates); }); @@ -804,7 +804,7 @@ class Deletes extends Action Query::equal('resourceType', ['site']), Query::orderAsc() ], $dbForProject, function (Document $document) use ($project, $certificates, $deviceForSites, $deviceForBuilds, $deviceForFiles, $dbForPlatform, &$deploymentInternalIds) { - $deploymentInternalIds[] = $document->getInternalId(); + $deploymentInternalIds[] = $document->getSequence(); $deploymentIds[] = $document->getId(); $this->deleteBuildFiles($deviceForBuilds, $document); $this->deleteDeploymentFiles($deviceForSites, $document); @@ -827,7 +827,7 @@ class Deletes extends Action */ Console::info("Deleting VCS repositories and comments linked to site " . $siteId); $this->deleteByGroup('repositories', [ - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), Query::equal('resourceInternalId', [$siteInternalId]), Query::equal('resourceType', ['site']), ], $dbForPlatform, function (Document $document) use ($dbForPlatform) { @@ -855,7 +855,7 @@ class Deletes extends Action $projectId = $project->getId(); $dbForProject = $getProjectDB($project); $functionId = $document->getId(); - $functionInternalId = $document->getInternalId(); + $functionInternalId = $document->getSequence(); /** * Delete rules @@ -865,7 +865,7 @@ class Deletes extends Action Query::equal('type', ['deployment']), Query::equal('deploymentResourceType', ['function']), Query::equal('deploymentResourceInternalId', [$functionInternalId]), - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), Query::orderAsc() ], $dbForPlatform, function (Document $document) use ($project, $dbForPlatform, $certificates) { $this->deleteRule($dbForPlatform, $document, $certificates); @@ -892,7 +892,7 @@ class Deletes extends Action Query::equal('resourceType', ['function']), Query::orderAsc() ], $dbForProject, function (Document $document) use ($dbForPlatform, $project, $certificates, $deviceForFunctions, $deviceForBuilds, &$deploymentInternalIds) { - $deploymentInternalIds[] = $document->getInternalId(); + $deploymentInternalIds[] = $document->getSequence(); $this->deleteDeploymentFiles($deviceForFunctions, $document); $this->deleteBuildFiles($deviceForBuilds, $document); }); @@ -913,7 +913,7 @@ class Deletes extends Action */ Console::info("Deleting VCS repositories and comments linked to function " . $functionId); $this->deleteByGroup('repositories', [ - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), Query::equal('resourceInternalId', [$functionInternalId]), Query::equal('resourceType', ['function']), Query::orderAsc() @@ -957,7 +957,7 @@ class Deletes extends Action } foreach ($screenshotIds as $id) { - $file = ValidatorAuthorization::skip(fn () => $dbForPlatform->getDocument('bucket_' . $bucket->getInternalId(), $id)); + $file = ValidatorAuthorization::skip(fn () => $dbForPlatform->getDocument('bucket_' . $bucket->getSequence(), $id)); if ($file->isEmpty()) { Console::error('Failed to get deployment screenshot: ' . $id); @@ -1060,7 +1060,7 @@ class Deletes extends Action $projectId = $project->getId(); $dbForProject = $getProjectDB($project); $deploymentId = $document->getId(); - $deploymentInternalId = $document->getInternalId(); + $deploymentInternalId = $document->getSequence(); /** * Delete deployment files @@ -1089,7 +1089,7 @@ class Deletes extends Action Query::equal('trigger', ['deployment']), Query::equal('type', ['deployment']), Query::equal('deploymentInternalId', [$deploymentInternalId]), - Query::equal('projectInternalId', [$project->getInternalId()]) + Query::equal('projectInternalId', [$project->getSequence()]) ], $dbForPlatform, function (Document $document) use ($dbForPlatform, $certificates) { $this->deleteRule($dbForPlatform, $document, $certificates); }); @@ -1117,6 +1117,9 @@ class Deletes extends Action ): void { $start = \microtime(true); + $deleteBatchSize = Database::DELETE_BATCH_SIZE; + $deleteBatchSize = 500; // TODO: Set right value in DB library after investigation + /** * deleteDocuments uses a cursor, we need to add a unique order by field or use default */ @@ -1124,7 +1127,7 @@ class Deletes extends Action $count = $database->deleteDocuments( $collection, $queries, - Database::DELETE_BATCH_SIZE, + $deleteBatchSize, $callback ); } catch (Throwable $th) { @@ -1211,7 +1214,7 @@ class Deletes extends Action { $dbForProject = $getProjectDB($project); - $dbForProject->deleteCollection('bucket_' . $document->getInternalId()); + $dbForProject->deleteCollection('bucket_' . $document->getSequence()); $deviceForFiles->deletePath($document->getId()); } @@ -1229,7 +1232,7 @@ class Deletes extends Action $dbForProject = $getProjectDB($project); $this->listByGroup('functions', [ - Query::equal('installationInternalId', [$document->getInternalId()]) + Query::equal('installationInternalId', [$document->getSequence()]) ], $dbForProject, function ($function) use ($dbForProject, $dbForPlatform) { $dbForPlatform->deleteDocument('repositories', $function->getAttribute('repositoryId')); @@ -1260,7 +1263,7 @@ class Deletes extends Action $this->listByGroup( 'deployments', [ - Query::equal('resourceInternalId', [$function->getInternalId()]), + Query::equal('resourceInternalId', [$function->getSequence()]), Query::equal('resourceType', ['functions']), ], $getProjectDB($project), diff --git a/src/Appwrite/Platform/Workers/Functions.php b/src/Appwrite/Platform/Workers/Functions.php index c8c68a58ba..2c9ca16b0c 100644 --- a/src/Appwrite/Platform/Workers/Functions.php +++ b/src/Appwrite/Platform/Workers/Functions.php @@ -53,7 +53,7 @@ class Functions extends Action ->inject('log') ->inject('executor') ->inject('isResourceBlocked') - ->callback([$this, 'action']); + ->callback($this->action(...)); } public function action( @@ -280,7 +280,7 @@ class Functions extends Action $execution = new Document([ '$id' => $executionId, '$permissions' => $user->isEmpty() ? [] : [Permission::read(Role::user($user->getId()))], - 'resourceInternalId' => $function->getInternalId(), + 'resourceInternalId' => $function->getSequence(), 'resourceId' => $function->getId(), 'resourceType' => 'functions', 'deploymentInternalId' => '', @@ -420,10 +420,10 @@ class Functions extends Action $execution = new Document([ '$id' => $executionId, '$permissions' => $user->isEmpty() ? [] : [Permission::read(Role::user($user->getId()))], - 'resourceInternalId' => $function->getInternalId(), + 'resourceInternalId' => $function->getSequence(), 'resourceId' => $function->getId(), 'resourceType' => 'functions', - 'deploymentInternalId' => $deployment->getInternalId(), + 'deploymentInternalId' => $deployment->getSequence(), 'deploymentId' => $deployment->getId(), 'trigger' => $trigger, 'status' => 'processing', @@ -519,7 +519,9 @@ class Functions extends Action try { $version = $function->getAttribute('version', 'v2'); $command = $runtime['startCommand']; - $command = $version === 'v2' ? '' : 'cp /tmp/code.tar.gz /mnt/code/code.tar.gz && nohup helpers/start.sh "' . $command . '"'; + $source = $deployment->getAttribute('buildPath', ''); + $extension = str_ends_with($source, '.tar') ? 'tar' : 'tar.gz'; + $command = $version === 'v2' ? '' : "cp /tmp/code.$extension /mnt/code/code.$extension && nohup helpers/start.sh \"$command\""; $executionResponse = $executor->createExecution( projectId: $project->getId(), deploymentId: $deploymentId, @@ -527,7 +529,7 @@ class Functions extends Action variables: $vars, timeout: $function->getAttribute('timeout', 0), image: $runtime['image'], - source: $deployment->getAttribute('buildPath', ''), + source: $source, entrypoint: $deployment->getAttribute('entrypoint', ''), version: $version, path: $path, @@ -572,13 +574,13 @@ class Functions extends Action ->setProject($project) ->addMetric(METRIC_EXECUTIONS, 1) ->addMetric(str_replace(['{resourceType}'], [RESOURCE_TYPE_FUNCTIONS], METRIC_RESOURCE_TYPE_EXECUTIONS), 1) - ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS), 1) + ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS), 1) ->addMetric(METRIC_EXECUTIONS_COMPUTE, (int)($execution->getAttribute('duration') * 1000))// per project ->addMetric(str_replace(['{resourceType}'], [RESOURCE_TYPE_FUNCTIONS], METRIC_RESOURCE_TYPE_EXECUTIONS_COMPUTE), (int)($execution->getAttribute('duration') * 1000)) - ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE), (int)($execution->getAttribute('duration') * 1000)) + ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE), (int)($execution->getAttribute('duration') * 1000)) ->addMetric(METRIC_EXECUTIONS_MB_SECONDS, (int)(($spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT) * $execution->getAttribute('duration', 0) * ($spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT))) ->addMetric(str_replace(['{resourceType}'], [RESOURCE_TYPE_FUNCTIONS], METRIC_RESOURCE_TYPE_EXECUTIONS_MB_SECONDS), (int)(($spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT) * $execution->getAttribute('duration', 0) * ($spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT))) - ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS), (int)(($spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT) * $execution->getAttribute('duration', 0) * ($spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT))) + ->addMetric(str_replace(['{resourceType}', '{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS, $function->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_MB_SECONDS), (int)(($spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT) * $execution->getAttribute('duration', 0) * ($spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT))) ->trigger() ; } diff --git a/src/Appwrite/Platform/Workers/Mails.php b/src/Appwrite/Platform/Workers/Mails.php index 3a15182e51..4e8b5e085c 100644 --- a/src/Appwrite/Platform/Workers/Mails.php +++ b/src/Appwrite/Platform/Workers/Mails.php @@ -29,7 +29,7 @@ class Mails extends Action ->inject('message') ->inject('register') ->inject('log') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index 8491e91a6c..668993fdae 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -72,7 +72,7 @@ class Messaging extends Action ->inject('dbForProject') ->inject('deviceForFiles') ->inject('queueForStatsUsage') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** @@ -373,7 +373,7 @@ class Messaging extends Action throw new \Exception('Storage bucket with the requested ID could not be found'); } - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); if ($file->isEmpty()) { throw new \Exception('Storage file with the requested ID could not be found'); } @@ -426,7 +426,7 @@ class Messaging extends Action $credentials = $provider->getAttribute('credentials'); return match ($provider->getAttribute('provider')) { - 'mock' => new Mock('username', 'password'), + 'mock' => (new Mock('username', 'password'))->setEndpoint('http://request-catcher-sms:5000/'), 'twilio' => new Twilio( $credentials['accountSid'] ?? '', $credentials['authToken'] ?? '', @@ -558,7 +558,7 @@ class Messaging extends Action throw new \Exception('Storage bucket with the requested ID could not be found'); } - $file = $dbForProject->getDocument('bucket_' . $bucket->getInternalId(), $fileId); + $file = $dbForProject->getDocument('bucket_' . $bucket->getSequence(), $fileId); if ($file->isEmpty()) { throw new \Exception('Storage file with the requested ID could not be found'); } diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index b746365f20..807cf5ec9d 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -69,7 +69,7 @@ class Migrations extends Action ->inject('logError') ->inject('queueForRealtime') ->inject('deviceForImports') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** @@ -185,13 +185,33 @@ class Migrations extends Action */ protected function updateMigrationDocument(Document $migration, Document $project, Realtime $queueForRealtime): Document { + $errorMessages = []; + $clonedMigrationDocument = clone $migration; + + // we cannot use #sensitive because + // `errors` is nested which requires an override. + $errors = $clonedMigrationDocument->getAttribute('errors', []); + + foreach ($errors as $error) { + $decoded = json_decode($error, true); + + if (is_array($decoded) && isset($decoded['trace'])) { + unset($decoded['trace']); + $errorMessages[] = json_encode($decoded); + } + } + + // set the errors back without trace + $clonedMigrationDocument->setAttribute('errors', $errorMessages); + + /** Trigger Realtime Events */ $queueForRealtime ->setProject($project) ->setSubscribers(['console', $project->getId()]) ->setEvent('migrations.[migrationId].update') ->setParam('migrationId', $migration->getId()) - ->setPayload($migration->getArrayCopy()) + ->setPayload($clonedMigrationDocument->getArrayCopy(), ['options', 'credentials']) ->trigger(); return $this->dbForProject->updateDocument('migrations', $migration->getId(), $migration); @@ -279,19 +299,21 @@ class Migrations extends Action ); /** Start Transfer */ - $migration->setAttribute('stage', 'migrating'); - $this->updateMigrationDocument($migration, $projectDocument, $queueForRealtime); + if (empty($source->getErrors())) { + $migration->setAttribute('stage', 'migrating'); + $this->updateMigrationDocument($migration, $projectDocument, $queueForRealtime); - $transfer->run( - $migration->getAttribute('resources'), - function () use ($migration, $transfer, $projectDocument, $queueForRealtime) { - $migration->setAttribute('resourceData', json_encode($transfer->getCache())); - $migration->setAttribute('statusCounters', json_encode($transfer->getStatusCounters())); - $this->updateMigrationDocument($migration, $projectDocument, $queueForRealtime); - }, - $migration->getAttribute('resourceId'), - $migration->getAttribute('resourceType') - ); + $transfer->run( + $migration->getAttribute('resources'), + function () use ($migration, $transfer, $projectDocument, $queueForRealtime) { + $migration->setAttribute('resourceData', json_encode($transfer->getCache())); + $migration->setAttribute('statusCounters', json_encode($transfer->getStatusCounters())); + $this->updateMigrationDocument($migration, $projectDocument, $queueForRealtime); + }, + $migration->getAttribute('resourceId'), + $migration->getAttribute('resourceType') + ); + } $destination->shutDown(); $source->shutDown(); @@ -305,26 +327,13 @@ class Migrations extends Action $errorMessages = []; foreach ($sourceErrors as $error) { - $message = "Error occurred while fetching '{$error->getResourceName()}:{$error->getResourceId()}' from source with message: '{$error->getMessage()}'"; - if ($error->getPrevious()) { - $message .= " Message: ".$error->getPrevious()->getMessage() . " File: ".$error->getPrevious()->getFile() . " Line: ".$error->getPrevious()->getLine(); - } - - $errorMessages[] = $message; + $errorMessages[] = json_encode($error); } foreach ($destinationErrors as $error) { - $message = "Error occurred while pushing '{$error->getResourceName()}:{$error->getResourceId()}' to destination with message: '{$error->getMessage()}'"; - - if ($error->getPrevious()) { - $message .= " Message: ".$error->getPrevious()->getMessage() . " File: ".$error->getPrevious()->getFile() . " Line: ".$error->getPrevious()->getLine(); - } - - /** @var MigrationException $error */ - $errorMessages[] = $message; + $errorMessages[] = json_encode($error); } $migration->setAttribute('errors', $errorMessages); - $this->updateMigrationDocument($migration, $projectDocument, $queueForRealtime); return; } @@ -354,12 +363,10 @@ class Migrations extends Action $errorMessages = []; foreach ($sourceErrors as $error) { - /** @var MigrationException $error */ - $errorMessages[] = "Error occurred while fetching '{$error->getResourceName()}:{$error->getResourceId()}' from source with message '{$error->getMessage()}'"; + $errorMessages[] = json_encode($error); } foreach ($destinationErrors as $error) { - /** @var MigrationException $error */ - $errorMessages[] = "Error occurred while pushing '{$error->getResourceName()}:{$error->getResourceId()}' to destination with message '{$error->getMessage()}'"; + $errorMessages[] = json_encode($error); } $migration->setAttribute('errors', $errorMessages); @@ -368,7 +375,7 @@ class Migrations extends Action $this->updateMigrationDocument($migration, $projectDocument, $queueForRealtime); if ($migration->getAttribute('status', '') === 'failed') { - Console::error('Migration('.$migration->getInternalId().':'.$migration->getId().') failed, Project('.$this->project->getInternalId().':'.$this->project->getId().')'); + Console::error('Migration('.$migration->getSequence().':'.$migration->getId().') failed, Project('.$this->project->getSequence().':'.$this->project->getId().')'); if ($destination) { $destination->error(); diff --git a/src/Appwrite/Platform/Workers/StatsResources.php b/src/Appwrite/Platform/Workers/StatsResources.php index 19d1223d95..98c9d01a87 100644 --- a/src/Appwrite/Platform/Workers/StatsResources.php +++ b/src/Appwrite/Platform/Workers/StatsResources.php @@ -49,7 +49,7 @@ class StatsResources extends Action ->inject('getLogsDB') ->inject('dbForPlatform') ->inject('logError') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** @@ -80,7 +80,7 @@ class StatsResources extends Action $this->countForProject($dbForPlatform, $getLogsDB, $getProjectDB, $project); $endTime = microtime(true); $executionTime = $endTime - $startTime; - Console::info('Project: ' . $project->getId() . '(' . $project->getInternalId() . ') aggregated in ' . $executionTime .' seconds'); + Console::info('Project: ' . $project->getId() . '(' . $project->getSequence() . ') aggregated in ' . $executionTime .' seconds'); } protected function countForProject(Database $dbForPlatform, callable $getLogsDB, callable $getProjectDB, Document $project): void @@ -105,17 +105,17 @@ class StatsResources extends Action $region = $project->getAttribute('region'); $platforms = $dbForPlatform->count('platforms', [ - Query::equal('projectInternalId', [$project->getInternalId()]) + Query::equal('projectInternalId', [$project->getSequence()]) ]); $webhooks = $dbForPlatform->count('webhooks', [ - Query::equal('projectInternalId', [$project->getInternalId()]) + Query::equal('projectInternalId', [$project->getSequence()]) ]); $keys = $dbForPlatform->count('keys', [ - Query::equal('projectInternalId', [$project->getInternalId()]) + Query::equal('projectInternalId', [$project->getSequence()]) ]); $domains = $dbForPlatform->count('rules', [ - Query::equal('projectInternalId', [$project->getInternalId()]), + Query::equal('projectInternalId', [$project->getSequence()]), Query::equal('owner', ['']), ]); @@ -216,13 +216,13 @@ class StatsResources extends Action $totalFiles = 0; $totalStorage = 0; $this->foreachDocument($dbForProject, 'buckets', [], function ($bucket) use ($dbForProject, $dbForLogs, $region, &$totalFiles, &$totalStorage) { - $files = $dbForProject->count('bucket_' . $bucket->getInternalId()); + $files = $dbForProject->count('bucket_' . $bucket->getSequence()); - $metric = str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES); + $metric = str_replace('{bucketInternalId}', $bucket->getSequence(), METRIC_BUCKET_ID_FILES); $this->createStatsDocuments($region, $metric, $files); - $storage = $dbForProject->sum('bucket_' . $bucket->getInternalId(), 'sizeActual'); - $metric = str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES_STORAGE); + $storage = $dbForProject->sum('bucket_' . $bucket->getSequence(), 'sizeActual'); + $metric = str_replace('{bucketInternalId}', $bucket->getSequence(), METRIC_BUCKET_ID_FILES_STORAGE); $this->createStatsDocuments($region, $metric, $storage); $totalStorage += $storage; @@ -241,10 +241,10 @@ class StatsResources extends Action $totalImageTransformations = 0; $last30Days = (new \DateTime())->sub(\DateInterval::createFromDateString('30 days'))->format('Y-m-d 00:00:00'); $this->foreachDocument($dbForProject, 'buckets', [], function ($bucket) use ($dbForProject, $last30Days, $region, &$totalImageTransformations) { - $imageTransformations = $dbForProject->count('bucket_' . $bucket->getInternalId(), [ + $imageTransformations = $dbForProject->count('bucket_' . $bucket->getSequence(), [ Query::greaterThanEqual('transformedAt', $last30Days), ]); - $metric = str_replace('{bucketInternalId}', $bucket->getInternalId(), METRIC_BUCKET_ID_FILES_IMAGES_TRANSFORMED); + $metric = str_replace('{bucketInternalId}', $bucket->getSequence(), METRIC_BUCKET_ID_FILES_IMAGES_TRANSFORMED); $this->createStatsDocuments($region, $metric, $imageTransformations); $totalImageTransformations += $imageTransformations; }); @@ -260,9 +260,9 @@ class StatsResources extends Action $totalDatabaseStorage = 0; $this->foreachDocument($dbForProject, 'databases', [], function ($database) use ($dbForProject, $region, &$totalCollections, &$totalDocuments, &$totalDatabaseStorage) { - $collections = $dbForProject->count('database_' . $database->getInternalId()); + $collections = $dbForProject->count('database_' . $database->getSequence()); - $metric = str_replace('{databaseInternalId}', $database->getInternalId(), METRIC_DATABASE_ID_COLLECTIONS); + $metric = str_replace('{databaseInternalId}', $database->getSequence(), METRIC_DATABASE_ID_COLLECTIONS); $this->createStatsDocuments($region, $metric, $collections); [$documents, $storage] = $this->countForCollections($dbForProject, $database, $region); @@ -280,23 +280,23 @@ class StatsResources extends Action { $databaseDocuments = 0; $databaseStorage = 0; - $this->foreachDocument($dbForProject, 'database_' . $database->getInternalId(), [], function ($collection) use ($dbForProject, $database, $region, &$databaseStorage, &$databaseDocuments) { - $documents = $dbForProject->count('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId()); - $metric = str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS); + $this->foreachDocument($dbForProject, 'database_' . $database->getSequence(), [], function ($collection) use ($dbForProject, $database, $region, &$databaseStorage, &$databaseDocuments) { + $documents = $dbForProject->count('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); + $metric = str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getSequence(), $collection->getSequence()], METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS); $this->createStatsDocuments($region, $metric, $documents); $databaseDocuments += $documents; - $collectionStorage = $dbForProject->getSizeOfCollection('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId()); - $metric = str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getInternalId(), $collection->getInternalId()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE); + $collectionStorage = $dbForProject->getSizeOfCollection('database_' . $database->getSequence() . '_collection_' . $collection->getSequence()); + $metric = str_replace(['{databaseInternalId}', '{collectionInternalId}'], [$database->getSequence(), $collection->getSequence()], METRIC_DATABASE_ID_COLLECTION_ID_STORAGE); $this->createStatsDocuments($region, $metric, $collectionStorage); $databaseStorage += $collectionStorage; }); - $metric = str_replace(['{databaseInternalId}'], [$database->getInternalId()], METRIC_DATABASE_ID_DOCUMENTS); + $metric = str_replace(['{databaseInternalId}'], [$database->getSequence()], METRIC_DATABASE_ID_DOCUMENTS); $this->createStatsDocuments($region, $metric, $databaseDocuments); - $metric = str_replace(['{databaseInternalId}'], [$database->getInternalId()], METRIC_DATABASE_ID_STORAGE); + $metric = str_replace(['{databaseInternalId}'], [$database->getSequence()], METRIC_DATABASE_ID_STORAGE); $this->createStatsDocuments($region, $metric, $databaseStorage); return [$databaseDocuments, $databaseStorage]; @@ -337,33 +337,33 @@ class StatsResources extends Action $this->foreachDocument($dbForProject, 'functions', [], function (Document $function) use ($dbForProject, $region) { $functionDeploymentsStorage = $dbForProject->sum('deployments', 'sourceSize', [ - Query::equal('resourceInternalId', [$function->getInternalId()]), + Query::equal('resourceInternalId', [$function->getSequence()]), Query::equal('resourceType', [RESOURCE_TYPE_FUNCTIONS]), ]); - $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS,$function->getInternalId()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS_STORAGE), $functionDeploymentsStorage); + $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS,$function->getSequence()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS_STORAGE), $functionDeploymentsStorage); $functionDeployments = $dbForProject->count('deployments', [ - Query::equal('resourceInternalId', [$function->getInternalId()]), + Query::equal('resourceInternalId', [$function->getSequence()]), Query::equal('resourceType', [RESOURCE_TYPE_FUNCTIONS]), ]); - $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS,$function->getInternalId()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS), $functionDeployments); + $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS,$function->getSequence()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS), $functionDeployments); /** * As deployments and builds have 1-1 relationship, * the count for one should match the other */ - $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS,$function->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS), $functionDeployments); + $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS,$function->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS), $functionDeployments); $functionBuildsStorage = 0; $this->foreachDocument($dbForProject, 'deployments', [ - Query::equal('resourceInternalId', [$function->getInternalId()]), + Query::equal('resourceInternalId', [$function->getSequence()]), Query::equal('resourceType', [RESOURCE_TYPE_FUNCTIONS]), ], function (Document $deployment) use (&$functionBuildsStorage): void { $functionBuildsStorage += $deployment->getAttribute('buildSize', 0); }); - $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS,$function->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE), $functionBuildsStorage); + $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_FUNCTIONS,$function->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE), $functionBuildsStorage); }); } @@ -387,29 +387,29 @@ class StatsResources extends Action $this->foreachDocument($dbForProject, 'sites', [], function (Document $site) use ($dbForProject, $region) { $siteDeploymentsStorage = $dbForProject->sum('deployments', 'sourceSize', [ - Query::equal('resourceInternalId', [$site->getInternalId()]), + Query::equal('resourceInternalId', [$site->getSequence()]), Query::equal('resourceType', [RESOURCE_TYPE_SITES]), ]); - $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_SITES,$site->getInternalId()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS_STORAGE), $siteDeploymentsStorage); + $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_SITES,$site->getSequence()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS_STORAGE), $siteDeploymentsStorage); $siteDeployments = $dbForProject->count('deployments', [ - Query::equal('resourceInternalId', [$site->getInternalId()]), + Query::equal('resourceInternalId', [$site->getSequence()]), Query::equal('resourceType', [RESOURCE_TYPE_SITES]), ]); - $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_SITES,$site->getInternalId()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS), $siteDeployments); + $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_SITES,$site->getSequence()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS), $siteDeployments); /** * As deployments and builds have 1-1 relationship, * the count for one should match the other */ - $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_SITES,$site->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS), $siteDeployments); + $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_SITES,$site->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS), $siteDeployments); $siteBuildsStorage = $dbForProject->sum('deployments', 'buildSize', [ - Query::equal('resourceInternalId', [$site->getInternalId()]), + Query::equal('resourceInternalId', [$site->getSequence()]), Query::equal('resourceType', [RESOURCE_TYPE_SITES]), ]); - $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_SITES,$site->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE), $siteBuildsStorage); + $this->createStatsDocuments($region, str_replace(['{resourceType}','{resourceInternalId}'], [RESOURCE_TYPE_SITES,$site->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE), $siteBuildsStorage); }); } @@ -437,6 +437,6 @@ class StatsResources extends Action $this->documents ); $this->documents = []; - Console::success('Stats written to logs db for project: ' . $project->getId() . '(' . $project->getInternalId() . ')'); + Console::success('Stats written to logs db for project: ' . $project->getId() . '(' . $project->getSequence() . ')'); } } diff --git a/src/Appwrite/Platform/Workers/StatsUsage.php b/src/Appwrite/Platform/Workers/StatsUsage.php index 25c80fabdc..3610381d5a 100644 --- a/src/Appwrite/Platform/Workers/StatsUsage.php +++ b/src/Appwrite/Platform/Workers/StatsUsage.php @@ -119,7 +119,7 @@ class StatsUsage extends Action ->inject('getProjectDB') ->inject('getLogsDB') ->inject('register') - ->callback([$this, 'action']); + ->callback($this->action(...)); $this->lastTriggeredTime = time(); } @@ -145,7 +145,7 @@ class StatsUsage extends Action $aggregationInterval = (int) System::getEnv('_APP_USAGE_AGGREGATION_INTERVAL', '20'); $project = new Document($payload['project'] ?? []); - $projectId = $project->getInternalId(); + $projectId = $project->getSequence(); foreach ($payload['reduce'] ?? [] as $document) { if (empty($document)) { continue; @@ -211,8 +211,8 @@ class StatsUsage extends Action } break; case $document->getCollection() === 'databases': // databases - $collections = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{databaseInternalId}', $document->getInternalId(), METRIC_DATABASE_ID_COLLECTIONS))); - $documents = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{databaseInternalId}', $document->getInternalId(), METRIC_DATABASE_ID_DOCUMENTS))); + $collections = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{databaseInternalId}', $document->getSequence(), METRIC_DATABASE_ID_COLLECTIONS))); + $documents = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{databaseInternalId}', $document->getSequence(), METRIC_DATABASE_ID_DOCUMENTS))); if (!empty($collections['value'])) { $metrics[] = [ 'key' => METRIC_COLLECTIONS, @@ -232,7 +232,7 @@ class StatsUsage extends Action $databaseInternalId = $parts[1] ?? 0; $documents = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace( ['{databaseInternalId}', '{collectionInternalId}'], - [$databaseInternalId, $document->getInternalId()], + [$databaseInternalId, $document->getSequence()], METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS ))); @@ -249,8 +249,8 @@ class StatsUsage extends Action break; case $document->getCollection() === 'buckets': - $files = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{bucketInternalId}', $document->getInternalId(), METRIC_BUCKET_ID_FILES))); - $storage = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{bucketInternalId}', $document->getInternalId(), METRIC_BUCKET_ID_FILES_STORAGE))); + $files = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{bucketInternalId}', $document->getSequence(), METRIC_BUCKET_ID_FILES))); + $storage = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace('{bucketInternalId}', $document->getSequence(), METRIC_BUCKET_ID_FILES_STORAGE))); if (!empty($files['value'])) { $metrics[] = [ @@ -268,13 +268,13 @@ class StatsUsage extends Action break; case $document->getCollection() === 'functions' || $document->getCollection() === 'sites': - $deployments = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace(['{resourceType}', '{resourceInternalId}'], [$document->getCollection(), $document->getInternalId()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS))); - $deploymentsStorage = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace(['{resourceType}', '{resourceInternalId}'], [$document->getCollection(), $document->getInternalId()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS_STORAGE))); - $builds = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace(['{resourceType}', '{resourceInternalId}'], [$document->getCollection(), $document->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS))); - $buildsStorage = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace(['{resourceType}', '{resourceInternalId}'], [$document->getCollection(), $document->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE))); - $buildsCompute = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace(['{resourceType}', '{resourceInternalId}'], [$document->getCollection(), $document->getInternalId()], METRIC_RESOURCE_TYPE_ID_BUILDS_COMPUTE))); - $executions = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace(['{resourceType}', '{resourceInternalId}'], [$document->getCollection(), $document->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS))); - $executionsCompute = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace(['{resourceType}', '{resourceInternalId}'], [$document->getCollection(), $document->getInternalId()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE))); + $deployments = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace(['{resourceType}', '{resourceInternalId}'], [$document->getCollection(), $document->getSequence()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS))); + $deploymentsStorage = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace(['{resourceType}', '{resourceInternalId}'], [$document->getCollection(), $document->getSequence()], METRIC_RESOURCE_TYPE_ID_DEPLOYMENTS_STORAGE))); + $builds = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace(['{resourceType}', '{resourceInternalId}'], [$document->getCollection(), $document->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS))); + $buildsStorage = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace(['{resourceType}', '{resourceInternalId}'], [$document->getCollection(), $document->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_STORAGE))); + $buildsCompute = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace(['{resourceType}', '{resourceInternalId}'], [$document->getCollection(), $document->getSequence()], METRIC_RESOURCE_TYPE_ID_BUILDS_COMPUTE))); + $executions = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace(['{resourceType}', '{resourceInternalId}'], [$document->getCollection(), $document->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS))); + $executionsCompute = $dbForProject->getDocument('stats', md5(self::INFINITY_PERIOD . str_replace(['{resourceType}', '{resourceInternalId}'], [$document->getCollection(), $document->getSequence()], METRIC_RESOURCE_TYPE_ID_EXECUTIONS_COMPUTE))); if (!empty($deployments['value'])) { $metrics[] = [ @@ -357,7 +357,7 @@ class StatsUsage extends Action break; } } catch (Throwable $e) { - Console::error("[reducer] " . " {DateTime::now()} " . " {$project->getInternalId()} " . " {$e->getMessage()}"); + Console::error("[reducer] " . " {DateTime::now()} " . " {$project->getSequence()} " . " {$e->getMessage()}"); } } @@ -376,7 +376,7 @@ class StatsUsage extends Action continue; } - Console::log('['.DateTime::now().'] Id: '.$project->getId(). ' InternalId: '.$project->getInternalId(). ' Db: '.$project->getAttribute('database').' ReceivedAt: '.$receivedAt. ' Keys: '.$numberOfKeys); + Console::log('['.DateTime::now().'] Id: '.$project->getId(). ' InternalId: '.$project->getSequence(). ' Db: '.$project->getAttribute('database').' ReceivedAt: '.$receivedAt. ' Keys: '.$numberOfKeys); try { foreach ($stats['keys'] ?? [] as $key => $value) { @@ -402,23 +402,23 @@ class StatsUsage extends Action ]); - $this->projects[$project->getInternalId()]['project'] = new Document([ + $this->projects[$project->getSequence()]['project'] = new Document([ '$id' => $project->getId(), - '$internalId' => $project->getInternalId(), + '$sequence' => $project->getSequence(), 'database' => $project->getAttribute('database'), ]); - $this->projects[$project->getInternalId()]['stats'][] = $document; + $this->projects[$project->getSequence()]['stats'][] = $document; $this->prepareForLogsDB($project, $document); } } } catch (Exception $e) { - Console::error('[' . DateTime::now() . '] project [' . $project->getInternalId() . '] database [' . $project['database'] . '] ' . ' ' . $e->getMessage()); + Console::error('[' . DateTime::now() . '] project [' . $project->getSequence() . '] database [' . $project['database'] . '] ' . ' ' . $e->getMessage()); } } - foreach ($this->projects as $internalId => $projectStats) { - if (empty($internalId)) { + foreach ($this->projects as $sequence => $projectStats) { + if (empty($sequence)) { continue; } try { @@ -427,7 +427,7 @@ class StatsUsage extends Action $dbForProject->createOrUpdateDocumentsWithIncrease('stats', 'value', $projectStats['stats']); Console::success('Batch successfully written to DB'); - unset($this->projects[$internalId]); + unset($this->projects[$sequence]); } catch (Throwable $e) { Console::error('Error processing stats: ' . $e->getMessage()); } @@ -451,7 +451,7 @@ class StatsUsage extends Action } } $documentClone = clone $stat; - $documentClone->setAttribute('$tenant', (int) $project->getInternalId()); + $documentClone->setAttribute('$tenant', (int) $project->getSequence()); $this->statDocuments[] = $documentClone; } diff --git a/src/Appwrite/Platform/Workers/StatsUsageDump.php b/src/Appwrite/Platform/Workers/StatsUsageDump.php deleted file mode 100644 index 77ec3f13e6..0000000000 --- a/src/Appwrite/Platform/Workers/StatsUsageDump.php +++ /dev/null @@ -1,206 +0,0 @@ -<?php - -namespace Appwrite\Platform\Workers; - -use Appwrite\Extend\Exception; -use Utopia\CLI\Console; -use Utopia\Database\DateTime; -use Utopia\Database\Document; -use Utopia\Platform\Action; -use Utopia\Queue\Message; -use Utopia\Registry\Registry; -use Utopia\System\System; - -/** - * TODO remove later - */ -class StatsUsageDump extends Action -{ - public const METRIC_COLLECTION_LEVEL_STORAGE = 4; - public const METRIC_DATABASE_LEVEL_STORAGE = 3; - public const METRIC_PROJECT_LEVEL_STORAGE = 2; - protected array $stats = []; - - protected Registry $register; - - /** - * Metrics to skip writing to logsDB - * As these metrics are calculated separately - * by logs DB - * @var array - */ - protected array $skipBaseMetrics = [ - METRIC_DATABASES => true, - METRIC_BUCKETS => true, - METRIC_USERS => true, - METRIC_FUNCTIONS => true, - METRIC_TEAMS => true, - METRIC_MESSAGES => true, - METRIC_MAU => true, - METRIC_WEBHOOKS => true, - METRIC_PLATFORMS => true, - METRIC_PROVIDERS => true, - METRIC_TOPICS => true, - METRIC_KEYS => true, - METRIC_FILES => true, - METRIC_FILES_STORAGE => true, - METRIC_DEPLOYMENTS_STORAGE => true, - METRIC_BUILDS_STORAGE => true, - METRIC_DEPLOYMENTS => true, - METRIC_BUILDS => true, - METRIC_COLLECTIONS => true, - METRIC_DOCUMENTS => true, - METRIC_DATABASES_STORAGE => true, - ]; - - /** - * Skip metrics associated with parent IDs - * these need to be checked individually with `str_ends_with` - */ - protected array $skipParentIdMetrics = [ - '.files', - '.files.storage', - '.collections', - '.documents', - '.deployments', - '.deployments.storage', - '.builds', - '.builds.storage', - '.databases.storage' - ]; - - /** - * @var callable(Document): Database - */ - protected $getLogsDB; - - protected array $periods = [ - '1h' => 'Y-m-d H:00', - '1d' => 'Y-m-d 00:00', - 'inf' => '0000-00-00 00:00' - ]; - - public static function getName(): string - { - return 'stats-usage-dump'; - } - - /** - * @throws \Exception - */ - public function __construct() - { - $this - ->inject('message') - ->inject('getProjectDB') - ->inject('getLogsDB') - ->inject('register') - ->callback([$this, 'action']); - } - - /** - * @param Message $message - * @param callable $getProjectDB - * @param callable $getLogsDB - * @param Registry $register - * @return void - * @throws Exception - * @throws \Throwable - * @throws \Utopia\Database\Exception - */ - public function action(Message $message, callable $getProjectDB, callable $getLogsDB, Registry $register): void - { - $this->getLogsDB = $getLogsDB; - $this->register = $register; - $payload = $message->getPayload() ?? []; - if (empty($payload)) { - throw new Exception('Missing payload'); - } - - foreach ($payload['stats'] ?? [] as $stats) { - $project = new Document($stats['project'] ?? []); - - $numberOfKeys = !empty($stats['keys']) ? count($stats['keys']) : 0; - $receivedAt = $stats['receivedAt'] ?? null; - if ($numberOfKeys === 0) { - continue; - } - - Console::log('['.DateTime::now().'] Id: '.$project->getId(). ' InternalId: '.$project->getInternalId(). ' Db: '.$project->getAttribute('database').' ReceivedAt: '.$receivedAt. ' Keys: '.$numberOfKeys); - - try { - /** @var Database $dbForProject */ - $dbForProject = $getProjectDB($project); - foreach ($stats['keys'] ?? [] as $key => $value) { - if ($value == 0) { - continue; - } - - if (str_contains($key, METRIC_DATABASES_STORAGE)) { - continue; - } - - foreach ($this->periods as $period => $format) { - $time = null; - - if ($period !== 'inf') { - $time = !empty($receivedAt) ? (new \DateTime($receivedAt))->format($format) : date($format, time()); - } - $id = \md5("{$time}_{$period}_{$key}"); - - $document = new Document([ - '$id' => $id, - 'period' => $period, - 'time' => $time, - 'metric' => $key, - 'value' => $value, - 'region' => System::getEnv('_APP_REGION', 'default'), - ]); - - $documentClone = clone $document; - - $dbForProject->createOrUpdateDocumentsWithIncrease( - 'stats', - 'value', - [$document] - ); - - $this->writeToLogsDB($project, $documentClone); - } - } - } catch (\Exception $e) { - Console::error('[' . DateTime::now() . '] project [' . $project->getInternalId() . '] database [' . $project['database'] . '] ' . ' ' . $e->getMessage()); - } - } - } - - protected function writeToLogsDB(Document $project, Document $document): void - { - if (System::getEnv('_APP_STATS_USAGE_DUAL_WRITING', 'disabled') === 'disabled') { - Console::log('Dual Writing is disabled. Skipping...'); - return; - } - - if (array_key_exists($document->getAttribute('metric'), $this->skipBaseMetrics)) { - return; - } - foreach ($this->skipParentIdMetrics as $skipMetric) { - if (str_ends_with($document->getAttribute('metric'), $skipMetric)) { - return; - } - } - - $dbForLogs = ($this->getLogsDB)($project); - - try { - $dbForLogs->createOrUpdateDocumentsWithIncrease( - 'stats', - 'value', - [$document] - ); - Console::success('Usage logs pushed to Logs DB'); - } catch (\Throwable $th) { - Console::error($th->getMessage()); - } - } -} diff --git a/src/Appwrite/Platform/Workers/Webhooks.php b/src/Appwrite/Platform/Workers/Webhooks.php index ada4d6faaa..3ffc3f0aad 100644 --- a/src/Appwrite/Platform/Workers/Webhooks.php +++ b/src/Appwrite/Platform/Workers/Webhooks.php @@ -38,7 +38,7 @@ class Webhooks extends Action ->inject('queueForStatsUsage') ->inject('log') ->inject('plan') - ->callback([$this, 'action']); + ->callback($this->action(...)); } /** @@ -176,7 +176,7 @@ class Webhooks extends Action $this->errors[] = $logs; $queueForStatsUsage ->addMetric(METRIC_WEBHOOKS_FAILED, 1) - ->addMetric(str_replace('{webhookInternalId}', $webhook->getInternalId(), METRIC_WEBHOOK_ID_FAILED), 1) + ->addMetric(str_replace('{webhookInternalId}', $webhook->getSequence(), METRIC_WEBHOOK_ID_FAILED), 1) ; @@ -186,7 +186,7 @@ class Webhooks extends Action $dbForPlatform->purgeCachedDocument('projects', $project->getId()); $queueForStatsUsage ->addMetric(METRIC_WEBHOOKS_SENT, 1) - ->addMetric(str_replace('{webhookInternalId}', $webhook->getInternalId(), METRIC_WEBHOOK_ID_SENT), 1) + ->addMetric(str_replace('{webhookInternalId}', $webhook->getSequence(), METRIC_WEBHOOK_ID_SENT), 1) ; } @@ -219,6 +219,7 @@ class Webhooks extends Action ]); $projectId = $project->getId(); + $region = $project->getAttribute('region', 'default'); $webhookId = $webhook->getId(); $template = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-webhook-failed.tpl'); @@ -227,7 +228,7 @@ class Webhooks extends Action $template->setParam('{{project}}', $project->getAttribute('name')); $template->setParam('{{url}}', $webhook->getAttribute('url')); $template->setParam('{{error}}', $curlError ?? 'The server returned ' . $statusCode . ' status code'); - $template->setParam('{{path}}', "/console/project-$projectId/settings/webhooks/$webhookId"); + $template->setParam('{{path}}', "/console/project-$region-$projectId/settings/webhooks/$webhookId"); $template->setParam('{{attempts}}', $attempts); $template->setParam('{{logoUrl}}', $plan['logoUrl'] ?? APP_EMAIL_LOGO_URL); diff --git a/src/Appwrite/SDK/Specification/Format.php b/src/Appwrite/SDK/Specification/Format.php index 8dbccf5cbb..af3b5c017e 100644 --- a/src/Appwrite/SDK/Specification/Format.php +++ b/src/Appwrite/SDK/Specification/Format.php @@ -113,6 +113,16 @@ abstract class Format protected function getEnumName(string $service, string $method, string $param): ?string { switch ($service) { + case 'proxy': + switch ($method) { + case 'createRedirectRule': + switch ($param) { + case 'resourceType': + return 'ProxyResourceType'; + } + break; + } + break; case 'console': switch ($method) { case 'getResource': @@ -441,7 +451,13 @@ abstract class Format case 'proxy': switch ($method) { case 'createRedirectRule': - return ['Moved Permanently 301', 'Found 302', 'Temporary Redirect 307', 'Permanent Redirect 308']; + switch ($param) { + case 'statusCode': + return ['Moved Permanently 301', 'Found 302', 'Temporary Redirect 307', 'Permanent Redirect 308']; + case 'resourceType': + return ['Site', 'Function']; + } + break; } break; case 'functions': diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index 19742ee3ee..1bde6d330f 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -360,6 +360,7 @@ class OpenAPI3 extends Format break; case 'Utopia\Validator\Host': case 'Utopia\Validator\URL': + case 'Appwrite\Network\Validator\Redirect': $node['schema']['type'] = $validator->getType(); $node['schema']['format'] = 'url'; $node['schema']['x-example'] = 'https://example.com'; @@ -444,11 +445,11 @@ class OpenAPI3 extends Format $node['schema']['format'] = $validator->getType() == Validator::TYPE_INTEGER ? 'int32' : 'float'; $node['schema']['x-example'] = $validator->getMin(); break; - case 'Utopia\Validator\Numeric': case 'Utopia\Validator\Integer': $node['schema']['type'] = $validator->getType(); $node['schema']['format'] = 'int32'; break; + case 'Utopia\Validator\Numeric': case 'Utopia\Validator\FloatValidator': $node['schema']['type'] = 'number'; $node['schema']['format'] = 'float'; diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index bac483ffee..b17d400b48 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -141,6 +141,7 @@ class Swagger2 extends Format $sdkPlatforms[] = APP_PLATFORM_CLIENT; } + $sdkPlatforms = array_values(array_unique($sdkPlatforms)); $namespace = $sdk->getNamespace() ?? 'default'; $desc ??= ''; @@ -384,6 +385,7 @@ class Swagger2 extends Format break; case 'Utopia\Validator\Host': case 'Utopia\Validator\URL': + case 'Appwrite\Network\Validator\Redirect': $node['type'] = $validator->getType(); $node['format'] = 'url'; $node['x-example'] = 'https://example.com'; @@ -453,11 +455,11 @@ class Swagger2 extends Format $node['format'] = $validator->getType() == Validator::TYPE_INTEGER ? 'int32' : 'float'; $node['x-example'] = $validator->getMin(); break; - case 'Utopia\Validator\Numeric': case 'Utopia\Validator\Integer': $node['type'] = $validator->getType(); $node['format'] = 'int32'; break; + case 'Utopia\Validator\Numeric': case 'Utopia\Validator\FloatValidator': $node['type'] = 'number'; $node['format'] = 'float'; diff --git a/src/Appwrite/URL/URL.php b/src/Appwrite/URL/URL.php index 98250ab429..49e95929e7 100644 --- a/src/Appwrite/URL/URL.php +++ b/src/Appwrite/URL/URL.php @@ -26,7 +26,20 @@ class URL 'fragment' => '', ]; - return \array_merge($default, \parse_url($url)); + $parsed = \parse_url($url); + if (is_array($parsed)) { + return \array_merge($default, $parsed); + } + + // see if $url is just a scheme + if (preg_match('/^([a-z][a-z0-9+.-]*):/i', $url, $matches)) { + $scheme = $matches[1]; + return \array_merge($default, [ + 'scheme' => $scheme + ]); + } + + throw new \InvalidArgumentException('Invalid URL: ' . $url); } /** @@ -55,9 +68,9 @@ class URL $parts['user'] = isset($url['user']) ? $url['user'] : ''; - $parts['pass'] = isset($url['pass']) ? ':' . $url['pass'] : ''; + $parts['pass'] = !empty($url['pass']) ? ':' . $url['pass'] : ''; - $parts['pass'] = ($parts['user'] || $parts['pass']) ? $parts['pass'] . '@' : ''; + $parts['pass'] = ($parts['user'] || !empty($parts['pass'])) ? $parts['pass'] . '@' : ''; $parts['path'] = isset($url['path']) ? $url['path'] : ''; diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/Base.php b/src/Appwrite/Utopia/Database/Validator/Queries/Base.php index e8eafba5a0..1c5dec44dd 100644 --- a/src/Appwrite/Utopia/Database/Validator/Queries/Base.php +++ b/src/Appwrite/Utopia/Database/Validator/Queries/Base.php @@ -25,7 +25,7 @@ class Base extends Queries { $config = Config::getParam('collections', []); - $collections = array_merge( + $collections = \array_merge( $config['projects'], $config['buckets'], $config['databases'], @@ -34,7 +34,7 @@ class Base extends Queries ); $collection = $collections[$collection]; - // array for constant lookup time + $allowedAttributesLookup = []; foreach ($allowedAttributes as $attribute) { $allowedAttributesLookup[$attribute] = true; @@ -70,10 +70,9 @@ class Base extends Queries 'type' => Database::VAR_DATETIME, 'array' => false, ]); - - $internalId = new Document([ - 'key' => '$internalId', - 'type' => Database::VAR_STRING, + $attributes[] = new Document([ + 'key' => '$sequence', + 'type' => Database::VAR_INTEGER, 'array' => false, ]); @@ -82,7 +81,7 @@ class Base extends Queries new Offset(), new Cursor(), new Filter($attributes, APP_DATABASE_QUERY_MAX_VALUES), - new Order([...$attributes, $internalId]), + new Order($attributes), ]; parent::__construct($validators); diff --git a/src/Appwrite/Utopia/Response/Model/Document.php b/src/Appwrite/Utopia/Response/Model/Document.php index 41a10cee89..d43ab0d1e6 100644 --- a/src/Appwrite/Utopia/Response/Model/Document.php +++ b/src/Appwrite/Utopia/Response/Model/Document.php @@ -36,6 +36,12 @@ class Document extends Any 'default' => '', 'example' => '5e5ea5c16897e', ]) + ->addRule('$sequence', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Document automatically incrementing ID.', + 'default' => 0, + 'example' => 1, + ]) ->addRule('$collectionId', [ 'type' => self::TYPE_STRING, 'description' => 'Collection ID.', @@ -71,7 +77,6 @@ class Document extends Any public function filter(DatabaseDocument $document): DatabaseDocument { - $document->removeAttribute('$internalId'); $document->removeAttribute('$collection'); $document->removeAttribute('$tenant'); diff --git a/src/Appwrite/Utopia/Response/Model/Migration.php b/src/Appwrite/Utopia/Response/Model/Migration.php index 3be1d519a6..76e00b3097 100644 --- a/src/Appwrite/Utopia/Response/Model/Migration.php +++ b/src/Appwrite/Utopia/Response/Model/Migration.php @@ -4,6 +4,7 @@ namespace Appwrite\Utopia\Response\Model; use Appwrite\Utopia\Response; use Appwrite\Utopia\Response\Model; +use Utopia\Database\Document; class Migration extends Model { @@ -107,4 +108,29 @@ class Migration extends Model { return Response::MODEL_MIGRATION; } + + public function filter(Document $document): Document + { + $errors = $document->getAttribute('errors', []); + if (empty($errors)) { + return $document; + } + + foreach ($errors as $index => $error) { + $decoded = json_decode($error, true); + + // frontend doesn't need too many details. + if (is_array($decoded)) { + $errors[$index] = json_encode([ + 'code' => $decoded['code'] ?? 0, + 'message' => $decoded['message'] ?? null, + ]); + } + } + + // errors now only have code and message. + $document->setAttribute('errors', $errors); + + return $document; + } } diff --git a/src/Appwrite/Vcs/Comment.php b/src/Appwrite/Vcs/Comment.php index 7c550ad528..a66706a4a2 100644 --- a/src/Appwrite/Vcs/Comment.php +++ b/src/Appwrite/Vcs/Comment.php @@ -86,8 +86,8 @@ class Comment $i = 0; foreach ($projects as $projectId => $project) { - $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; - $hostname = System::getEnv('_APP_DOMAIN'); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $hostname = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); $text .= "## {$project['name']}\n\n"; $text .= "Project ID: `{$projectId}`\n\n"; @@ -103,10 +103,12 @@ class Comment $text .= "| :- | :- | :- | :- | :- |\n"; foreach ($project['site'] as $siteId => $site) { + $imageStatus = in_array($site['status'], ['processing', 'building']) ? 'building' : $site['status']; + $extension = $site['status'] === 'building' ? 'gif' : 'png'; - $pathLight = '/images/vcs/status-' . $site['status'] . '-light.' . $extension; - $pathDark = '/images/vcs/status-' . $site['status'] . '-dark.' . $extension; + $pathLight = '/images/vcs/status-' . $imageStatus . '-light.' . $extension; + $pathDark = '/images/vcs/status-' . $imageStatus . '-dark.' . $extension; $status = match ($site['status']) { 'waiting' => $this->generatImage($pathLight, $pathDark, 'Queued', 85) . ' _Queued_', @@ -149,10 +151,11 @@ class Comment $text .= "| :- | :- | :- | :- |\n"; foreach ($project['function'] as $functionId => $function) { - $extension = $function['status'] === 'building' ? 'gif' : 'png'; + $imageStatus = in_array($function['status'], ['processing', 'building']) ? 'building' : $function['status']; + $extension = $imageStatus === 'building' ? 'gif' : 'png'; - $pathLight = '/images/vcs/status-' . $function['status'] . '-light.' . $extension; - $pathDark = '/images/vcs/status-' . $function['status'] . '-dark.' . $extension; + $pathLight = '/images/vcs/status-' . $imageStatus . '-light.' . $extension; + $pathDark = '/images/vcs/status-' . $imageStatus . '-dark.' . $extension; $status = match ($function['status']) { 'waiting' => $this->generatImage($pathLight, $pathDark, 'Queued', 85) . ' _Queued_', @@ -168,7 +171,8 @@ class Comment $action = '[Authorize](' . $function['action']['url'] . ')'; } - $text .= "|  **{$function['name']}**<br>`$functionId`"; + $text .= "|  **{$function['name']}**"; + $text .= "| `{$functionId}`"; $text .= "| {$status}"; $text .= "| {$action}"; $text .= "|\n"; @@ -196,8 +200,8 @@ class Comment public function generatImage(string $pathLight, string $pathDark, string $alt, int $width): string { - $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https'; - $hostname = System::getEnv('_APP_DOMAIN'); + $protocol = System::getEnv('_APP_OPTIONS_FORCE_HTTPS') === 'disabled' ? 'http' : 'https'; + $hostname = System::getEnv('_APP_CONSOLE_DOMAIN', System::getEnv('_APP_DOMAIN', '')); $imageLight = $protocol . '://' . $hostname . $pathLight; $imageDark = $protocol . '://' . $hostname . $pathDark; diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 5b204c1910..df4c5fd8f5 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -19,21 +19,14 @@ class Executor public const METHOD_CONNECT = 'CONNECT'; public const METHOD_TRACE = 'TRACE'; - private bool $selfSigned = false; - - /** - * @var callable(string, string): string $endpoint - */ - private $endpointSelector; + protected bool $selfSigned = false; + protected string $endpoint; protected array $headers; - /** - * @param callable(string, string): string $endpointSelector - */ - public function __construct(callable $endpointSelector) + public function __construct() { - $this->endpointSelector = $endpointSelector; + $this->endpoint = System::getEnv('_APP_EXECUTOR_HOST', ''); $this->headers = [ 'content-type' => 'application/json', 'authorization' => 'Bearer ' . System::getEnv('_APP_EXECUTOR_SECRET', ''), @@ -71,7 +64,8 @@ class Executor string $destination = '', array $variables = [], string $command = null, - string $outputDirectory = '' + string $outputDirectory = '', + string $runtimeEntrypoint = '' ) { $runtimeId = "$projectId-$deploymentId-build"; $route = "/runtimes"; @@ -94,11 +88,12 @@ class Executor 'memory' => $memory, 'version' => $version, 'timeout' => $timeout, - 'outputDirectory' => $outputDirectory + 'outputDirectory' => $outputDirectory, + 'runtimeEntrypoint' => $runtimeEntrypoint ]; - $endpoint = $this->selectEndpoint($projectId, $deploymentId); - $response = $this->call($endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout); + + $response = $this->call($this->endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout); $status = $response['headers']['status-code']; if ($status >= 400) { @@ -128,8 +123,7 @@ class Executor 'timeout' => $timeout ]; - $endpoint = $this->selectEndpoint($projectId, $deploymentId); - $this->call($endpoint, self::METHOD_GET, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout, $callback); + $this->call($this->endpoint, self::METHOD_GET, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout, $callback); } /** @@ -145,8 +139,7 @@ class Executor $runtimeId = "$projectId-$deploymentId" . $suffix; $route = "/runtimes/$runtimeId"; - $endpoint = $this->selectEndpoint($projectId, $deploymentId); - $response = $this->call($endpoint, self::METHOD_DELETE, $route, [ + $response = $this->call($this->endpoint, self::METHOD_DELETE, $route, [ 'x-opr-addressing-method' => 'broadcast' ], [], true, 30); @@ -195,9 +188,9 @@ class Executor array $headers, float $cpus, int $memory, - string $runtimeEntrypoint = null, bool $logging, - int $requestTimeout = null + string $runtimeEntrypoint = '', + ?int $requestTimeout = null ) { if (empty($headers['host'])) { $headers['host'] = System::getEnv('_APP_DOMAIN', ''); @@ -239,8 +232,7 @@ class Executor $requestTimeout = $timeout + 15; } - $endpoint = $this->selectEndpoint($projectId, $deploymentId); - $response = $this->call($endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId, 'content-type' => 'multipart/form-data', 'accept' => 'multipart/form-data' ], $params, true, $requestTimeout); + $response = $this->call($this->endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId, 'content-type' => 'multipart/form-data', 'accept' => 'multipart/form-data' ], $params, true, $requestTimeout); $status = $response['headers']['status-code']; if ($status >= 400) { @@ -274,8 +266,7 @@ class Executor 'timeout' => $timeout ]; - $endpoint = $this->selectEndpoint($projectId, $deploymentId); - $response = $this->call($endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout); + $response = $this->call($this->endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout); $status = $response['headers']['status-code']; if ($status >= 400) { @@ -465,9 +456,4 @@ class Executor return $output; } - - private function selectEndpoint(string $projectId, string $deploymentId): string - { - return call_user_func($this->endpointSelector, $projectId, $deploymentId); - } } diff --git a/tests/e2e/General/HTTPTest.php b/tests/e2e/General/HTTPTest.php index 620409bb39..bce6e7206f 100644 --- a/tests/e2e/General/HTTPTest.php +++ b/tests/e2e/General/HTTPTest.php @@ -60,7 +60,7 @@ class HTTPTest extends Scope 'origin' => 'http://localhost', ])); - $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(200, $response['headers']['status-code'], "Simple GET /robots.txt HTTP request failed: " . \json_encode($response)); $this->assertStringContainsString('# robotstxt.org/', $response['body']); } diff --git a/tests/e2e/General/UsageTest.php b/tests/e2e/General/UsageTest.php index 5549ef800d..6389258e3a 100644 --- a/tests/e2e/General/UsageTest.php +++ b/tests/e2e/General/UsageTest.php @@ -3,7 +3,6 @@ namespace Tests\E2E\General; use Appwrite\Platform\Modules\Compute\Specification; -use Appwrite\Tests\Retry; use CURLFile; use DateTime; use Tests\E2E\Client; @@ -183,40 +182,43 @@ class UsageTest extends Scope /** * @depends testPrepareUsersStats */ - #[Retry(count: 1)] public function testUsersStats(array $data): array { $requestsTotal = $data['requestsTotal']; - $response = $this->client->call( - Client::METHOD_GET, - '/project/usage', - $this->getConsoleHeaders(), - [ - 'period' => '1h', - 'startDate' => self::getToday(), - 'endDate' => self::getTomorrow(), - ] - ); + $this->assertEventually(function () { + $response = $this->client->call( + Client::METHOD_GET, + '/project/usage', + $this->getConsoleHeaders(), + [ + 'period' => '1h', + 'startDate' => self::getToday(), + 'endDate' => self::getTomorrow(), + ] + ); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertGreaterThanOrEqual(31, count($response['body'])); - $this->validateDates($response['body']['network']); - $this->validateDates($response['body']['requests']); - $this->validateDates($response['body']['users']); - $this->assertArrayHasKey('executionsBreakdown', $response['body']); - $this->assertArrayHasKey('bucketsBreakdown', $response['body']); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertGreaterThanOrEqual(31, count($response['body'])); + $this->validateDates($response['body']['network']); + $this->validateDates($response['body']['requests']); + $this->validateDates($response['body']['users']); + $this->assertArrayHasKey('executionsBreakdown', $response['body']); + $this->assertArrayHasKey('bucketsBreakdown', $response['body']); + }); - $response = $this->client->call( - Client::METHOD_GET, - '/users/usage?range=90d', - $this->getConsoleHeaders() - ); + $this->assertEventually(function () { + $response = $this->client->call( + Client::METHOD_GET, + '/users/usage?range=90d', + $this->getConsoleHeaders() + ); - $this->assertEquals('90d', $response['body']['range']); - $this->assertEquals(90, count($response['body']['users'])); - $this->assertEquals(90, count($response['body']['sessions'])); - $this->assertEquals((self::CREATE / 2), $response['body']['users'][array_key_last($response['body']['users'])]['value']); + $this->assertEquals('90d', $response['body']['range']); + $this->assertEquals(90, count($response['body']['users'])); + $this->assertEquals(90, count($response['body']['sessions'])); + $this->assertEquals((self::CREATE / 2), $response['body']['users'][array_key_last($response['body']['users'])]['value']); + }); return array_merge($data, [ 'requestsTotal' => $requestsTotal @@ -359,7 +361,6 @@ class UsageTest extends Scope /** * @depends testPrepareStorageStats */ - #[Retry(count: 10)] public function testStorageStats(array $data): array { $bucketId = $data['bucketId']; @@ -368,44 +369,50 @@ class UsageTest extends Scope $storageTotal = $data['storageTotal']; $filesTotal = $data['filesTotal']; - $response = $this->client->call( - Client::METHOD_GET, - '/project/usage', - $this->getConsoleHeaders(), - [ - 'period' => '1d', - 'startDate' => self::getToday(), - 'endDate' => self::getTomorrow(), - ] - ); + $this->assertEventually(function () use ($requestsTotal, $storageTotal) { + $response = $this->client->call( + Client::METHOD_GET, + '/project/usage', + $this->getConsoleHeaders(), + [ + 'period' => '1d', + 'startDate' => self::getToday(), + 'endDate' => self::getTomorrow(), + ] + ); - $this->assertGreaterThanOrEqual(31, count($response['body'])); - $this->assertEquals(1, count($response['body']['requests'])); - $this->assertEquals($requestsTotal, $response['body']['requests'][array_key_last($response['body']['requests'])]['value']); - $this->validateDates($response['body']['requests']); - $this->assertEquals($storageTotal, $response['body']['filesStorageTotal']); + $this->assertGreaterThanOrEqual(31, count($response['body'])); + $this->assertEquals(1, count($response['body']['requests'])); + $this->assertEquals($requestsTotal, $response['body']['requests'][array_key_last($response['body']['requests'])]['value']); + $this->validateDates($response['body']['requests']); + $this->assertEquals($storageTotal, $response['body']['filesStorageTotal']); + }); - $response = $this->client->call( - Client::METHOD_GET, - '/storage/usage?range=30d', - $this->getConsoleHeaders() - ); + $this->assertEventually(function () use ($bucketsTotal, $filesTotal, $storageTotal) { + $response = $this->client->call( + Client::METHOD_GET, + '/storage/usage?range=30d', + $this->getConsoleHeaders() + ); - $this->assertEquals($storageTotal, $response['body']['storage'][array_key_last($response['body']['storage'])]['value']); - $this->validateDates($response['body']['storage']); - $this->assertEquals($bucketsTotal, $response['body']['buckets'][array_key_last($response['body']['buckets'])]['value']); - $this->validateDates($response['body']['buckets']); - $this->assertEquals($filesTotal, $response['body']['files'][array_key_last($response['body']['files'])]['value']); - $this->validateDates($response['body']['files']); + $this->assertEquals($storageTotal, $response['body']['storage'][array_key_last($response['body']['storage'])]['value']); + $this->validateDates($response['body']['storage']); + $this->assertEquals($bucketsTotal, $response['body']['buckets'][array_key_last($response['body']['buckets'])]['value']); + $this->validateDates($response['body']['buckets']); + $this->assertEquals($filesTotal, $response['body']['files'][array_key_last($response['body']['files'])]['value']); + $this->validateDates($response['body']['files']); + }); - $response = $this->client->call( - Client::METHOD_GET, - '/storage/' . $bucketId . '/usage?range=30d', - $this->getConsoleHeaders() - ); + $this->assertEventually(function () use ($bucketId, $storageTotal, $filesTotal) { + $response = $this->client->call( + Client::METHOD_GET, + '/storage/' . $bucketId . '/usage?range=30d', + $this->getConsoleHeaders() + ); - $this->assertEquals($storageTotal, $response['body']['storage'][array_key_last($response['body']['storage'])]['value']); - $this->assertEquals($filesTotal, $response['body']['files'][array_key_last($response['body']['files'])]['value']); + $this->assertEquals($storageTotal, $response['body']['storage'][array_key_last($response['body']['storage'])]['value']); + $this->assertEquals($filesTotal, $response['body']['files'][array_key_last($response['body']['files'])]['value']); + }); return $data; } @@ -577,7 +584,7 @@ class UsageTest extends Scope } /** @depends testPrepareDatabaseStats */ - #[Retry(count: 1)] + public function testDatabaseStats(array $data): array { $databaseId = $data['databaseId']; @@ -587,60 +594,66 @@ class UsageTest extends Scope $collectionsTotal = $data['collectionsTotal']; $documentsTotal = $data['documentsTotal']; - sleep(self::WAIT); + $this->assertEventually(function () use ($requestsTotal, $databasesTotal, $documentsTotal) { + $response = $this->client->call( + Client::METHOD_GET, + '/project/usage', + $this->getConsoleHeaders(), + [ + 'period' => '1d', + 'startDate' => self::getToday(), + 'endDate' => self::getTomorrow(), + ] + ); - $response = $this->client->call( - Client::METHOD_GET, - '/project/usage', - $this->getConsoleHeaders(), - [ - 'period' => '1d', - 'startDate' => self::getToday(), - 'endDate' => self::getTomorrow(), - ] - ); + $this->assertGreaterThanOrEqual(31, count($response['body'])); + $this->assertEquals(1, count($response['body']['requests'])); + $this->assertEquals(1, count($response['body']['network'])); + $this->assertEquals($requestsTotal, $response['body']['requests'][array_key_last($response['body']['requests'])]['value']); + $this->validateDates($response['body']['requests']); + $this->assertEquals($databasesTotal, $response['body']['databasesTotal']); + $this->assertEquals($documentsTotal, $response['body']['documentsTotal']); + }); - $this->assertGreaterThanOrEqual(31, count($response['body'])); - $this->assertEquals(1, count($response['body']['requests'])); - $this->assertEquals(1, count($response['body']['network'])); - $this->assertEquals($requestsTotal, $response['body']['requests'][array_key_last($response['body']['requests'])]['value']); - $this->validateDates($response['body']['requests']); - $this->assertEquals($databasesTotal, $response['body']['databasesTotal']); - $this->assertEquals($documentsTotal, $response['body']['documentsTotal']); + $this->assertEventually(function () use ($collectionsTotal, $databasesTotal, $documentsTotal) { + $response = $this->client->call( + Client::METHOD_GET, + '/databases/usage?range=30d', + $this->getConsoleHeaders() + ); - $response = $this->client->call( - Client::METHOD_GET, - '/databases/usage?range=30d', - $this->getConsoleHeaders() - ); + $this->assertEquals($databasesTotal, $response['body']['databases'][array_key_last($response['body']['databases'])]['value']); + $this->validateDates($response['body']['databases']); + $this->assertEquals($collectionsTotal, $response['body']['collections'][array_key_last($response['body']['collections'])]['value']); + $this->validateDates($response['body']['collections']); + $this->assertEquals($documentsTotal, $response['body']['documents'][array_key_last($response['body']['documents'])]['value']); + $this->validateDates($response['body']['documents']); + }); - $this->assertEquals($databasesTotal, $response['body']['databases'][array_key_last($response['body']['databases'])]['value']); - $this->validateDates($response['body']['databases']); - $this->assertEquals($collectionsTotal, $response['body']['collections'][array_key_last($response['body']['collections'])]['value']); - $this->validateDates($response['body']['collections']); - $this->assertEquals($documentsTotal, $response['body']['documents'][array_key_last($response['body']['documents'])]['value']); - $this->validateDates($response['body']['documents']); + $this->assertEventually(function () use ($databaseId, $collectionsTotal, $documentsTotal) { + $response = $this->client->call( + Client::METHOD_GET, + '/databases/' . $databaseId . '/usage?range=30d', + $this->getConsoleHeaders() + ); - $response = $this->client->call( - Client::METHOD_GET, - '/databases/' . $databaseId . '/usage?range=30d', - $this->getConsoleHeaders() - ); + $this->assertEquals($collectionsTotal, $response['body']['collections'][array_key_last($response['body']['collections'])]['value']); + $this->validateDates($response['body']['collections']); - $this->assertEquals($collectionsTotal, $response['body']['collections'][array_key_last($response['body']['collections'])]['value']); - $this->validateDates($response['body']['collections']); + $this->assertEquals($documentsTotal, $response['body']['documents'][array_key_last($response['body']['documents'])]['value']); + $this->validateDates($response['body']['documents']); + }); - $this->assertEquals($documentsTotal, $response['body']['documents'][array_key_last($response['body']['documents'])]['value']); - $this->validateDates($response['body']['documents']); + $this->assertEventually(function () use ($databaseId, $collectionId, $documentsTotal) { + $response = $this->client->call( + Client::METHOD_GET, + '/databases/' . $databaseId . '/collections/' . $collectionId . '/usage?range=30d', + $this->getConsoleHeaders() + ); - $response = $this->client->call( - Client::METHOD_GET, - '/databases/' . $databaseId . '/collections/' . $collectionId . '/usage?range=30d', - $this->getConsoleHeaders() - ); - - $this->assertEquals($documentsTotal, $response['body']['documents'][array_key_last($response['body']['documents'])]['value']); - $this->validateDates($response['body']['documents']); + $this->assertEquals($documentsTotal, $response['body']['documents'][array_key_last($response['body']['documents'])]['value']); + $this->validateDates($response['body']['documents']); + }); return $data; } @@ -662,7 +675,8 @@ class UsageTest extends Scope [ 'functionId' => 'unique()', 'name' => 'Test', - 'runtime' => 'php-8.0', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'vars' => [ 'funcKey1' => 'funcValue1', 'funcKey2' => 'funcValue2', @@ -684,8 +698,7 @@ class UsageTest extends Scope $this->assertNotEmpty($response['body']['$id']); $deploymentId = $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true, ]); $this->assertNotEmpty($deploymentId); @@ -799,67 +812,69 @@ class UsageTest extends Scope } /** @depends testPrepareFunctionsStats */ - #[Retry(count: 1)] public function testFunctionsStats(array $data): array { $functionId = $data['functionId']; $executionTime = $data['executionTime']; $executions = $data['executions']; - $response = $this->client->call( - Client::METHOD_GET, - '/functions/' . $functionId . '/usage?range=30d', - $this->getConsoleHeaders() - ); + $this->assertEventually(function () use ($functionId, $executions, $executionTime) { + $response = $this->client->call( + Client::METHOD_GET, + '/functions/' . $functionId . '/usage?range=30d', + $this->getConsoleHeaders() + ); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(24, count($response['body'])); - $this->assertEquals('30d', $response['body']['range']); - $this->assertIsArray($response['body']['deployments']); - $this->assertIsArray($response['body']['deploymentsStorage']); - $this->assertIsNumeric($response['body']['deploymentsStorageTotal']); - $this->assertIsNumeric($response['body']['buildsMbSecondsTotal']); - $this->assertIsNumeric($response['body']['executionsMbSecondsTotal']); - $this->assertIsArray($response['body']['builds']); - $this->assertIsArray($response['body']['buildsTime']); - $this->assertIsArray($response['body']['buildsMbSeconds']); - $this->assertIsArray($response['body']['executions']); - $this->assertIsArray($response['body']['executionsTime']); - $this->assertIsArray($response['body']['executionsMbSeconds']); - $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); - $this->validateDates($response['body']['executions']); - $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); - $this->validateDates($response['body']['executionsTime']); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(24, count($response['body'])); + $this->assertEquals('30d', $response['body']['range']); + $this->assertIsArray($response['body']['deployments']); + $this->assertIsArray($response['body']['deploymentsStorage']); + $this->assertIsNumeric($response['body']['deploymentsStorageTotal']); + $this->assertIsNumeric($response['body']['buildsMbSecondsTotal']); + $this->assertIsNumeric($response['body']['executionsMbSecondsTotal']); + $this->assertIsArray($response['body']['builds']); + $this->assertIsArray($response['body']['buildsTime']); + $this->assertIsArray($response['body']['buildsMbSeconds']); + $this->assertIsArray($response['body']['executions']); + $this->assertIsArray($response['body']['executionsTime']); + $this->assertIsArray($response['body']['executionsMbSeconds']); + $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); + $this->validateDates($response['body']['executions']); + $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); + $this->validateDates($response['body']['executionsTime']); + }); - $response = $this->client->call( - Client::METHOD_GET, - '/functions/usage?range=30d', - $this->getConsoleHeaders() - ); + $this->assertEventually(function () use ($executions, $executionTime) { + $response = $this->client->call( + Client::METHOD_GET, + '/functions/usage?range=30d', + $this->getConsoleHeaders() + ); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(25, count($response['body'])); - $this->assertEquals($response['body']['range'], '30d'); - $this->assertIsArray($response['body']['functions']); - $this->assertIsArray($response['body']['deployments']); - $this->assertIsArray($response['body']['deploymentsStorage']); - $this->assertIsArray($response['body']['builds']); - $this->assertIsArray($response['body']['buildsTime']); - $this->assertIsArray($response['body']['buildsMbSeconds']); - $this->assertIsArray($response['body']['executions']); - $this->assertIsArray($response['body']['executionsTime']); - $this->assertIsArray($response['body']['executionsMbSeconds']); - $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); - $this->validateDates($response['body']['executions']); - $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); - $this->validateDates($response['body']['executionsTime']); - $this->assertGreaterThan(0, $response['body']['buildsTime'][array_key_last($response['body']['buildsTime'])]['value']); - $this->validateDates($response['body']['buildsTime']); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(25, count($response['body'])); + $this->assertEquals($response['body']['range'], '30d'); + $this->assertIsArray($response['body']['functions']); + $this->assertIsArray($response['body']['deployments']); + $this->assertIsArray($response['body']['deploymentsStorage']); + $this->assertIsArray($response['body']['builds']); + $this->assertIsArray($response['body']['buildsTime']); + $this->assertIsArray($response['body']['buildsMbSeconds']); + $this->assertIsArray($response['body']['executions']); + $this->assertIsArray($response['body']['executionsTime']); + $this->assertIsArray($response['body']['executionsMbSeconds']); + $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); + $this->validateDates($response['body']['executions']); + $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); + $this->validateDates($response['body']['executionsTime']); + $this->assertGreaterThan(0, $response['body']['buildsTime'][array_key_last($response['body']['buildsTime'])]['value']); + $this->validateDates($response['body']['buildsTime']); + }); return $data; } - public function testPrepareSitesStats(): array { $siteId = $this->setupSite([ @@ -927,7 +942,6 @@ class UsageTest extends Scope } /** @depends testPrepareSitesStats */ - #[Retry(count: 1)] public function testSitesStats(array $data) { $siteId = $data['siteId']; @@ -935,67 +949,72 @@ class UsageTest extends Scope $executions = $data['executions'] ?? 0; $deploymentsSuccess = $data['deploymentsSuccess']; $deploymentsFailed = $data['deploymentsFailed']; - $response = $this->client->call( - Client::METHOD_GET, - '/sites/' . $siteId . '/usage?range=30d', - $this->getConsoleHeaders() - ); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(30, count($response['body'])); - $this->assertEquals('30d', $response['body']['range']); - $this->assertIsArray($response['body']['deployments']); - $this->assertEquals($deploymentsSuccess, $response['body']['buildsSuccessTotal']); - $this->assertEquals($deploymentsFailed, $response['body']['buildsFailedTotal']); - $this->assertIsArray($response['body']['deploymentsStorage']); - $this->assertIsNumeric($response['body']['deploymentsStorageTotal']); - $this->assertIsNumeric($response['body']['buildsMbSecondsTotal']); - $this->assertIsNumeric($response['body']['executionsMbSecondsTotal']); - $this->assertIsArray($response['body']['builds']); - $this->assertIsArray($response['body']['buildsTime']); - $this->assertIsArray($response['body']['buildsMbSeconds']); - $this->assertIsArray($response['body']['executions']); - $this->assertIsArray($response['body']['executionsTime']); - $this->assertIsArray($response['body']['executionsMbSeconds']); - $this->assertIsArray($response['body']['buildsSuccess']); - $this->assertIsArray($response['body']['buildsFailed']); - $this->assertIsArray($response['body']['requests']); - $this->assertIsArray($response['body']['inbound']); - $this->assertIsArray($response['body']['outbound']); - $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); - $this->validateDates($response['body']['executions']); - $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); - $this->validateDates($response['body']['executionsTime']); + $this->assertEventually(function () use ($siteId, $deploymentsSuccess, $deploymentsFailed, $executions, $executionTime) { + $response = $this->client->call( + Client::METHOD_GET, + '/sites/' . $siteId . '/usage?range=30d', + $this->getConsoleHeaders() + ); - $response = $this->client->call( - Client::METHOD_GET, - '/sites/usage?range=30d', - $this->getConsoleHeaders() - ); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(30, count($response['body'])); + $this->assertEquals('30d', $response['body']['range']); + $this->assertIsArray($response['body']['deployments']); + $this->assertEquals($deploymentsSuccess, $response['body']['buildsSuccessTotal']); + $this->assertEquals($deploymentsFailed, $response['body']['buildsFailedTotal']); + $this->assertIsArray($response['body']['deploymentsStorage']); + $this->assertIsNumeric($response['body']['deploymentsStorageTotal']); + $this->assertIsNumeric($response['body']['buildsMbSecondsTotal']); + $this->assertIsNumeric($response['body']['executionsMbSecondsTotal']); + $this->assertIsArray($response['body']['builds']); + $this->assertIsArray($response['body']['buildsTime']); + $this->assertIsArray($response['body']['buildsMbSeconds']); + $this->assertIsArray($response['body']['executions']); + $this->assertIsArray($response['body']['executionsTime']); + $this->assertIsArray($response['body']['executionsMbSeconds']); + $this->assertIsArray($response['body']['buildsSuccess']); + $this->assertIsArray($response['body']['buildsFailed']); + $this->assertIsArray($response['body']['requests']); + $this->assertIsArray($response['body']['inbound']); + $this->assertIsArray($response['body']['outbound']); + $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); + $this->validateDates($response['body']['executions']); + $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); + $this->validateDates($response['body']['executionsTime']); + }); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(31, count($response['body'])); - $this->assertEquals($response['body']['range'], '30d'); - $this->assertIsArray($response['body']['sites']); - $this->assertIsArray($response['body']['deployments']); - $this->assertIsArray($response['body']['deploymentsStorage']); - $this->assertIsArray($response['body']['builds']); - $this->assertIsArray($response['body']['buildsTime']); - $this->assertIsArray($response['body']['buildsMbSeconds']); - $this->assertIsArray($response['body']['executions']); - $this->assertIsArray($response['body']['executionsTime']); - $this->assertIsArray($response['body']['executionsMbSeconds']); - $this->assertIsArray($response['body']['buildsSuccess']); - $this->assertIsArray($response['body']['buildsFailed']); - $this->assertIsArray($response['body']['requests']); - $this->assertIsArray($response['body']['inbound']); - $this->assertIsArray($response['body']['outbound']); - $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); - $this->validateDates($response['body']['executions']); - $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); - $this->validateDates($response['body']['executionsTime']); - $this->assertGreaterThan(0, $response['body']['buildsTime'][array_key_last($response['body']['buildsTime'])]['value']); - $this->validateDates($response['body']['buildsTime']); + $this->assertEventually(function () use ($executions, $executionTime) { + $response = $this->client->call( + Client::METHOD_GET, + '/sites/usage?range=30d', + $this->getConsoleHeaders() + ); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(31, count($response['body'])); + $this->assertEquals($response['body']['range'], '30d'); + $this->assertIsArray($response['body']['sites']); + $this->assertIsArray($response['body']['deployments']); + $this->assertIsArray($response['body']['deploymentsStorage']); + $this->assertIsArray($response['body']['builds']); + $this->assertIsArray($response['body']['buildsTime']); + $this->assertIsArray($response['body']['buildsMbSeconds']); + $this->assertIsArray($response['body']['executions']); + $this->assertIsArray($response['body']['executionsTime']); + $this->assertIsArray($response['body']['executionsMbSeconds']); + $this->assertIsArray($response['body']['buildsSuccess']); + $this->assertIsArray($response['body']['buildsFailed']); + $this->assertIsArray($response['body']['requests']); + $this->assertIsArray($response['body']['inbound']); + $this->assertIsArray($response['body']['outbound']); + $this->assertEquals($executions, $response['body']['executions'][array_key_last($response['body']['executions'])]['value']); + $this->validateDates($response['body']['executions']); + $this->assertEquals($executionTime, $response['body']['executionsTime'][array_key_last($response['body']['executionsTime'])]['value']); + $this->validateDates($response['body']['executionsTime']); + $this->assertGreaterThan(0, $response['body']['buildsTime'][array_key_last($response['body']['buildsTime'])]['value']); + $this->validateDates($response['body']['buildsTime']); + }); } /** @depends testFunctionsStats */ @@ -1032,30 +1051,33 @@ class UsageTest extends Scope $domain = $rule['body']['domain']; - $response = $this->client->call( - Client::METHOD_GET, - '/functions/' . $functionId . '/usage?range=30d', - $this->getConsoleHeaders() - ); + $this->assertEventually(function () use (&$response, $functionId) { + $response = $this->client->call( + Client::METHOD_GET, + '/functions/' . $functionId . '/usage?range=30d', + $this->getConsoleHeaders() + ); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertEquals(24, count($response['body'])); - $this->assertEquals('30d', $response['body']['range']); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(24, count($response['body'])); + $this->assertEquals('30d', $response['body']['range']); + }); $functionsMetrics = $response['body']; - $response = $this->client->call( - Client::METHOD_GET, - '/project/usage', - $this->getConsoleHeaders(), - [ - 'period' => '1h', - 'startDate' => self::getToday(), - 'endDate' => self::getTomorrow(), - ] - ); - - $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEventually(function () use (&$response) { + $response = $this->client->call( + Client::METHOD_GET, + '/project/usage', + $this->getConsoleHeaders(), + [ + 'period' => '1h', + 'startDate' => self::getToday(), + 'endDate' => self::getTomorrow(), + ] + ); + $this->assertEquals(200, $response['headers']['status-code']); + }); $projectMetrics = $response['body']; @@ -1070,8 +1092,6 @@ class UsageTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); - $tries = 0; - $this->assertEventually(function () use ($functionId, $functionsMetrics, $projectMetrics) { // Compare new values with old values $response = $this->client->call( diff --git a/tests/e2e/Scopes/ProjectCustom.php b/tests/e2e/Scopes/ProjectCustom.php index a354696f53..c5152adbcc 100644 --- a/tests/e2e/Scopes/ProjectCustom.php +++ b/tests/e2e/Scopes/ProjectCustom.php @@ -140,7 +140,7 @@ trait ProjectCustom 'teams.*', 'users.*' ], - 'url' => 'http://request-catcher:5000/webhook', + 'url' => 'http://request-catcher-webhook:5000/', 'security' => false, ]); diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php index 6deaa62c05..2ee0d0198e 100644 --- a/tests/e2e/Scopes/Scope.php +++ b/tests/e2e/Scopes/Scope.php @@ -2,6 +2,7 @@ namespace Tests\E2E\Scopes; +use Appwrite\Tests\Async; use Appwrite\Tests\Retryable; use PHPUnit\Framework\TestCase; use Tests\E2E\Client; @@ -10,6 +11,10 @@ use Utopia\Database\Helpers\ID; abstract class Scope extends TestCase { use Retryable; + use Async; + + public const REQUEST_TYPE_WEBHOOK = 'webhook'; + public const REQUEST_TYPE_SMS = 'sms'; protected ?Client $client = null; protected string $endpoint = 'http://localhost/v1'; @@ -35,19 +40,73 @@ abstract class Scope extends TestCase if ($limit === 1) { return end($emails); } else { - $lastEmails = array_slice($emails, -1 * $limit); - return $lastEmails; + return array_slice($emails, -1 * $limit); } } return []; } + protected function extractQueryParamsFromEmailLink(string $html): array + { + foreach (['/join-us?', '/verification?', '/recovery?'] as $prefix) { + $linkStart = strpos($html, $prefix); + if ($linkStart !== false) { + $hrefStart = strrpos(substr($html, 0, $linkStart), 'href="'); + if ($hrefStart === false) { + continue; + } + + $hrefStart += 6; + $hrefEnd = strpos($html, '"', $hrefStart); + if ($hrefEnd === false || $hrefStart >= $hrefEnd) { + continue; + } + + $link = substr($html, $hrefStart, $hrefEnd - $hrefStart); + $link = strtok($link, '#'); // Remove `#title` + $queryStart = strpos($link, '?'); + if ($queryStart === false) { + continue; + } + + $queryString = substr($link, $queryStart + 1); + parse_str(html_entity_decode($queryString), $queryParams); + return $queryParams; + } + } + + return []; + } + + protected function assertLastRequest(callable $probe, string $type, $timeoutMs = 20_000, $waitMs = 500): array + { + $hostname = match ($type) { + 'webhook' => 'request-catcher-webhook', + 'sms' => 'request-catcher-sms', + default => throw new \Exception('Invalid request catcher type.'), + }; + + $this->assertEventually(function () use (&$request, $probe, $hostname) { + $request = json_decode(file_get_contents('http://' . $hostname . ':5000/__last_request__'), true); + $request['data'] = json_decode($request['data'], true); + + call_user_func($probe, $request); + }, $timeoutMs, $waitMs); + + return $request; + } + + /** + * @deprecated Use assertLastRequest instead. Used only historically in webhook tests + */ protected function getLastRequest(): array { + $hostname = 'request-catcher-webhook'; + sleep(2); - $request = json_decode(file_get_contents('http://request-catcher:5000/__last_request__'), true); + $request = json_decode(file_get_contents('http://' . $hostname . ':5000/__last_request__'), true); $request['data'] = json_decode($request['data'], true); return $request; diff --git a/tests/e2e/Services/Account/AccountCustomClientTest.php b/tests/e2e/Services/Account/AccountCustomClientTest.php index c4684a1225..bccc51cb8a 100644 --- a/tests/e2e/Services/Account/AccountCustomClientTest.php +++ b/tests/e2e/Services/Account/AccountCustomClientTest.php @@ -780,17 +780,18 @@ class AccountCustomClientTest extends Scope $this->assertEquals($name, $lastEmail['to'][0]['name']); $this->assertEquals('Account Verification', $lastEmail['subject']); - $verification = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); - $expireTime = strpos($lastEmail['text'], 'expire=' . urlencode((new \DateTime($response['body']['expire']))->format('Y-m-d\TH:i:s.v')), 0); - $this->assertNotFalse($expireTime); + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); + $verification = $tokens['secret']; + $expectedExpire = DateTime::formatTz($response['body']['expire']); + $this->assertEquals($expectedExpire, $tokens['expire']); - $secretTest = strpos($lastEmail['text'], 'secret=' . $response['body']['secret'], 0); + // Secret check + $this->assertArrayHasKey('secret', $tokens); + $this->assertNotEmpty($tokens['secret']); - $this->assertNotFalse($secretTest); - - $userIDTest = strpos($lastEmail['text'], 'userId=' . $response['body']['userId'], 0); - - $this->assertNotFalse($userIDTest); + // User ID check + $this->assertArrayHasKey('userId', $tokens); + $this->assertNotEmpty($tokens['userId']); /** * Test for FAILURE @@ -1082,19 +1083,25 @@ class AccountCustomClientTest extends Scope $this->assertEquals($name, $lastEmail['to'][0]['name']); $this->assertEquals('Password Reset', $lastEmail['subject']); - $recovery = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); - $expireTime = strpos($lastEmail['text'], 'expire=' . urlencode((new \DateTime($response['body']['expire']))->format('Y-m-d\TH:i:s.v')), 0); + // Secret check + $this->assertArrayHasKey('secret', $tokens); + $this->assertNotEmpty($tokens['secret']); + $this->assertNotFalse($response['body']['secret']); - $this->assertNotFalse($expireTime); + // User ID check + $this->assertArrayHasKey('userId', $tokens); + $this->assertNotEmpty($tokens['userId']); + $this->assertNotFalse($response['body']['userId']); - $secretTest = strpos($lastEmail['text'], 'secret=' . $response['body']['secret'], 0); - - $this->assertNotFalse($secretTest); - - $userIDTest = strpos($lastEmail['text'], 'userId=' . $response['body']['userId'], 0); - - $this->assertNotFalse($userIDTest); + // Expire check + $this->assertArrayHasKey('expire', $tokens); + $this->assertNotEmpty($tokens['expire']); + $this->assertEquals( + DateTime::formatTz($response['body']['expire']), + $tokens['expire'] + ); /** * Test for FAILURE @@ -1132,7 +1139,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals(404, $response['headers']['status-code']); - $data['recovery'] = $recovery; + $data['recovery'] = $tokens['secret']; return $data; } @@ -1287,7 +1294,7 @@ class AccountCustomClientTest extends Scope $this->assertEquals('otpuser2@appwrite.io', $lastEmail['to'][0]['address']); $this->assertEquals('OTP for ' . $this->getProject()['name'] . ' Login', $lastEmail['subject']); - // FInd 6 concurrent digits in email text - OTP + // Find 6 concurrent digits in email text - OTP preg_match_all("/\b\d{6}\b/", $lastEmail['text'], $matches); $code = ($matches[0] ?? [])[0] ?? ''; @@ -2034,7 +2041,6 @@ class AccountCustomClientTest extends Scope $this->assertEquals($response['body']['users'][0]['email'], $email); } - #[Retry(count: 2)] public function testCreatePhone(): array { $number = '+123456789'; @@ -2058,17 +2064,14 @@ class AccountCustomClientTest extends Scope $userId = $response['body']['userId']; - \sleep(7); - - $smsRequest = $this->getLastRequest(); - - $this->assertEquals('http://request-catcher:5000/mock-sms', $smsRequest['url']); - $this->assertEquals('Appwrite Mock Message Sender', $smsRequest['headers']['User-Agent']); - $this->assertEquals('username', $smsRequest['headers']['X-Username']); - $this->assertEquals('password', $smsRequest['headers']['X-Key']); - $this->assertEquals('POST', $smsRequest['method']); - $this->assertEquals('+123456789', $smsRequest['data']['from']); - $this->assertEquals($number, $smsRequest['data']['to']); + $smsRequest = $this->assertLastRequest(function (array $request) use ($number) { + $this->assertEquals('Appwrite Mock Message Sender', $request['headers']['User-Agent']); + $this->assertEquals('username', $request['headers']['X-Username']); + $this->assertEquals('password', $request['headers']['X-Key']); + $this->assertEquals('POST', $request['method']); + $this->assertEquals('+123456789', $request['data']['from']); + $this->assertEquals($number, $request['data']['to']); + }, Scope::REQUEST_TYPE_SMS); $data['token'] = $smsRequest['data']['message']; $data['id'] = $userId; @@ -2396,7 +2399,6 @@ class AccountCustomClientTest extends Scope /** * @depends testUpdatePhone */ - #[Retry(count: 3)] public function testPhoneVerification(array $data): array { $session = $data['session'] ?? ''; @@ -2413,13 +2415,21 @@ class AccountCustomClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); $this->assertNotEmpty($response['body']['$id']); + $this->assertNotEmpty($response['body']['$createdAt']); $this->assertEmpty($response['body']['secret']); $this->assertTrue((new DatetimeValidator())->isValid($response['body']['expire'])); - $smsRequest = $this->getLastRequest(); + $tokenCreatedAt = $response['body']['$createdAt']; - $message = $smsRequest['data']['message']; - $token = substr($message, 0, 6); + $smsRequest = $this->assertLastRequest(function ($request) use ($tokenCreatedAt) { + $this->assertArrayHasKey('data', $request); + $this->assertArrayHasKey('time', $request); + $this->assertArrayHasKey('message', $request['data'], "Last request missing message: " . \json_encode($request)); + + // Ensure we are not using token from last sms login + $tokenRecievedAt = $request['time']; + $this->assertGreaterThan($tokenCreatedAt, $tokenRecievedAt); + }, Scope::REQUEST_TYPE_SMS); /** * Test for FAILURE diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 9aed3684de..0b19a8966f 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -1414,9 +1414,20 @@ trait DatabasesBase $this->assertEquals($releaseYearIndex['body']['key'], $movies['body']['indexes'][1]['key']); $this->assertEquals($releaseWithDate1['body']['key'], $movies['body']['indexes'][2]['key']); $this->assertEquals($releaseWithDate2['body']['key'], $movies['body']['indexes'][3]['key']); - foreach ($movies['body']['indexes'] as $index) { - $this->assertEquals('available', $index['status']); - } + + $this->assertEventually(function () use ($databaseId, $data) { + $movies = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $data['moviesId'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + foreach ($movies['body']['indexes'] as $index) { + $this->assertEquals('available', $index['status']); + } + + return true; + }, 60000, 500); return $data; } @@ -1645,6 +1656,7 @@ trait DatabasesBase $this->assertEquals($document1['body']['actors'][0], 'Chris Evans'); $this->assertEquals($document1['body']['actors'][1], 'Samuel Jackson'); $this->assertEquals($document1['body']['birthDay'], '1975-06-12T12:12:55.000+00:00'); + $this->assertTrue(array_key_exists('$sequence', $document1['body'])); $this->assertEquals(201, $document2['headers']['status-code']); $this->assertEquals($data['moviesId'], $document2['body']['$collectionId']); @@ -1662,6 +1674,7 @@ trait DatabasesBase $this->assertEquals($document2['body']['birthDay'], null); $this->assertEquals($document2['body']['integers'][0], 50); $this->assertEquals($document2['body']['integers'][1], 60); + $this->assertTrue(array_key_exists('$sequence', $document2['body'])); $this->assertEquals(201, $document3['headers']['status-code']); $this->assertEquals($data['moviesId'], $document3['body']['$collectionId']); @@ -1676,6 +1689,7 @@ trait DatabasesBase $this->assertEquals($document3['body']['actors'][0], 'Tom Holland'); $this->assertEquals($document3['body']['actors'][1], 'Zendaya Maree Stoermer'); $this->assertEquals($document3['body']['birthDay'], '1975-06-12T18:12:55.000+00:00'); // UTC for NY + $this->assertTrue(array_key_exists('$sequence', $document3['body'])); $this->assertEquals(400, $document4['headers']['status-code']); @@ -1982,6 +1996,36 @@ trait DatabasesBase ], ]); $this->assertEquals(2, $documents['body']['total']); + + // test without passing permissions + $document = $this->client->call(Client::METHOD_PUT, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'data' => [ + 'title' => 'Thor: Ragnarok', + 'releaseYear' => 2000 + ] + ]); + + $this->assertEquals(200, $document['headers']['status-code']); + $this->assertEquals('Thor: Ragnarok', $document['body']['title']); + + $document = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(200, $document['headers']['status-code']); + + $deleteResponse = $this->client->call(Client::METHOD_DELETE, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + $this->assertEquals(204, $deleteResponse['headers']['status-code']); } /** @@ -2003,9 +2047,9 @@ trait DatabasesBase $this->assertEquals(1944, $documents['body']['documents'][0]['releaseYear']); $this->assertEquals(2017, $documents['body']['documents'][1]['releaseYear']); $this->assertEquals(2019, $documents['body']['documents'][2]['releaseYear']); - $this->assertFalse(array_key_exists('$internalId', $documents['body']['documents'][0])); - $this->assertFalse(array_key_exists('$internalId', $documents['body']['documents'][1])); - $this->assertFalse(array_key_exists('$internalId', $documents['body']['documents'][2])); + $this->assertTrue(array_key_exists('$sequence', $documents['body']['documents'][0])); + $this->assertTrue(array_key_exists('$sequence', $documents['body']['documents'][1])); + $this->assertTrue(array_key_exists('$sequence', $documents['body']['documents'][2])); $this->assertCount(3, $documents['body']['documents']); foreach ($documents['body']['documents'] as $document) { @@ -2098,7 +2142,7 @@ trait DatabasesBase $this->assertEquals($response['body']['releaseYear'], $document['releaseYear']); $this->assertEquals($response['body']['$permissions'], $document['$permissions']); $this->assertEquals($response['body']['birthDay'], $document['birthDay']); - $this->assertFalse(array_key_exists('$internalId', $response['body'])); + $this->assertTrue(array_key_exists('$sequence', $response['body'])); $this->assertFalse(array_key_exists('$tenant', $response['body'])); } } @@ -2124,6 +2168,22 @@ trait DatabasesBase $this->assertEquals($document['title'], $response['body']['title']); $this->assertEquals($document['releaseYear'], $response['body']['releaseYear']); $this->assertArrayNotHasKey('birthDay', $response['body']); + $sequence = $response['body']['$sequence']; + + // Query by sequence + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $document['$collectionId'] . '/documents/' . $document['$id'], array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [ + Query::equal('$sequence', [$sequence]) + ], + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals($document['title'], $response['body']['title']); + $this->assertEquals($document['releaseYear'], $response['body']['releaseYear']); + $this->assertTrue(array_key_exists('$sequence', $response['body'])); } /** @@ -4361,8 +4421,8 @@ trait DatabasesBase $this->assertArrayNotHasKey('$collection', $person1['body']); $this->assertArrayNotHasKey('$collection', $person1['body']['library']); - $this->assertArrayNotHasKey('$internalId', $person1['body']); - $this->assertArrayNotHasKey('$internalId', $person1['body']['library']); + $this->assertArrayHasKey('$sequence', $person1['body']); + $this->assertArrayHasKey('$sequence', $person1['body']['library']); $documents = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $person['body']['$id'] . '/documents', array_merge([ 'content-type' => 'application/json', @@ -5279,4 +5339,213 @@ trait DatabasesBase 'x-appwrite-key' => $this->getProject()['apiKey'] ])); } + + /** + * @throws \Exception + */ + public function testIncrementAttribute(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'CounterDatabase' + ]); + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'CounterCollection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + $collectionId = $collection['body']['$id']; + + // Add integer attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'count', + 'required' => true, + ]); + + \sleep(3); + + // Create document with initial count = 5 + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => [ + 'count' => 5 + ], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + ], + ]); + $this->assertEquals(201, $doc['headers']['status-code']); + + $docId = $doc['body']['$id']; + + // Increment by default 1 + $inc = $this->client->call(Client::METHOD_PATCH, "/databases/$databaseId/collections/$collectionId/documents/$docId/count/increment", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ])); + $this->assertEquals(200, $inc['headers']['status-code']); + $this->assertEquals(6, $inc['body']['count']); + + // Verify count = 6 + $get = $this->client->call(Client::METHOD_GET, "/databases/$databaseId/collections/$collectionId/documents/$docId", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(6, $get['body']['count']); + + // Increment by custom value 4 + $inc2 = $this->client->call(Client::METHOD_PATCH, "/databases/$databaseId/collections/$collectionId/documents/$docId/count/increment", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'value' => 4 + ]); + $this->assertEquals(200, $inc2['headers']['status-code']); + $this->assertEquals(10, $inc2['body']['count']); + + $get2 = $this->client->call(Client::METHOD_GET, "/databases/$databaseId/collections/$collectionId/documents/$docId", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(10, $get2['body']['count']); + + // Test max limit exceeded + $err = $this->client->call(Client::METHOD_PATCH, "/databases/$databaseId/collections/$collectionId/documents/$docId/count/increment", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), ['max' => 8]); + $this->assertEquals(400, $err['headers']['status-code']); + + // Test attribute not found + $notFound = $this->client->call(Client::METHOD_PATCH, "/databases/$databaseId/collections/$collectionId/documents/$docId/unknown/increment", array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ])); + $this->assertEquals(404, $notFound['headers']['status-code']); + } + + public function testDecrementAttribute(): void + { + $database = $this->client->call(Client::METHOD_POST, '/databases', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ], [ + 'databaseId' => ID::unique(), + 'name' => 'CounterDatabase' + ]); + + $databaseId = $database['body']['$id']; + + $collection = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'collectionId' => ID::unique(), + 'name' => 'CounterCollection', + 'documentSecurity' => true, + 'permissions' => [ + Permission::create(Role::user($this->getUser()['$id'])), + Permission::read(Role::user($this->getUser()['$id'])), + ], + ]); + + $collectionId = $collection['body']['$id']; + + // Add integer attribute + $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/attributes/integer', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ]), [ + 'key' => 'count', + 'required' => true, + ]); + + \sleep(2); + + // Create document with initial count = 10 + $doc = $this->client->call(Client::METHOD_POST, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'documentId' => ID::unique(), + 'data' => ['count' => 10], + 'permissions' => [ + Permission::read(Role::any()), + Permission::update(Role::any()), + ], + ]); + + $documentId = $doc['body']['$id']; + + // Decrement by default 1 (count = 10 -> 9) + $dec = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ])); + $this->assertEquals(200, $dec['headers']['status-code']); + $this->assertEquals(9, $dec['body']['count']); + + $get = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(9, $get['body']['count']); + + // Decrement by custom value 3 (count 9 -> 6) + $dec2 = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), [ + 'value' => 3 + ]); + $this->assertEquals(200, $dec2['headers']['status-code']); + $this->assertEquals(6, $dec2['body']['count']); + + $get2 = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(6, $get2['body']['count']); + + // Test min limit exceeded + $err = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), ['min' => 7]); + $this->assertEquals(400, $err['headers']['status-code']); + + // Test type error on non-numeric attribut + $typeErr = $this->client->call(Client::METHOD_PATCH, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents/' . $documentId . '/count/decrement', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ]), ['value' => 'not-a-number']); + $this->assertEquals(400, $typeErr['headers']['status-code']); + } + + } diff --git a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php index e66207b215..b38b1202c6 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php @@ -644,7 +644,6 @@ class DatabasesCustomServerTest extends Scope */ public function testCreateEncryptedAttribute(array $data): void { - $databaseId = $data['databaseId']; /** @@ -674,7 +673,6 @@ class DatabasesCustomServerTest extends Scope /** * Test for creating encrypted attributes */ - $attributesPath = '/databases/' . $databaseId . '/collections/' . $actors['body']['$id'] . '/attributes'; $firstName = $this->client->call(Client::METHOD_POST, $attributesPath . '/string', array_merge([ @@ -686,6 +684,7 @@ class DatabasesCustomServerTest extends Scope 'size' => 256, 'required' => true, ]); + // checking size test $lastName = $this->client->call(Client::METHOD_POST, $attributesPath . '/string', array_merge([ 'content-type' => 'application/json', @@ -710,12 +709,15 @@ class DatabasesCustomServerTest extends Scope 'encrypt' => true ]); $this->assertTrue($lastName['body']['encrypt']); + sleep(1); + $response = $this->client->call(Client::METHOD_GET, $attributesPath . '/lastName', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], ])); + $this->assertTrue($response['body']['encrypt']); /** @@ -1468,9 +1470,24 @@ class DatabasesCustomServerTest extends Scope $this->assertCount(64, $collection['body']['attributes']); $this->assertCount(0, $collection['body']['indexes']); - foreach ($collection['body']['attributes'] as $attribute) { - $this->assertEquals('available', $attribute['status'], 'attribute: ' . $attribute['key']); - } + $this->assertEventually(function () use ($databaseId, $collectionId) { + $collection = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'] + ])); + + foreach ($collection['body']['attributes'] ?? [] as $attribute) { + $this->assertEquals( + 'available', + $attribute['status'], + 'attribute: ' . $attribute['key'] + ); + } + + return true; + }, 60000, 500); + // Test indexLimit = 64 // MariaDB, MySQL, and MongoDB create 6 indexes per new collection diff --git a/tests/e2e/Services/Functions/FunctionsBase.php b/tests/e2e/Services/Functions/FunctionsBase.php index 475eb9b9b4..27b67d851d 100644 --- a/tests/e2e/Services/Functions/FunctionsBase.php +++ b/tests/e2e/Services/Functions/FunctionsBase.php @@ -49,7 +49,7 @@ trait FunctionsBase 'x-appwrite-key' => $this->getProject()['apiKey'], ])); $this->assertEquals('ready', $deployment['body']['status'], 'Deployment status is not ready, deployment: ' . json_encode($deployment['body'], JSON_PRETTY_PRINT)); - }, 50000, 500); + }, 100000, 500); // Not === so multipart/form-data works fine too if (($params['activate'] ?? false) == true) { diff --git a/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php b/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php index 24215f5352..9dae8efdb4 100644 --- a/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsConsoleClientTest.php @@ -21,8 +21,8 @@ class FunctionsConsoleClientTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::user($this->getUser()['$id'])->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'users.*.create', 'users.*.delete', @@ -39,8 +39,8 @@ class FunctionsConsoleClientTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test Failure', 'execute' => ['some-random-string'], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', ]); $this->assertEquals(400, $function2['headers']['status-code']); @@ -453,7 +453,7 @@ class FunctionsConsoleClientTest extends Scope { $function = $this->createFunction([ 'functionId' => ID::unique(), - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'name' => 'Variable E2E Test', 'entrypoint' => 'index.js', 'logging' => false, @@ -481,7 +481,7 @@ class FunctionsConsoleClientTest extends Scope $deploymentId = $this->setupDeployment($functionId, [ 'entrypoint' => 'index.js', - 'code' => $this->packageFunction('node'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -502,7 +502,7 @@ class FunctionsConsoleClientTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'name' => 'Download Test', 'entrypoint' => 'index.js', 'logging' => false, @@ -511,7 +511,7 @@ class FunctionsConsoleClientTest extends Scope $deploymentId = $this->setupDeployment($functionId, [ 'entrypoint' => 'index.js', - 'code' => $this->packageFunction('node'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); diff --git a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php index a47bc62d47..ccabc2a79e 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomClientTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomClientTest.php @@ -43,8 +43,8 @@ class FunctionsCustomClientTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::user($this->getUser()['$id'])->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'users.*.create', 'users.*.delete', @@ -52,8 +52,7 @@ class FunctionsCustomClientTest extends Scope 'timeout' => 10, ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -84,13 +83,12 @@ class FunctionsCustomClientTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::any()->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 10, ]); $deploymentId = $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-fn'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -107,8 +105,8 @@ class FunctionsCustomClientTest extends Scope $this->assertEquals('Test', $output['APPWRITE_FUNCTION_NAME']); $this->assertEquals($deploymentId, $output['APPWRITE_FUNCTION_DEPLOYMENT']); $this->assertEquals('http', $output['APPWRITE_FUNCTION_TRIGGER']); - $this->assertEquals('PHP', $output['APPWRITE_FUNCTION_RUNTIME_NAME']); - $this->assertEquals('8.0', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']); + $this->assertEquals('Node.js', $output['APPWRITE_FUNCTION_RUNTIME_NAME']); + $this->assertEquals('22', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']); $this->assertEquals(APP_VERSION_STABLE, $output['APPWRITE_VERSION']); $this->assertEquals(System::getEnv('_APP_REGION', 'default'), $output['APPWRITE_REGION']); $this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']); @@ -142,10 +140,10 @@ class FunctionsCustomClientTest extends Scope */ $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test', + 'name' => 'Test guest execution', 'execute' => [Role::any()->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'vars' => [ 'funcKey1' => 'funcValue1', 'funcKey2' => 'funcValue2', @@ -154,8 +152,7 @@ class FunctionsCustomClientTest extends Scope 'timeout' => 10, ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-fn'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -175,8 +172,8 @@ class FunctionsCustomClientTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 10, ]); @@ -193,15 +190,14 @@ class FunctionsCustomClientTest extends Scope */ $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test', + 'name' => 'Test synchronous execution', 'execute' => [Role::any()->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 10, ]); $deploymentId = $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-fn'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -214,11 +210,11 @@ class FunctionsCustomClientTest extends Scope $this->assertEquals('completed', $execution['body']['status']); $this->assertEquals(200, $execution['body']['responseStatusCode']); $this->assertEquals($functionId, $output['APPWRITE_FUNCTION_ID']); - $this->assertEquals('Test', $output['APPWRITE_FUNCTION_NAME']); + $this->assertEquals('Test synchronous execution', $output['APPWRITE_FUNCTION_NAME']); $this->assertEquals($deploymentId, $output['APPWRITE_FUNCTION_DEPLOYMENT']); $this->assertEquals('http', $output['APPWRITE_FUNCTION_TRIGGER']); - $this->assertEquals('PHP', $output['APPWRITE_FUNCTION_RUNTIME_NAME']); - $this->assertEquals('8.0', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']); + $this->assertEquals('Node.js', $output['APPWRITE_FUNCTION_RUNTIME_NAME']); + $this->assertEquals('22', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']); $this->assertEquals(APP_VERSION_STABLE, $output['APPWRITE_VERSION']); $this->assertEquals(System::getEnv('_APP_REGION', 'default'), $output['APPWRITE_REGION']); $this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']); @@ -239,12 +235,12 @@ class FunctionsCustomClientTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::any()->toString()], - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'entrypoint' => 'index.js' ]); $this->setupDeployment($functionId, [ 'entrypoint' => 'index.js', - 'code' => $this->packageFunction('node'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -340,7 +336,7 @@ class FunctionsCustomClientTest extends Scope 'limit' => 5, 'offset' => 2, 'useCases' => ['databases'], - 'runtimes' => ['node-16.0'] + 'runtimes' => ['node-22'] ]); $this->assertEquals(200, $templates['headers']['status-code']); @@ -352,7 +348,7 @@ class FunctionsCustomClientTest extends Scope $this->assertContains($template['useCases'][0], ['databases']); } - $this->assertContains('node-16.0', array_column($templates['body']['templates'][0]['runtimes'], 'name')); + $this->assertContains('node-22', array_column($templates['body']['templates'][0]['runtimes'], 'name')); /** * Test for FAILURE diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 6a8db0a88c..ff99033fdf 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -35,7 +35,7 @@ class FunctionsCustomServerTest extends Scope $function = $this->createFunction([ 'functionId' => ID::unique(), 'name' => 'Specs function', - 'runtime' => 'php-8.0', + 'runtime' => 'node-22', 'specification' => $specifications['body']['specifications'][0]['slug'] ]); $this->assertEquals(201, $function['headers']['status-code']); @@ -50,7 +50,7 @@ class FunctionsCustomServerTest extends Scope $function = $this->createFunction([ 'functionId' => ID::unique(), 'name' => 'Specs function', - 'runtime' => 'php-8.0', + 'runtime' => 'node-22', 'specification' => 'cheap-please' ]); $this->assertEquals(400, $function['headers']['status-code']); @@ -64,8 +64,8 @@ class FunctionsCustomServerTest extends Scope $function = $this->createFunction([ 'functionId' => ID::unique(), 'name' => 'Test', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'buckets.*.create', 'buckets.*.delete', @@ -79,7 +79,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(201, $function['headers']['status-code']); $this->assertNotEmpty($function['body']['$id']); $this->assertEquals('Test', $function['body']['name']); - $this->assertEquals('php-8.0', $function['body']['runtime']); + $this->assertEquals('node-22', $function['body']['runtime']); $this->assertEquals(true, $dateValidator->isValid($function['body']['$createdAt'])); $this->assertEquals(true, $dateValidator->isValid($function['body']['$updatedAt'])); $this->assertEquals('', $function['body']['deploymentId']); @@ -180,7 +180,7 @@ class FunctionsCustomServerTest extends Scope // Test search runtime $functions = $this->listFunctions([ - 'search' => 'php-8.0' + 'search' => 'node-22' ]); $this->assertEquals($functions['headers']['status-code'], 200); @@ -193,8 +193,8 @@ class FunctionsCustomServerTest extends Scope $this->setupFunction([ 'functionId' => ID::unique(), 'name' => 'Test 2', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'buckets.*.create', 'buckets.*.delete', @@ -286,8 +286,8 @@ class FunctionsCustomServerTest extends Scope ], 'schedule' => '0 0 1 1 *', 'timeout' => 15, - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', ]); $dateValidator = new DatetimeValidator(); @@ -322,8 +322,8 @@ class FunctionsCustomServerTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::user($this->getUser()['$id'])->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'users.*.create', 'users.*.delete', @@ -338,8 +338,7 @@ class FunctionsCustomServerTest extends Scope 'x-appwrite-key' => $this->getProject()['apiKey'], 'x-sdk-language' => 'cli', ], [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -363,7 +362,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(200, $starterTemplate['headers']['status-code']); $phpRuntime = array_values(array_filter($starterTemplate['body']['runtimes'], function ($runtime) { - return $runtime['name'] === 'php-8.0'; + return $runtime['name'] === 'node-22'; }))[0]; // If this fails, the template has variables, and this test needs to be updated @@ -373,7 +372,7 @@ class FunctionsCustomServerTest extends Scope [ 'functionId' => ID::unique(), 'name' => $starterTemplate['body']['name'], - 'runtime' => 'php-8.0', + 'runtime' => 'node-22', 'execute' => $starterTemplate['body']['permissions'], 'entrypoint' => $phpRuntime['entrypoint'], 'events' => $starterTemplate['body']['events'], @@ -514,7 +513,7 @@ class FunctionsCustomServerTest extends Scope $functionId = $data['functionId']; $deployment = $this->createDeployment($functionId, [ - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -522,7 +521,7 @@ class FunctionsCustomServerTest extends Scope $this->assertNotEmpty($deployment['body']['$id']); $this->assertEquals('waiting', $deployment['body']['status']); $this->assertEquals(true, (new DatetimeValidator())->isValid($deployment['body']['$createdAt'])); - $this->assertEquals('index.php', $deployment['body']['entrypoint']); + $this->assertEquals('index.js', $deployment['body']['entrypoint']); $deploymentIdActive = $deployment['body']['$id'] ?? ''; @@ -533,7 +532,7 @@ class FunctionsCustomServerTest extends Scope }, 50000, 500); $deployment = $this->createDeployment($functionId, [ - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => 'false' ]); @@ -573,7 +572,7 @@ class FunctionsCustomServerTest extends Scope $functionId = $data['functionId']; $deployment = $this->createDeployment($functionId, [ - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => 'false' ]); @@ -582,7 +581,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); $this->assertNotEmpty($deployment['body']['$id']); $this->assertEquals(true, (new DatetimeValidator())->isValid($deployment['body']['$createdAt'])); - $this->assertEquals('index.php', $deployment['body']['entrypoint']); + $this->assertEquals('index.js', $deployment['body']['entrypoint']); $this->assertEventually(function () use ($functionId, $deploymentId) { $deployment = $this->getDeployment($functionId, $deploymentId); @@ -595,12 +594,12 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(200, $deployment['headers']['status-code']); $this->assertEquals('canceled', $deployment['body']['status']); - /** - * Build worker still runs the build. - * 30s sleep gives worker enough time to finish build. - * After build finished, it should still be canceled, not ready. - */ - \sleep(30); + // Ensures worker got eventually aware of cancellation and reacted properly + $this->assertEventually(function () use ($functionId, $deploymentId) { + $deployment = $this->getDeployment($functionId, $deploymentId); + $this->assertEquals(200, $deployment['headers']['status-code']); + $this->assertStringContainsString('Build has been canceled.', $deployment['body']['buildLogs']); + }); $deployment = $this->getDeployment($functionId, $deploymentId); @@ -618,7 +617,7 @@ class FunctionsCustomServerTest extends Scope */ $functionId = $data['functionId']; - $folder = 'php-large'; + $folder = 'large'; $code = realpath(__DIR__ . '/../../../resources/functions') . "/$folder/code.tar.gz"; Console::execute('cd ' . realpath(__DIR__ . "/../../../resources/functions") . "/$folder && tar --exclude code.tar.gz -czf code.tar.gz .", '', $this->stdout, $this->stderr); @@ -633,13 +632,13 @@ class FunctionsCustomServerTest extends Scope ]; $id = ''; while (!feof($handle)) { - $curlFile = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode(@fread($handle, $chunkSize)), $mimeType, 'php-large-fx.tar.gz'); + $curlFile = new \CURLFile('data://' . $mimeType . ';base64,' . base64_encode(@fread($handle, $chunkSize)), $mimeType, 'large-fx.tar.gz'); $headers['content-range'] = 'bytes ' . ($counter * $chunkSize) . '-' . min(((($counter * $chunkSize) + $chunkSize) - 1), $size - 1) . '/' . $size; if (!empty($id)) { $headers['x-appwrite-id'] = $id; } $largeTag = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/deployments', array_merge($headers, $this->getHeaders()), [ - 'entrypoint' => 'index.php', + 'entrypoint' => 'index.js', 'code' => $curlFile, 'activate' => true, 'commands' => 'cp blue.mp4 copy.mp4 && ls -al' // +7MB buildSize @@ -652,7 +651,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(202, $largeTag['headers']['status-code']); $this->assertNotEmpty($largeTag['body']['$id']); $this->assertEquals(true, (new DatetimeValidator())->isValid($largeTag['body']['$createdAt'])); - $this->assertEquals('index.php', $largeTag['body']['entrypoint']); + $this->assertEquals('index.js', $largeTag['body']['entrypoint']); $this->assertGreaterThan(1024 * 1024 * 5, $largeTag['body']['sourceSize']); // ~7MB video file $this->assertLessThan(1024 * 1024 * 10, $largeTag['body']['sourceSize']); // ~7MB video file @@ -903,8 +902,8 @@ class FunctionsCustomServerTest extends Scope $this->assertStringContainsString($data['deploymentId'], $execution['body']['responseBody']); $this->assertStringContainsString('Test1', $execution['body']['responseBody']); $this->assertStringContainsString('http', $execution['body']['responseBody']); - $this->assertStringContainsString('PHP', $execution['body']['responseBody']); - $this->assertStringContainsString('8.0', $execution['body']['responseBody']); + $this->assertStringContainsString('Node.js', $execution['body']['responseBody']); + $this->assertStringContainsString('22', $execution['body']['responseBody']); $this->assertStringContainsString('Global Variable Value', $execution['body']['responseBody']); // $this->assertStringContainsString('êä', $execution['body']['responseBody']); // tests unknown utf-8 chars $this->assertNotEmpty($execution['body']['errors']); @@ -1017,8 +1016,8 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(200, $execution['body']['responseStatusCode']); $this->assertStringContainsString('Test1', $execution['body']['responseBody']); $this->assertStringContainsString('http', $execution['body']['responseBody']); - $this->assertStringContainsString('PHP', $execution['body']['responseBody']); - $this->assertStringContainsString('8.0', $execution['body']['responseBody']); + $this->assertStringContainsString('Node.js', $execution['body']['responseBody']); + $this->assertStringContainsString('22', $execution['body']['responseBody']); // $this->assertStringContainsString('êä', $execution['body']['response']); // tests unknown utf-8 chars $this->assertLessThan(1.500, $execution['body']['duration']); @@ -1120,8 +1119,8 @@ class FunctionsCustomServerTest extends Scope 'users.*.update.email', ], 'timeout' => 15, - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'specification' => Specification::S_1VCPU_1GB, ]); @@ -1148,8 +1147,8 @@ class FunctionsCustomServerTest extends Scope 'users.*.update.email', ], 'timeout' => 15, - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'specification' => Specification::S_1VCPU_512MB, ]); @@ -1178,8 +1177,8 @@ class FunctionsCustomServerTest extends Scope 'users.*.update.email', ], 'timeout' => 15, - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'specification' => 's-2vcpu-512mb', // Invalid specification ]); @@ -1236,9 +1235,9 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test php-8.0', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test timeout execution', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [], 'schedule' => '', 'timeout' => 5, // Should timeout after 5 seconds @@ -1280,12 +1279,12 @@ class FunctionsCustomServerTest extends Scope */ public function provideCustomExecutions(): array { + // Most disabled to keep tests fast return [ - ['folder' => 'php-fn', 'name' => 'php-8.0', 'entrypoint' => 'index.php', 'runtimeName' => 'PHP', 'runtimeVersion' => '8.0'], - ['folder' => 'node', 'name' => 'node-18.0', 'entrypoint' => 'index.js', 'runtimeName' => 'Node.js', 'runtimeVersion' => '18.0'], - ['folder' => 'python', 'name' => 'python-3.9', 'entrypoint' => 'main.py', 'runtimeName' => 'Python', 'runtimeVersion' => '3.9'], - ['folder' => 'ruby', 'name' => 'ruby-3.1', 'entrypoint' => 'main.rb', 'runtimeName' => 'Ruby', 'runtimeVersion' => '3.1'], - // Swift and Dart disabled on purpose, as it's very slow. + // ['folder' => 'php-fn', 'name' => 'php-8.0', 'entrypoint' => 'index.php', 'runtimeName' => 'PHP', 'runtimeVersion' => '8.0'], + ['folder' => 'node', 'name' => 'node-22', 'entrypoint' => 'index.js', 'runtimeName' => 'Node.js', 'runtimeVersion' => '22'], + // ['folder' => 'python', 'name' => 'python-3.9', 'entrypoint' => 'main.py', 'runtimeName' => 'Python', 'runtimeVersion' => '3.9'], + // ['folder' => 'ruby', 'name' => 'ruby-3.1', 'entrypoint' => 'main.rb', 'runtimeName' => 'Ruby', 'runtimeVersion' => '3.1'], // [ 'folder' => 'dart', 'name' => 'dart-2.15', 'entrypoint' => 'main.dart', 'runtimeName' => 'Dart', 'runtimeVersion' => '2.15' ], // [ 'folder' => 'swift', 'name' => 'swift-5.5', 'entrypoint' => 'index.swift', 'runtimeName' => 'Swift', 'runtimeVersion' => '5.5' ], ]; @@ -1324,27 +1323,14 @@ class FunctionsCustomServerTest extends Scope ]); $execution = $this->createExecution($functionId, [ - 'body' => 'foobar', 'async' => 'false' ]); $output = json_decode($execution['body']['responseBody'], true); $this->assertEquals(201, $execution['headers']['status-code']); - $this->assertEquals('completed', $execution['body']['status']); $this->assertEquals(200, $execution['body']['responseStatusCode']); - $this->assertEquals($functionId, $output['APPWRITE_FUNCTION_ID']); - $this->assertEquals('Test ' . $name, $output['APPWRITE_FUNCTION_NAME']); - $this->assertEquals($deploymentId, $output['APPWRITE_FUNCTION_DEPLOYMENT']); - $this->assertEquals('http', $output['APPWRITE_FUNCTION_TRIGGER']); - $this->assertEquals($runtimeName, $output['APPWRITE_FUNCTION_RUNTIME_NAME']); - $this->assertEquals($runtimeVersion, $output['APPWRITE_FUNCTION_RUNTIME_VERSION']); - $this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']); - $this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']); - $this->assertEquals('variable', $output['CUSTOM_VARIABLE']); - $this->assertEmpty($output['APPWRITE_FUNCTION_USER_ID']); - $this->assertEmpty($output['APPWRITE_FUNCTION_JWT']); - $this->assertEquals($this->getProject()['$id'], $output['APPWRITE_FUNCTION_PROJECT_ID']); - $this->assertStringContainsString('Amazing Function Log', $execution['body']['logs']); + $this->assertEquals('OK', $execution['body']['responseBody']); + $this->assertEmpty($execution['body']['logs']); $this->assertEmpty($execution['body']['errors']); $executionId = $execution['body']['$id'] ?? ''; @@ -1357,7 +1343,8 @@ class FunctionsCustomServerTest extends Scope $this->assertCount(1, $executions['body']['executions']); $this->assertEquals($executions['body']['executions'][0]['$id'], $executionId); $this->assertEquals($executions['body']['executions'][0]['trigger'], 'http'); - $this->assertStringContainsString('Amazing Function Log', $executions['body']['executions'][0]['logs']); + $this->assertEquals(200, $executions['body']['executions'][0]['responseStatusCode']); + $this->assertEmpty($executions['body']['executions'][0]['responseBody']); $this->cleanupFunction($functionId); } @@ -1366,15 +1353,14 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Binary executions', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Binary executions', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'execute' => ['any'] ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-binary-response'), + 'code' => $this->packageFunction('binary-response'), 'activate' => true ]); @@ -1415,15 +1401,14 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Binary executions', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Binary executions', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'execute' => ['any'] ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-binary-request'), + 'code' => $this->packageFunction('binary-request'), 'activate' => true ]); @@ -1461,49 +1446,6 @@ class FunctionsCustomServerTest extends Scope $this->cleanupFunction($functionId); } - public function testv2Function() - { - $functionId = $this->setupFunction([ - 'functionId' => ID::unique(), - 'name' => 'Test PHP V2', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', - 'events' => [], - 'timeout' => 15, - ]); - - $variable = $this->client->call(Client::METHOD_PATCH, '/mock/functions-v2', [ - 'content-type' => 'application/json', - 'origin' => 'http://localhost', - 'cookie' => 'a_session_console=' . $this->getRoot()['session'], - 'x-appwrite-project' => $this->getProject()['$id'], - 'x-appwrite-mode' => 'admin', - ], [ - 'functionId' => $functionId - ]); - $this->assertEquals(204, $variable['headers']['status-code']); - - $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-v2'), - 'activate' => true - ]); - - $execution = $this->createExecution($functionId, [ - 'body' => 'foobar', - 'async' => 'false' - ]); - - $this->assertEquals(201, $execution['headers']['status-code']); - $this->assertEquals('completed', $execution['body']['status']); - $this->assertEquals(200, $execution['body']['responseStatusCode']); - - $output = json_decode($execution['body']['responseBody'], true); - $this->assertEquals(true, $output['v2Woks']); - - $this->cleanupFunction($functionId); - } - public function testGetRuntimes() { $runtimes = $this->client->call(Client::METHOD_GET, '/functions/runtimes', array_merge([ @@ -1531,17 +1473,16 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Event executions', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Event executions', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'users.*.create', ], 'timeout' => 15, ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-event'), + 'code' => $this->packageFunction('event-handler'), 'activate' => true ]); @@ -1584,17 +1525,16 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Scopes executions', - 'commands' => 'bash setup.sh && composer install', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Scopes executions', + 'commands' => 'bash setup.sh && npm install', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'scopes' => ['users.read'], 'timeout' => 15, ]); $deploymentId = $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-scopes'), + 'code' => $this->packageFunction('dynamic-api-key'), 'activate' => true, ]); @@ -1643,16 +1583,15 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Cookie executions', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Cookie executions', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, ]); $this->assertNotEmpty($functionId); $deploymentId = $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-cookie'), + 'code' => $this->packageFunction('cookies'), 'activate' => true ]); $this->assertNotEmpty($deploymentId); @@ -1685,9 +1624,9 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Cookie executions', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Cookie executions', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'execute' => ['any'] ]); @@ -1695,8 +1634,7 @@ class FunctionsCustomServerTest extends Scope $domain = $this->setupFunctionDomain($functionId); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-cookie'), + 'code' => $this->packageFunction('cookies'), 'activate' => true ]); @@ -1743,9 +1681,9 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Binary executions', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Binary executions', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'execute' => ['any'] ]); @@ -1753,8 +1691,7 @@ class FunctionsCustomServerTest extends Scope $domain = $this->setupFunctionDomain($functionId); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-binary-response'), + 'code' => $this->packageFunction('binary-response'), 'activate' => true ]); @@ -1778,9 +1715,9 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'name' => 'Test PHP Binary executions', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'name' => 'Test Binary executions', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'execute' => ['any'] ]); @@ -1788,8 +1725,7 @@ class FunctionsCustomServerTest extends Scope $domain = $this->setupFunctionDomain($functionId); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php-binary-request'), + 'code' => $this->packageFunction('binary-request'), 'activate' => true ]); @@ -1816,8 +1752,8 @@ class FunctionsCustomServerTest extends Scope ], $this->getHeaders()), [ 'functionId' => ID::unique(), 'name' => 'Test', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, ]); @@ -1851,8 +1787,8 @@ class FunctionsCustomServerTest extends Scope $function1Id = $this->setupFunction([ 'functionId' => ID::unique(), 'name' => 'Test', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'execute' => ['any'] ]); @@ -1860,8 +1796,8 @@ class FunctionsCustomServerTest extends Scope $function2Id = $this->setupFunction([ 'functionId' => ID::unique(), 'name' => 'Test2', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'execute' => ['any'] ]); @@ -1892,7 +1828,7 @@ class FunctionsCustomServerTest extends Scope { $function = $this->createFunction([ 'functionId' => ID::unique(), - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'name' => 'Logging Test', 'entrypoint' => 'index.js', 'logging' => false, @@ -1908,7 +1844,7 @@ class FunctionsCustomServerTest extends Scope $domain = $this->setupFunctionDomain($functionId); $this->setupDeployment($functionId, [ - 'code' => $this->packageFunction('node'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -1985,7 +1921,7 @@ class FunctionsCustomServerTest extends Scope // Check if the function specifications are correctly set in builds $function = $this->createFunction([ 'functionId' => ID::unique(), - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'name' => 'Specification Test', 'entrypoint' => 'index.js', 'logging' => false, @@ -2001,7 +1937,7 @@ class FunctionsCustomServerTest extends Scope $functionId = $functionId = $function['body']['$id'] ?? ''; $deploymentId = $this->setupDeployment($functionId, [ - 'code' => $this->packageFunction('node'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -2027,7 +1963,7 @@ class FunctionsCustomServerTest extends Scope { $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'name' => 'Duplicate Deployment Test', 'entrypoint' => 'index.js', 'commands' => '' @@ -2035,7 +1971,7 @@ class FunctionsCustomServerTest extends Scope $this->assertNotEmpty($functionId); $deploymentId1 = $this->setupDeployment($functionId, [ - 'code' => $this->packageFunction('node'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); $this->assertNotEmpty($deploymentId1); @@ -2045,7 +1981,7 @@ class FunctionsCustomServerTest extends Scope $this->assertStringContainsString('APPWRITE_FUNCTION_ID', $execution['body']['responseBody']); $function = $this->updateFunction($functionId, [ - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'name' => 'Duplicate Deployment Test', 'entrypoint' => 'index.js', 'commands' => 'rm index.js && mv maintenance.js index.js' @@ -2089,13 +2025,12 @@ class FunctionsCustomServerTest extends Scope $functionId = $this->setupFunction([ 'functionId' => ID::unique(), - 'runtime' => 'php-8.0', + 'runtime' => 'node-22', 'name' => 'Re-activate Test', - 'entrypoint' => 'index.php', + 'entrypoint' => 'index.js', ]); $this->assertNotEmpty($functionId); - $function = $this->getFunction($functionId); $this->assertEquals(200, $function['headers']['status-code']); $this->assertArrayHasKey('latestDeploymentId', $function['body']); @@ -2106,7 +2041,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEmpty($function['body']['latestDeploymentStatus']); $deploymentId1 = $this->setupDeployment($functionId, [ - 'code' => $this->packageFunction('php-cookie'), + 'code' => $this->packageFunction('cookies'), 'activate' => true ]); $this->assertNotEmpty($deploymentId1); @@ -2124,7 +2059,7 @@ class FunctionsCustomServerTest extends Scope $this->assertStringContainsString('cookieValue', $execution['body']['responseBody']); $deploymentId2 = $this->setupDeployment($functionId, [ - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); $this->assertNotEmpty($deploymentId2); @@ -2192,8 +2127,8 @@ class FunctionsCustomServerTest extends Scope $functionId = $this->setupFunction([ 'functionId' => ID::unique(), 'name' => 'Test Error Pages', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'commands' => 'cd non-existing-directory', 'execute' => ['any'] @@ -2203,8 +2138,7 @@ class FunctionsCustomServerTest extends Scope $proxyClient->setEndpoint('http://' . $domain); $deployment = $this->createDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -2221,8 +2155,7 @@ class FunctionsCustomServerTest extends Scope // canceled deployment $deployment = $this->createDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -2250,8 +2183,8 @@ class FunctionsCustomServerTest extends Scope $functionId = $this->setupFunction([ 'functionId' => ID::unique(), 'name' => 'Test Error Pages', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'commands' => '', 'execute' => ['users'] @@ -2262,7 +2195,7 @@ class FunctionsCustomServerTest extends Scope $proxyClient->setEndpoint('http://' . $domain); $deploymentId = $this->setupDeployment($functionId, [ - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); $this->assertNotEmpty($deploymentId); @@ -2284,8 +2217,8 @@ class FunctionsCustomServerTest extends Scope $functionId = $this->setupFunction([ 'functionId' => ID::unique(), 'name' => 'Test Error Pages', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 15, 'commands' => '', 'execute' => ['any'] @@ -2296,7 +2229,7 @@ class FunctionsCustomServerTest extends Scope $proxyClient->setEndpoint('http://' . $domain); $deploymentId = $this->setupDeployment($functionId, [ - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); $this->assertNotEmpty($deploymentId); diff --git a/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php b/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php index 4f4b0c960d..c3dd2c7fc8 100644 --- a/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php +++ b/tests/e2e/Services/FunctionsSchedule/FunctionsScheduleTest.php @@ -25,8 +25,8 @@ class FunctionsScheduleTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::user($this->getUser()['$id'])->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'users.*.create', 'users.*.delete', @@ -36,8 +36,7 @@ class FunctionsScheduleTest extends Scope ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -77,14 +76,13 @@ class FunctionsScheduleTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::user($this->getUser()['$id'])->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 10, 'logging' => true, ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -179,15 +177,14 @@ class FunctionsScheduleTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::user($this->getUser()['$id'])->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 10, 'logging' => true, ]); $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); diff --git a/tests/e2e/Services/GraphQL/FunctionsClientTest.php b/tests/e2e/Services/GraphQL/FunctionsClientTest.php index 14b714d551..ea2723b803 100644 --- a/tests/e2e/Services/GraphQL/FunctionsClientTest.php +++ b/tests/e2e/Services/GraphQL/FunctionsClientTest.php @@ -26,8 +26,8 @@ class FunctionsClientTest extends Scope 'variables' => [ 'functionId' => ID::unique(), 'name' => 'Test Function', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'execute' => [Role::any()->toString()], ] ]; @@ -96,7 +96,7 @@ class FunctionsClientTest extends Scope 'map' => \json_encode([ 'code' => ["variables.code"] ]), - 'code' => $this->packageFunction('php') + 'code' => $this->packageFunction('basic') ]; $deployment = $this->client->call(Client::METHOD_POST, '/graphql', [ diff --git a/tests/e2e/Services/GraphQL/FunctionsServerTest.php b/tests/e2e/Services/GraphQL/FunctionsServerTest.php index d211dcceea..de419ebf0e 100644 --- a/tests/e2e/Services/GraphQL/FunctionsServerTest.php +++ b/tests/e2e/Services/GraphQL/FunctionsServerTest.php @@ -26,8 +26,8 @@ class FunctionsServerTest extends Scope 'variables' => [ 'functionId' => ID::unique(), 'name' => 'Test Function', - 'entrypoint' => 'index.php', - 'runtime' => 'php-8.0', + 'entrypoint' => 'index.js', + 'runtime' => 'node-22', 'execute' => [Role::any()->toString()], ] ]; @@ -95,7 +95,7 @@ class FunctionsServerTest extends Scope 'map' => \json_encode([ 'code' => ["variables.code"] ]), - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), ]; $deployment = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([ diff --git a/tests/e2e/Services/Messaging/MessagingConsoleClientTest.php b/tests/e2e/Services/Messaging/MessagingConsoleClientTest.php index 245eb3e8de..49d13128e2 100644 --- a/tests/e2e/Services/Messaging/MessagingConsoleClientTest.php +++ b/tests/e2e/Services/Messaging/MessagingConsoleClientTest.php @@ -206,15 +206,17 @@ class MessagingConsoleClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); - $logs = $this->client->call(Client::METHOD_GET, '/messaging/topics/' . $topic['body']['$id'] . '/logs', \array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); + $this->assertEventually(function () use ($topic) { + $logs = $this->client->call(Client::METHOD_GET, '/messaging/topics/' . $topic['body']['$id'] . '/logs', \array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); - $this->assertEquals($logs['headers']['status-code'], 200); - $this->assertIsArray($logs['body']['logs']); - $this->assertCount(2, $logs['body']['logs']); - $this->assertIsNumeric($logs['body']['total']); + $this->assertEquals($logs['headers']['status-code'], 200); + $this->assertIsArray($logs['body']['logs']); + $this->assertCount(2, $logs['body']['logs']); + $this->assertIsNumeric($logs['body']['total']); + }); $logs = $this->client->call(Client::METHOD_GET, '/messaging/topics/' . $topic['body']['$id'] . '/logs', \array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Migrations/MigrationsBase.php b/tests/e2e/Services/Migrations/MigrationsBase.php index c241b38e3d..6bc1f2d427 100644 --- a/tests/e2e/Services/Migrations/MigrationsBase.php +++ b/tests/e2e/Services/Migrations/MigrationsBase.php @@ -805,13 +805,12 @@ trait MigrationsBase $functionId = $this->setupFunction([ 'functionId' => ID::unique(), 'name' => 'Test', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php' + 'runtime' => 'node-22', + 'entrypoint' => 'index.js' ]); $deploymentId = $this->setupDeployment($functionId, [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -855,8 +854,8 @@ trait MigrationsBase $this->assertEquals($functionId, $response['body']['$id']); $this->assertEquals('Test', $response['body']['name']); - $this->assertEquals('php-8.0', $response['body']['runtime']); - $this->assertEquals('index.php', $response['body']['entrypoint']); + $this->assertEquals('node-22', $response['body']['runtime']); + $this->assertEquals('index.js', $response['body']['entrypoint']); $this->assertEventually(function () use ($functionId) { @@ -871,7 +870,7 @@ trait MigrationsBase $this->assertEquals(1, $deployments['body']['total']); $this->assertEquals('ready', $deployments['body']['deployments'][0]['status'], 'Deployment status is not ready, deployment: ' . json_encode($deployments['body']['deployments'][0], JSON_PRETTY_PRINT)); - }, 50000, 500); + }, 100000, 500); // Attempt execution $execution = $this->client->call(Client::METHOD_POST, '/functions/' . $functionId . '/executions', [ diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index aea1971be7..2a27587999 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -4637,7 +4637,6 @@ class ProjectsConsoleClientTest extends Scope 'failure' => 'https://example.com' ]); $this->assertEquals(400, $response['headers']['status-code']); - $this->assertStringContainsString('Invalid `success` param: URL host must be one of: localhost, appwrite.io, *.appwrite.io', $response['body']); /** Test oauth2 with devKey and now get oauth2 is disabled */ $response = $this->client->call(Client::METHOD_GET, '/account/sessions/oauth2/' . $provider, [ @@ -4660,7 +4659,6 @@ class ProjectsConsoleClientTest extends Scope 'url' => 'https://example.com', ]); $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('Invalid `url` param: URL host must be one of: localhost, appwrite.io, *.appwrite.io', $response['body']['message']); /** Test hostname in Magic URL with devKey */ $response = $this->client->call(Client::METHOD_POST, '/account/sessions/magic-url', [ diff --git a/tests/e2e/Services/Projects/ProjectsCustomServerTest.php b/tests/e2e/Services/Projects/ProjectsCustomServerTest.php index a01073f3a3..68ff53ae55 100644 --- a/tests/e2e/Services/Projects/ProjectsCustomServerTest.php +++ b/tests/e2e/Services/Projects/ProjectsCustomServerTest.php @@ -30,8 +30,6 @@ class ProjectsCustomServerTest extends Scope 'domain' => $testId . '-api.appwrite.test', ]); - \var_dump($response); - $this->assertEquals(201, $response['headers']['status-code']); $response = $this->client->call(Client::METHOD_POST, '/proxy/rules/api', $headers, [ diff --git a/tests/e2e/Services/Proxy/ProxyBase.php b/tests/e2e/Services/Proxy/ProxyBase.php index 44e015b751..c6d63495a0 100644 --- a/tests/e2e/Services/Proxy/ProxyBase.php +++ b/tests/e2e/Services/Proxy/ProxyBase.php @@ -68,7 +68,7 @@ trait ProxyBase return $rule; } - protected function createRedirectRule(string $domain, string $url, int $statusCode): mixed + protected function createRedirectRule(string $domain, string $url, int $statusCode, string $resourceType, string $resourceId): mixed { $rule = $this->client->call(Client::METHOD_POST, '/proxy/rules/redirect', array_merge([ 'content-type' => 'application/json', @@ -77,6 +77,8 @@ trait ProxyBase 'domain' => $domain, 'url' => $url, 'statusCode' => $statusCode, + 'resourceType' => $resourceType, + 'resourceId' => $resourceId, ]); return $rule; @@ -115,9 +117,9 @@ trait ProxyBase return $rule['body']['$id']; } - protected function setupRedirectRule(string $domain, string $url, int $statusCode): string + protected function setupRedirectRule(string $domain, string $url, int $statusCode, string $resourceType, string $resourceId): string { - $rule = $this->createRedirectRule($domain, $url, $statusCode); + $rule = $this->createRedirectRule($domain, $url, $statusCode, $resourceType, $resourceId); $this->assertEquals(201, $rule['headers']['status-code'], 'Failed to setup rule: ' . \json_encode($rule)); @@ -225,7 +227,7 @@ trait ProxyBase 'x-appwrite-key' => $this->getProject()['apiKey'], ]), [ 'functionId' => ID::unique(), - 'runtime' => 'node-18.0', + 'runtime' => 'node-22', 'name' => 'Proxy Function', 'entrypoint' => 'index.js', 'commands' => '', @@ -242,7 +244,7 @@ trait ProxyBase 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], ]), [ - 'code' => $this->packageFunction('node'), + 'code' => $this->packageFunction('basic'), 'activate' => 'true' ]); diff --git a/tests/e2e/Services/Proxy/ProxyCustomServerTest.php b/tests/e2e/Services/Proxy/ProxyCustomServerTest.php index 9a7ba74ec1..ea310d5449 100644 --- a/tests/e2e/Services/Proxy/ProxyCustomServerTest.php +++ b/tests/e2e/Services/Proxy/ProxyCustomServerTest.php @@ -131,7 +131,9 @@ class ProxyCustomServerTest extends Scope $response = $proxyClient->call(Client::METHOD_GET, '/todos/1'); $this->assertEquals(404, $response['headers']['status-code']); - $ruleId = $this->setupRedirectRule($domain, 'https://jsonplaceholder.typicode.com/todos/1', 301); + $siteId = $this->setupSite()['siteId']; + + $ruleId = $this->setupRedirectRule($domain, 'https://jsonplaceholder.typicode.com/todos/1', 301, 'site', $siteId); $this->assertNotEmpty($ruleId); $response = $proxyClient->call(Client::METHOD_GET, '/todos/1'); @@ -147,7 +149,7 @@ class ProxyCustomServerTest extends Scope $this->assertEquals('https://jsonplaceholder.typicode.com/todos/1', $response['headers']['location']); $domain = \uniqid() . '-redirect-307.custom.localhost'; - $ruleId = $this->setupRedirectRule($domain, 'https://jsonplaceholder.typicode.com/todos/1', 307); + $ruleId = $this->setupRedirectRule($domain, 'https://jsonplaceholder.typicode.com/todos/1', 307, 'site', $siteId); $this->assertNotEmpty($ruleId); $proxyClient = new Client(); @@ -158,6 +160,18 @@ class ProxyCustomServerTest extends Scope $this->assertEquals(307, $response['headers']['status-code']); $this->assertEquals('https://jsonplaceholder.typicode.com/todos/1', $response['headers']['location']); + $rules = $this->listRules([ + 'queries' => [ + Query::equal('type', ['redirect'])->toString(), + Query::equal('trigger', ['manual'])->toString(), + Query::equal('deploymentResourceType', ['site'])->toString(), + Query::equal('deploymentResourceId', [$siteId])->toString(), + ], + ]); + $this->assertEquals(200, $rules['headers']['status-code']); + $this->assertEquals(2, $rules['body']['total']); + + $this->cleanupSite($siteId); $this->cleanupRule($ruleId); } diff --git a/tests/e2e/Services/Realtime/RealtimeBase.php b/tests/e2e/Services/Realtime/RealtimeBase.php index 99f31134c0..1350b305fc 100644 --- a/tests/e2e/Services/Realtime/RealtimeBase.php +++ b/tests/e2e/Services/Realtime/RealtimeBase.php @@ -16,13 +16,6 @@ trait RealtimeBase $projectId = $this->getProject()['$id']; } - $headers = array_merge( - [ - "Origin" => "appwrite.test", - ], - $headers - ); - $query = [ "project" => $projectId, "channels" => $channels, @@ -49,7 +42,7 @@ trait RealtimeBase public function testConnectionFailureMissingChannels(): void { - $client = $this->getWebsocket(); + $client = $this->getWebsocket([]); $payload = json_decode($client->receive(), true); $this->assertArrayHasKey("type", $payload); @@ -64,14 +57,7 @@ trait RealtimeBase public function testConnectionFailureUnknownProject(): void { - $client = new WebSocketClient( - "ws://appwrite-traefik/v1/realtime?project=123", - [ - "headers" => [ - "Origin" => "appwrite.test", - ], - ] - ); + $client = $this->getWebsocket(projectId: '123'); $payload = json_decode($client->receive(), true); $this->assertArrayHasKey("type", $payload); diff --git a/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php b/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php index ba2d18694a..80b4ae46d2 100644 --- a/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php @@ -524,8 +524,8 @@ class RealtimeConsoleClientTest extends Scope ], $this->getHeaders()), [ 'functionId' => ID::unique(), 'name' => 'Test', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'events' => [ 'users.*.create', 'users.*.delete', @@ -564,8 +564,7 @@ class RealtimeConsoleClientTest extends Scope 'content-type' => 'multipart/form-data', 'x-appwrite-project' => $projectId, ], $this->getHeaders()), [ - 'entrypoint' => 'index.php', - 'code' => $this->packageFunction('php'), + 'code' => $this->packageFunction('basic'), 'activate' => true ]); @@ -607,10 +606,8 @@ class RealtimeConsoleClientTest extends Scope $this->assertContains("projects.{$projectId}", $response['data']['channels']); $this->assertArrayHasKey('buildLogs', $response['data']['payload']); - if (!empty($response['data']['payload']['buildEndedAt'])) { - $this->assertNotEmpty($response['data']['payload']['buildEndedAt']); + if (!empty($response['data']['payload']['buildSize'])) { $this->assertNotEmpty($response['data']['payload']['buildStartedAt']); - $this->assertNotEmpty($response['data']['payload']['buildDuration']); $this->assertNotEmpty($response['data']['payload']['buildPath']); $this->assertNotEmpty($response['data']['payload']['buildSize']); $this->assertNotEmpty($response['data']['payload']['totalSize']); @@ -634,6 +631,13 @@ class RealtimeConsoleClientTest extends Scope $this->assertContains("projects.{$projectId}", $response['data']['channels']); $this->assertEquals("ready", $response['data']['payload']['status']); + $response = json_decode($client->receive(), true); + $this->assertContains("functions.{$functionId}.deployments.{$deploymentId}.update", $response['data']['events']); + $this->assertContains('console', $response['data']['channels']); + $this->assertContains("projects.{$projectId}", $response['data']['channels']); + $this->assertNotEmpty($response['data']['payload']['buildDuration']); + $this->assertNotEmpty($response['data']['payload']['buildEndedAt']); + $client->close(); } } diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index 9e3f1a66b7..25a5488046 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -415,7 +415,8 @@ class RealtimeCustomClientTest extends Scope $this->assertContains("users.*", $response['data']['events']); $lastEmail = $this->getLastEmail(); - $verification = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); + $verification = $tokens['secret']; /** * Test Account Verification Complete @@ -612,7 +613,8 @@ class RealtimeCustomClientTest extends Scope $response = json_decode($client->receive(), true); $lastEmail = $this->getLastEmail(); - $recovery = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); + $recovery = $tokens['secret']; $this->assertArrayHasKey('type', $response); $this->assertArrayHasKey('data', $response); @@ -1283,10 +1285,10 @@ class RealtimeCustomClientTest extends Scope 'x-appwrite-key' => $this->getProject()['apiKey'] ], [ 'functionId' => ID::unique(), - 'name' => 'Test', + 'name' => 'Test timeout execution', 'execute' => ['users'], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 10, ]); @@ -1300,7 +1302,6 @@ class RealtimeCustomClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'] ]), [ - 'entrypoint' => 'index.php', 'code' => $this->packageFunction('timeout'), 'activate' => true ]); diff --git a/tests/e2e/Services/Sites/SitesBase.php b/tests/e2e/Services/Sites/SitesBase.php index 00edcc1b72..2054744863 100644 --- a/tests/e2e/Services/Sites/SitesBase.php +++ b/tests/e2e/Services/Sites/SitesBase.php @@ -265,7 +265,7 @@ trait SitesBase $this->assertEventually(function () use ($siteId, $deploymentId) { $deployment = $this->getDeployment($siteId, $deploymentId); $this->assertEquals('ready', $deployment['body']['status'], 'Deployment status is not ready, deployment: ' . json_encode($deployment['body'], JSON_PRETTY_PRINT)); - }, 100000, 500); + }, 150000, 500); $this->assertEventually(function () use ($siteId, $deploymentId) { $site = $this->getSite($siteId); diff --git a/tests/e2e/Services/Sites/SitesConsoleClientTest.php b/tests/e2e/Services/Sites/SitesConsoleClientTest.php index 1a84f46ed7..28ce2a35ec 100644 --- a/tests/e2e/Services/Sites/SitesConsoleClientTest.php +++ b/tests/e2e/Services/Sites/SitesConsoleClientTest.php @@ -14,6 +14,9 @@ class SitesConsoleClientTest extends Scope use SideConsole; use SitesBase; + /** + * @group screenshots + */ public function testSiteScreenshot(): void { $siteId = $this->setupSite([ diff --git a/tests/e2e/Services/Sites/SitesCustomClientTest.php b/tests/e2e/Services/Sites/SitesCustomClientTest.php index 9bf389ea62..42fe26d216 100644 --- a/tests/e2e/Services/Sites/SitesCustomClientTest.php +++ b/tests/e2e/Services/Sites/SitesCustomClientTest.php @@ -6,6 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; +use Utopia\System\System; class SitesCustomClientTest extends Scope { @@ -121,6 +122,7 @@ class SitesCustomClientTest extends Scope * Test for SUCCESS */ $template = $this->getTemplate('starter-for-react'); + $hostname = System::getEnv('_APP_DOMAIN') ?: ''; $this->assertEquals(200, $template['headers']['status-code']); $this->assertIsArray($template['body']); $this->assertEquals('starter-for-react', $template['body']['key']); @@ -129,8 +131,8 @@ class SitesCustomClientTest extends Scope $this->assertEquals('github', $template['body']['vcsProvider']); $this->assertEquals('Simple React application integrated with Appwrite SDK.', $template['body']['tagline']); $this->assertIsArray($template['body']['frameworks']); - $this->assertEquals('http://localhost/images/sites/templates/starter-for-react-dark.png', $template['body']['screenshotDark']); - $this->assertEquals('http://localhost/images/sites/templates/starter-for-react-light.png', $template['body']['screenshotLight']); + $this->assertEquals('http://'. $hostname . '/images/sites/templates/starter-for-react-dark.png', $template['body']['screenshotDark']); + $this->assertEquals('http://' . $hostname . '/images/sites/templates/starter-for-react-light.png', $template['body']['screenshotLight']); /** * Test for FAILURE diff --git a/tests/e2e/Services/Sites/SitesCustomServerTest.php b/tests/e2e/Services/Sites/SitesCustomServerTest.php index d3b4922b87..8680ca191c 100644 --- a/tests/e2e/Services/Sites/SitesCustomServerTest.php +++ b/tests/e2e/Services/Sites/SitesCustomServerTest.php @@ -477,7 +477,7 @@ class SitesCustomServerTest extends Scope $this->assertNotEmpty($domain); $deploymentId = $this->setupDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'true' ]); $this->assertNotEmpty($deploymentId); @@ -856,7 +856,7 @@ class SitesCustomServerTest extends Scope $deployment = $this->createDeployment($siteId, [ 'siteId' => $siteId, - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => true, ]); @@ -874,7 +874,7 @@ class SitesCustomServerTest extends Scope }, 50000, 500); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'false' ]); @@ -917,7 +917,7 @@ class SitesCustomServerTest extends Scope $this->assertNotNull($siteId); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'false' ]); @@ -937,12 +937,12 @@ class SitesCustomServerTest extends Scope $this->assertEquals(200, $deployment['headers']['status-code']); $this->assertEquals('canceled', $deployment['body']['status']); - /** - * Build worker still runs the build. - * 30s sleep gives worker enough time to finish build. - * After build finished, it should still be canceled, not ready. - */ - \sleep(30); + // Ensures worker got eventually aware of cancellation and reacted properly + $this->assertEventually(function () use ($siteId, $deploymentId) { + $deployment = $this->getDeployment($siteId, $deploymentId); + $this->assertEquals(200, $deployment['headers']['status-code']); + $this->assertStringContainsString('Build has been canceled.', $deployment['body']['buildLogs']); + }); $deployment = $this->getDeployment($siteId, $deploymentId); @@ -969,7 +969,7 @@ class SitesCustomServerTest extends Scope $this->assertNotNull($siteId); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'false' ]); @@ -1014,7 +1014,7 @@ class SitesCustomServerTest extends Scope $this->assertNotNull($siteId); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'false' ]); @@ -1022,7 +1022,7 @@ class SitesCustomServerTest extends Scope $this->assertEquals(202, $deployment['headers']['status-code']); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'false' ]); @@ -1193,7 +1193,7 @@ class SitesCustomServerTest extends Scope $this->assertNotNull($siteId); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'false' ]); @@ -1318,7 +1318,7 @@ class SitesCustomServerTest extends Scope $this->assertNotNull($siteId); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'false' ]); @@ -1446,7 +1446,7 @@ class SitesCustomServerTest extends Scope $this->assertEquals(404, $response['headers']['status-code']); $this->assertStringContainsString("Page not found", $response['body']); // Title $this->assertStringContainsString("Go to homepage", $response['body']); // Button - $this->assertStringContainsString("Powered by", $response['body']); // Brand + $this->assertStringNotContainsString("Powered by", $response['body']); // Brand $this->cleanupSite($siteId); } @@ -1502,7 +1502,7 @@ class SitesCustomServerTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); $this->assertStringContainsString("Customized 404 page", $response['body']); - $this->assertStringNotContainsString("Powered by", $response['body']); // Brand + $this->assertStringNotContainsString("Powered by", $response['body']); //brand $this->cleanupSite($siteId); } @@ -1818,7 +1818,7 @@ class SitesCustomServerTest extends Scope ]); $deploymentId = $this->setupDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => true ]); @@ -2435,7 +2435,7 @@ class SitesCustomServerTest extends Scope $this->assertNotEmpty($siteId); $deploymentId = $this->setupDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'true' ]); @@ -2477,7 +2477,7 @@ class SitesCustomServerTest extends Scope // test canceled deployment error page $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'true' ]); $deploymentId = $deployment['body']['$id'] ?? ''; @@ -2517,7 +2517,7 @@ class SitesCustomServerTest extends Scope $this->assertStringContainsString('View deployments', $response['body']); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('astro'), + 'code' => $this->packageSite('static-single-file'), 'activate' => 'true' ]); @@ -2606,7 +2606,7 @@ class SitesCustomServerTest extends Scope $this->assertNotEmpty($siteId); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => true ]); $this->assertEquals(202, $deployment['headers']['status-code']); @@ -2635,7 +2635,7 @@ class SitesCustomServerTest extends Scope $this->assertNotEmpty($siteId); $deployment = $this->createDeployment($siteId, [ - 'code' => $this->packageSite('static'), + 'code' => $this->packageSite('static-single-file'), 'activate' => true ]); $this->assertEquals(202, $deployment['headers']['status-code']); diff --git a/tests/e2e/Services/Teams/TeamsBase.php b/tests/e2e/Services/Teams/TeamsBase.php index 80ac1621ee..fccfded1e1 100644 --- a/tests/e2e/Services/Teams/TeamsBase.php +++ b/tests/e2e/Services/Teams/TeamsBase.php @@ -64,7 +64,7 @@ trait TeamsBase // Step 4: Assert failure — cannot remove the only OWNER from a team $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('general_argument_invalid', $response['body']['type']); + $this->assertEquals('membership_downgrade_prohibited', $response['body']['type']); $this->assertEquals('There must be at least one owner in the organization.', $response['body']['message']); } diff --git a/tests/e2e/Services/Teams/TeamsBaseClient.php b/tests/e2e/Services/Teams/TeamsBaseClient.php index 1858fd50ad..5c8e94feb1 100644 --- a/tests/e2e/Services/Teams/TeamsBaseClient.php +++ b/tests/e2e/Services/Teams/TeamsBaseClient.php @@ -223,8 +223,10 @@ trait TeamsBaseClient $this->assertEquals($email, $lastEmail['to'][0]['address']); $this->assertEquals($name, $lastEmail['to'][0]['name']); $this->assertEquals('Invitation to ' . $teamName . ' Team at ' . $this->getProject()['name'], $lastEmail['subject']); - $this->assertEquals($response['body']['teamId'], substr($lastEmail['text'], strpos($lastEmail['text'], '&teamId=', 0) + 8, 20)); - $this->assertEquals($teamName, substr($lastEmail['text'], strpos($lastEmail['text'], '&teamName=', 0) + 10, 7)); + + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); + $this->assertEquals($teamName, $tokens['teamName']); + $this->assertEquals($response['body']['teamId'], $tokens['teamId']); /** * Test with UserId @@ -288,8 +290,10 @@ trait TeamsBaseClient $this->assertEquals($secondEmail, $lastEmail['to'][0]['address']); $this->assertEquals($secondName, $lastEmail['to'][0]['name']); $this->assertEquals('Invitation to ' . $teamName . ' Team at ' . $this->getProject()['name'], $lastEmail['subject']); - $this->assertEquals($response['body']['teamId'], substr($lastEmail['text'], strpos($lastEmail['text'], '&teamId=', 0) + 8, 20)); - $this->assertEquals($teamName, substr($lastEmail['text'], strpos($lastEmail['text'], '&teamName=', 0) + 10, 7)); + + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); + $this->assertEquals($teamName, $tokens['teamName']); + $this->assertEquals($response['body']['teamId'], $tokens['teamId']); // test for resending invitation $response = $this->client->call(Client::METHOD_POST, '/teams/' . $teamUid . '/memberships', array_merge([ @@ -305,9 +309,10 @@ trait TeamsBaseClient $this->assertEquals(201, $response['headers']['status-code']); $lastEmail = $this->getLastEmail(); - $membershipUid = substr($lastEmail['text'], strpos($lastEmail['text'], '?membershipId=', 0) + 14, 20); - $userUid = substr($lastEmail['text'], strpos($lastEmail['text'], '&userId=', 0) + 8, 20); - $secret = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); + $membershipUid = $tokens['membershipId']; + $userUid = $tokens['userId']; + $secret = $tokens['secret']; /** * Test for FAILURE @@ -338,11 +343,11 @@ trait TeamsBaseClient $this->assertEquals(400, $response['headers']['status-code']); return [ - 'teamUid' => $teamUid, - 'teamName' => $teamName, - 'secret' => $secret, - 'membershipUid' => $membershipUid, - 'userUid' => $userUid, + 'teamUid' => $tokens['teamId'], + 'teamName' => $tokens['teamName'], + 'secret' => $tokens['secret'], + 'membershipUid' => $tokens['membershipId'], + 'userUid' => $tokens['userId'], 'email' => $email, 'name' => $name ]; @@ -600,10 +605,11 @@ trait TeamsBaseClient $this->assertEquals(201, $response['headers']['status-code']); $lastEmail = $this->getLastEmail(); + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html']); - $secret = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); - $membershipUid = substr($lastEmail['text'], strpos($lastEmail['text'], '?membershipId=', 0) + 14, 20); - $userUid = substr($lastEmail['text'], strpos($lastEmail['text'], '&userId=', 0) + 8, 20); + $secret = $tokens['secret']; + $membershipUid = $tokens['membershipId']; + $userUid = $tokens['userId']; $response = $this->client->call(Client::METHOD_PATCH, '/teams/' . $teamUid . '/memberships/' . $membershipUid . '/status', [ 'origin' => 'http://localhost', diff --git a/tests/e2e/Services/Teams/TeamsConsoleClientTest.php b/tests/e2e/Services/Teams/TeamsConsoleClientTest.php index f096831a76..7949761d7f 100644 --- a/tests/e2e/Services/Teams/TeamsConsoleClientTest.php +++ b/tests/e2e/Services/Teams/TeamsConsoleClientTest.php @@ -65,7 +65,7 @@ class TeamsConsoleClientTest extends Scope /** * Test for SUCCESS */ - $response = $this->client->call(Client::METHOD_POST, '/teams/' . $teamUid . '/memberships', array_merge([ + $developer = $this->client->call(Client::METHOD_POST, '/teams/' . $teamUid . '/memberships', array_merge([ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ @@ -75,7 +75,8 @@ class TeamsConsoleClientTest extends Scope 'url' => 'http://localhost:5000/join-us#title' ]); - $this->assertEquals(201, $response['headers']['status-code']); + $developerUserId = $developer['body']['$id']; + $this->assertEquals(201, $developer['headers']['status-code']); $response = $this->client->call(Client::METHOD_GET, '/users', array_merge([ 'content-type' => 'application/json', @@ -90,13 +91,26 @@ class TeamsConsoleClientTest extends Scope $this->assertEquals(200, $response['headers']['status-code']); - $ownerMembershipUid = $response['body']['memberships'][1]['$id']; + $ownerMembershipUid = $response['body']['memberships'][0]['$id']; $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid . '/memberships/' . $ownerMembershipUid, array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders())); + + $this->assertEquals(400, $response['headers']['status-code']); + $this->assertEquals('membership_deletion_prohibited', $response['body']['type']); + $this->assertEquals('There must be at least one owner in the organization.', $response['body']['message']); + + // Remove the excess developer member to reduce the membership count in `TeamsBaseClient` tests. + // This is necessary because the only owner cannot be removed in the console project / top level team / organization. + $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid . '/memberships/' . $developerUserId, array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(204, $response['headers']['status-code']); return $data; @@ -109,21 +123,6 @@ class TeamsConsoleClientTest extends Scope $membershipUid = $data['membershipUid'] ?? ''; $session = $data['session'] ?? ''; - /** - * Test for FAILURE - */ - $roles = ['developer']; - $response = $this->client->call(Client::METHOD_PATCH, '/teams/' . $teamUid . '/memberships/' . $membershipUid, array_merge([ - 'origin' => 'http://localhost', - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), [ - 'roles' => $roles - ]); - - $this->assertEquals(400, $response['headers']['status-code']); - $this->assertEquals('There must be at least one owner in the organization.', $response['body']['message']); - /** * Test for unknown team */ @@ -132,7 +131,7 @@ class TeamsConsoleClientTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'roles' => $roles + 'roles' => ['developer'] ]); $this->assertEquals(404, $response['headers']['status-code']); @@ -145,7 +144,7 @@ class TeamsConsoleClientTest extends Scope 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'roles' => $roles + 'roles' => ['developer'] ]); $this->assertEquals(404, $response['headers']['status-code']); @@ -160,7 +159,7 @@ class TeamsConsoleClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ], [ - 'roles' => $roles + 'roles' => ['developer'] ]); $this->assertEquals(401, $response['headers']['status-code']); @@ -168,4 +167,89 @@ class TeamsConsoleClientTest extends Scope return $data; } + + /** + * @depends testUpdateTeamMembershipRoles + */ + public function testDeleteTeamMembership($data): array + { + $teamUid = $data['teamUid'] ?? ''; + $membershipUid = $data['membershipUid'] ?? ''; + $session = $data['session'] ?? ''; + + $response = $this->client->call(Client::METHOD_GET, '/teams/' . $teamUid . '/memberships', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(3, $response['body']['total']); + + $ownerMembershipUid = $response['body']['memberships'][0]['$id']; + + /** + * Test deleting a membership that does not exists + */ + $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid . '/memberships/dne', [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ]); + + $this->assertEquals(404, $response['headers']['status-code']); + + /** + * Test deleting another user's membership + */ + $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid . '/memberships/' . $ownerMembershipUid, [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ]); + + $this->assertEquals(401, $response['headers']['status-code']); + $this->assertEquals('The current user is not authorized to perform the requested action.', $response['body']['message']); + + $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid . '/memberships/' . $membershipUid, [ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ]); + + $this->assertEquals(204, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_GET, '/teams/' . $teamUid . '/memberships', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals(2, $response['body']['total']); + + /** + * Test for when the owner tries to delete their membership + */ + $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid . '/memberships/' . $ownerMembershipUid, array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(400, $response['headers']['status-code']); + $this->assertEquals('membership_deletion_prohibited', $response['body']['type']); + $this->assertEquals('There must be at least one owner in the organization.', $response['body']['message']); + + $response = $this->client->call(Client::METHOD_GET, '/teams/' . $teamUid . '/memberships/' . $ownerMembershipUid, array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + + $this->assertEquals(200, $response['headers']['status-code']); + + return []; + } } diff --git a/tests/e2e/Services/Teams/TeamsCustomClientTest.php b/tests/e2e/Services/Teams/TeamsCustomClientTest.php index 7286bb0827..e30dacac74 100644 --- a/tests/e2e/Services/Teams/TeamsCustomClientTest.php +++ b/tests/e2e/Services/Teams/TeamsCustomClientTest.php @@ -6,6 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; +use Utopia\CLI\Console; class TeamsCustomClientTest extends Scope { @@ -152,11 +153,14 @@ class TeamsCustomClientTest extends Scope $this->assertEquals(201, $response['headers']['status-code']); $email = $this->getLastEmail(); + Console::log(json_encode([ + 'testTeamsInviteHTMLInjection' => $email + ], JSON_PRETTY_PRINT)); + $encoded = 'http://localhost:5000/join-us\"></a><h1>INJECTED</h1>?'; $this->assertStringNotContainsString('<h1>INJECTED</h1>', $email['html']); $this->assertStringContainsString($encoded, $email['html']); - $this->assertStringContainsString($encoded, $email['text']); $response = $this->client->call(Client::METHOD_DELETE, '/teams/' . $teamUid . '/memberships/'.$response['body']['$id'], array_merge([ 'content-type' => 'application/json', diff --git a/tests/e2e/Services/Tokens/TokensBase.php b/tests/e2e/Services/Tokens/TokensBase.php index af93f5fc73..a4461c06c2 100644 --- a/tests/e2e/Services/Tokens/TokensBase.php +++ b/tests/e2e/Services/Tokens/TokensBase.php @@ -5,6 +5,8 @@ namespace Tests\E2E\Services\Tokens; use CURLFile; use Tests\E2E\Client; use Utopia\Database\Helpers\ID; +use Utopia\Database\Helpers\Permission; +use Utopia\Database\Helpers\Role; trait TokensBase { @@ -275,4 +277,88 @@ trait TokensBase $this->assertEquals($image->getImageHeight(), $original->getImageHeight()); $this->assertEquals('PNG', $image->getImageFormat()); } + + public function testFileAccessWithFileSecurity(): void + { + $bucket = $this->client->call( + Client::METHOD_POST, + '/storage/buckets', + [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], + [ + 'name' => 'Test Bucket', + 'bucketId' => ID::unique(), + 'fileSecurity' => true, + 'allowedFileExtensions' => ['jpg', 'png', 'jfif'], + ] + ); + + $this->assertEquals(201, $bucket['headers']['status-code']); + $this->assertNotEmpty($bucket['body']['$id']); + + $bucketId = $bucket['body']['$id']; + + $file = $this->client->call( + Client::METHOD_POST, + '/storage/buckets/' . $bucketId . '/files', + [ + 'content-type' => 'multipart/form-data', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], + [ + 'fileId' => ID::unique(), + 'permissions' => [ Permission::read(Role::label('devrel')) ], + 'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'logo.png'), + ] + ); + + $fileId = $file['body']['$id']; + + $token = $this->client->call( + Client::METHOD_POST, + '/tokens/buckets/' . $bucketId . '/files/' . $fileId, + [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ] + ); + + $jwtToken = $token['body']['secret']; + + $endpoints = ['preview', 'view', 'download']; + + foreach ($endpoints as $endpoint) { + $response = $this->client->call( + Client::METHOD_GET, + "/storage/buckets/$bucketId/files/$fileId/$endpoint", + [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], + [ + 'token' => $jwtToken + ] + ); + + $this->assertNotEmpty($response['body']); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals('image/png', $response['headers']['content-type']); + + if ($endpoint === 'download') { + $image = new \Imagick(); + $image->readImageBlob($response['body']); + $original = new \Imagick(__DIR__ . '/../../../resources/logo.png'); + + $this->assertEquals($original->getImageWidth(), $image->getImageWidth()); + $this->assertEquals($original->getImageHeight(), $image->getImageHeight()); + $this->assertEquals('PNG', $image->getImageFormat()); + } + } + + } } diff --git a/tests/e2e/Services/Webhooks/WebhooksBase.php b/tests/e2e/Services/Webhooks/WebhooksBase.php index c743810feb..83177c7ea3 100644 --- a/tests/e2e/Services/Webhooks/WebhooksBase.php +++ b/tests/e2e/Services/Webhooks/WebhooksBase.php @@ -921,7 +921,10 @@ trait WebhooksBase $lastEmail = $this->getLastEmail(); - $secret = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); + // `$isAppUser` — no email expected; + $tokens = $this->extractQueryParamsFromEmailLink($lastEmail['html'] ?? ''); + + $secret = $tokens['secret'] ?? ''; $membershipId = $team['body']['$id']; $webhook = $this->getLastRequest(); diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php index a170492551..bcc4ede30a 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php @@ -894,9 +894,9 @@ class WebhooksCustomClientTest extends Scope $url = $webhook['url']; $signatureExpected = base64_encode(hash_hmac('sha1', $url . $payload, $signatureKey, true)); - $this->assertEquals($webhook['method'], 'POST'); - $this->assertEquals($webhook['headers']['Content-Type'], 'application/json'); - $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); + $this->assertEquals('POST', $webhook['method']); + $this->assertEquals('application/json', $webhook['headers']['Content-Type']); + $this->assertEquals('Appwrite-Server vdev. Please report abuse at security@appwrite.io', $webhook['headers']['User-Agent']); $this->assertStringContainsString('teams.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('teams.*.memberships.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('teams.*.memberships.*.update', $webhook['headers']['X-Appwrite-Webhook-Events']); @@ -919,8 +919,8 @@ class WebhooksCustomClientTest extends Scope $this->assertNotEmpty($webhook['data']['userId']); $this->assertNotEmpty($webhook['data']['teamId']); $this->assertCount(2, $webhook['data']['roles']); - $this->assertEquals(true, (new DatetimeValidator())->isValid($webhook['data']['joined'])); - $this->assertEquals(true, $webhook['data']['confirm']); + $this->assertTrue((new DatetimeValidator())->isValid($webhook['data']['joined'])); + $this->assertTrue($webhook['data']['confirm']); /** * Test for FAILURE diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php index d2f132e960..2bb9d81eec 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php @@ -399,8 +399,8 @@ class WebhooksCustomServerTest extends Scope 'functionId' => ID::unique(), 'name' => 'Test', 'execute' => [Role::any()->toString()], - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'timeout' => 10, ]); @@ -439,8 +439,8 @@ class WebhooksCustomServerTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ 'name' => 'Test', - 'runtime' => 'php-8.0', - 'entrypoint' => 'index.php', + 'runtime' => 'node-22', + 'entrypoint' => 'index.js', 'execute' => [Role::any()->toString()], 'vars' => [ 'key1' => 'value1', @@ -496,7 +496,7 @@ class WebhooksCustomServerTest extends Scope 'content-type' => 'multipart/form-data', 'x-appwrite-project' => $this->getProject()['$id'], ], $this->getHeaders()), [ - 'entrypoint' => 'index.php', + 'entrypoint' => 'index.js', 'code' => new CURLFile($code, 'application/x-gzip', \basename($code)), 'activate' => true ]); diff --git a/tests/resources/functions/basic/index.js b/tests/resources/functions/basic/index.js new file mode 100644 index 0000000000..1eb9d38c58 --- /dev/null +++ b/tests/resources/functions/basic/index.js @@ -0,0 +1,46 @@ +module.exports = async(context) => { + context.log('log-works'); + context.error('error-log-works'); + + if(context.req.headers['x-appwrite-user-jwt']) { + context.log('jwt-is-valid'); + } else { + context.log('jwt-is-invalid'); + } + + if(context.req.path === '/custom-response') { + const code = +(context.req.query['code'] || '200'); + const body = context.req.query['body'] || ''; + return context.res.send(body, code); + } + + context.log('body-is-' + (context.req.body ?? '')); + context.log('custom-header-is-' + (context.req.headers['x-custom-header'] ?? '')); + context.log('method-is-' + (context.req.method ?? '').toLowerCase()); + context.log('path-is-' + (context.req.path ?? '')); + context.log('user-is-' + (context.req.headers['x-appwrite-user-id'] ?? '')); + + const statusCode = context.req.query['code'] || '200'; + + return context.res.json({ + 'APPWRITE_FUNCTION_ID' : process.env.APPWRITE_FUNCTION_ID ?? '', + 'APPWRITE_FUNCTION_NAME' : process.env.APPWRITE_FUNCTION_NAME ?? '', + 'APPWRITE_FUNCTION_DEPLOYMENT' : process.env.APPWRITE_FUNCTION_DEPLOYMENT ?? '', + 'APPWRITE_FUNCTION_TRIGGER' : context.req.headers['x-appwrite-trigger'] ?? '', + 'APPWRITE_FUNCTION_RUNTIME_NAME' : process.env.APPWRITE_FUNCTION_RUNTIME_NAME, + 'APPWRITE_FUNCTION_RUNTIME_VERSION' : process.env.APPWRITE_FUNCTION_RUNTIME_VERSION, + 'APPWRITE_VERSION' : process.env.APPWRITE_VERSION ?? '', + 'APPWRITE_REGION' : process.env.APPWRITE_REGION ?? '', + 'UNICODE_TEST' : "êä", + 'GLOBAL_VARIABLE' : process.env.GLOBAL_VARIABLE ?? '', + 'APPWRITE_FUNCTION_EVENT' : context.req.headers['x-appwrite-event'] ?? '', + 'APPWRITE_FUNCTION_EVENT_DATA' : context.req.bodyRaw ?? '', + 'APPWRITE_FUNCTION_DATA' : context.req.bodyRaw ?? '', + 'APPWRITE_FUNCTION_USER_ID' : context.req.headers['x-appwrite-user-id'] ?? '', + 'APPWRITE_FUNCTION_JWT' : context.req.headers['x-appwrite-user-jwt'] ?? '', + 'APPWRITE_FUNCTION_PROJECT_ID' : process.env.APPWRITE_FUNCTION_PROJECT_ID, + 'APPWRITE_FUNCTION_MEMORY' : process.env.APPWRITE_FUNCTION_MEMORY, + 'APPWRITE_FUNCTION_CPUS' : process.env.APPWRITE_FUNCTION_CPUS, + 'CUSTOM_VARIABLE' : process.env.CUSTOM_VARIABLE + }, +statusCode); +} \ No newline at end of file diff --git a/tests/resources/functions/node/maintenance.js b/tests/resources/functions/basic/maintenance.js similarity index 100% rename from tests/resources/functions/node/maintenance.js rename to tests/resources/functions/basic/maintenance.js diff --git a/tests/resources/functions/binary-request/index.js b/tests/resources/functions/binary-request/index.js new file mode 100644 index 0000000000..227df8dce6 --- /dev/null +++ b/tests/resources/functions/binary-request/index.js @@ -0,0 +1,6 @@ +const crypto = require('crypto') + +module.exports = async(context) => { + const hash = crypto.createHash('md5').update(context.req.bodyBinary).digest("hex") + return context.res.send(hash); +}; diff --git a/tests/resources/functions/binary-response/index.js b/tests/resources/functions/binary-response/index.js new file mode 100644 index 0000000000..284a593df0 --- /dev/null +++ b/tests/resources/functions/binary-response/index.js @@ -0,0 +1,4 @@ +module.exports = async(context) => { + const bytes = Buffer.from(Uint8Array.from([0, 10, 255])); + return context.res.binary(bytes); +}; diff --git a/tests/resources/functions/cookies/index.js b/tests/resources/functions/cookies/index.js new file mode 100644 index 0000000000..dd5dd7bd19 --- /dev/null +++ b/tests/resources/functions/cookies/index.js @@ -0,0 +1,3 @@ +module.exports = async(context) => { + return context.res.send(context.req.headers['cookie'] ?? ''); +}; diff --git a/tests/resources/functions/dart/main.dart b/tests/resources/functions/dart/main.dart deleted file mode 100644 index 1ed09c3485..0000000000 --- a/tests/resources/functions/dart/main.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'dart:io' show Platform; - -Future<dynamic> main(final context) async { - context.log('Amazing Function Log'); - - response.json({ - 'APPWRITE_FUNCTION_ID' : Platform.environment['APPWRITE_FUNCTION_ID'] ?? '', - 'APPWRITE_FUNCTION_NAME' : Platform.environment['APPWRITE_FUNCTION_NAME'] ?? '', - 'APPWRITE_FUNCTION_DEPLOYMENT' : Platform.environment['APPWRITE_FUNCTION_DEPLOYMENT'] ?? '', - 'APPWRITE_FUNCTION_TRIGGER' : context.req.headers['x-appwrite-trigger'] ?? '', - 'APPWRITE_FUNCTION_RUNTIME_NAME' : Platform.environment['APPWRITE_FUNCTION_RUNTIME_NAME'] ?? '', - 'APPWRITE_FUNCTION_RUNTIME_VERSION' : Platform.environment['APPWRITE_FUNCTION_RUNTIME_VERSION'] ?? '', - 'APPWRITE_FUNCTION_EVENT' : context.req.headers['x-appwrite-event'] ?? '', - 'APPWRITE_FUNCTION_EVENT_DATA' : context.req.bodyRaw ?? '', - 'APPWRITE_FUNCTION_DATA' : context.req.bodyRaw ?? '', - 'APPWRITE_FUNCTION_USER_ID' : context.req.headers['x-appwrite-user-id'] ?? '', - 'APPWRITE_FUNCTION_JWT' : context.req.headers['x-appwrite-user-jwt'] ?? '', - 'APPWRITE_FUNCTION_PROJECT_ID' : Platform.environment['APPWRITE_FUNCTION_PROJECT_ID'] ?? '', - 'CUSTOM_VARIABLE' : request.variables['CUSTOM_VARIABLE'] - }); -} \ No newline at end of file diff --git a/tests/resources/functions/dynamic-api-key/index.js b/tests/resources/functions/dynamic-api-key/index.js new file mode 100644 index 0000000000..6c98f819c6 --- /dev/null +++ b/tests/resources/functions/dynamic-api-key/index.js @@ -0,0 +1,15 @@ +const sdk = require('node-appwrite'); + +module.exports = async(context) => { + const client = new sdk.Client(); + client.setEndpoint(process.env.APPWRITE_FUNCTION_API_ENDPOINT); + client.setProject(process.env.APPWRITE_FUNCTION_PROJECT_ID); + client.setKey(context.req.headers['x-appwrite-key']); + + const users = new sdk.Users(client); + + const response = await users.list(); + context.log(JSON.stringify(response)); + + return context.res.json(response); +}; diff --git a/tests/resources/functions/dynamic-api-key/package-lock.json b/tests/resources/functions/dynamic-api-key/package-lock.json new file mode 100644 index 0000000000..2d86fe18d3 --- /dev/null +++ b/tests/resources/functions/dynamic-api-key/package-lock.json @@ -0,0 +1,31 @@ +{ + "name": "dynamic-api-key", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "dynamic-api-key", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "node-appwrite": "^17.0.0" + } + }, + "node_modules/node-appwrite": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/node-appwrite/-/node-appwrite-17.0.0.tgz", + "integrity": "sha512-5Moi5ENPnoAfU1/6CZP9K2NTuB6Nm3dSyhokno+24RDuP7czjXCdwzfeyjmyHieggbrLkN89AYSOv9W1XkCL9w==", + "license": "BSD-3-Clause", + "dependencies": { + "node-fetch-native-with-agent": "1.7.2" + } + }, + "node_modules/node-fetch-native-with-agent": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/node-fetch-native-with-agent/-/node-fetch-native-with-agent-1.7.2.tgz", + "integrity": "sha512-5MaOOCuJEvcckoz7/tjdx1M6OusOY6Xc5f459IaruGStWnKzlI1qpNgaAwmn4LmFYcsSlj+jBMk84wmmRxfk5g==", + "license": "MIT" + } + } +} diff --git a/tests/resources/functions/dynamic-api-key/package.json b/tests/resources/functions/dynamic-api-key/package.json new file mode 100644 index 0000000000..19b8158131 --- /dev/null +++ b/tests/resources/functions/dynamic-api-key/package.json @@ -0,0 +1,15 @@ +{ + "name": "dynamic-api-key", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "node-appwrite": "^17.0.0" + } +} diff --git a/tests/resources/functions/php-scopes/setup.sh b/tests/resources/functions/dynamic-api-key/setup.sh similarity index 94% rename from tests/resources/functions/php-scopes/setup.sh rename to tests/resources/functions/dynamic-api-key/setup.sh index a2f78a4f3d..c0bb3cec58 100644 --- a/tests/resources/functions/php-scopes/setup.sh +++ b/tests/resources/functions/dynamic-api-key/setup.sh @@ -1,6 +1,7 @@ - ENDPOINT="$APPWRITE_FUNCTION_API_ENDPOINT/users" PROJECT_ID="$APPWRITE_FUNCTION_PROJECT_ID" API_KEY="$APPWRITE_FUNCTION_API_KEY" +apk add curl + curl -v -X GET $ENDPOINT -H "x-appwrite-project: $PROJECT_ID" -H "x-appwrite-key: $API_KEY" \ No newline at end of file diff --git a/tests/resources/functions/event-handler/index.js b/tests/resources/functions/event-handler/index.js new file mode 100644 index 0000000000..6df3b7fb35 --- /dev/null +++ b/tests/resources/functions/event-handler/index.js @@ -0,0 +1,5 @@ +module.exports = async(context) => { + context.log(context.req.body.$id); + context.log(context.req.body.name); + return context.res.empty(); +}; diff --git a/tests/resources/functions/php-large/blue.mp4 b/tests/resources/functions/large/blue.mp4 similarity index 100% rename from tests/resources/functions/php-large/blue.mp4 rename to tests/resources/functions/large/blue.mp4 diff --git a/tests/resources/functions/large/index.js b/tests/resources/functions/large/index.js new file mode 100644 index 0000000000..5e8719bcf3 --- /dev/null +++ b/tests/resources/functions/large/index.js @@ -0,0 +1,3 @@ +module.exports = async(context) => { + return context.res.empty(); +}; diff --git a/tests/resources/functions/node/index.js b/tests/resources/functions/node/index.js index e8eb938a15..a43ed308ac 100644 --- a/tests/resources/functions/node/index.js +++ b/tests/resources/functions/node/index.js @@ -1,21 +1,3 @@ module.exports = async(context) => { - context.log('Amazing Function Log'); - - return context.res.json({ - 'APPWRITE_FUNCTION_ID' : process.env.APPWRITE_FUNCTION_ID ?? '', - 'APPWRITE_FUNCTION_NAME' : process.env.APPWRITE_FUNCTION_NAME ?? '', - 'APPWRITE_FUNCTION_DEPLOYMENT' : process.env.APPWRITE_FUNCTION_DEPLOYMENT ?? '', - 'APPWRITE_FUNCTION_TRIGGER' : context.req.headers['x-appwrite-trigger'] ?? '', - 'APPWRITE_FUNCTION_RUNTIME_NAME' : process.env.APPWRITE_FUNCTION_RUNTIME_NAME, - 'APPWRITE_FUNCTION_RUNTIME_VERSION' : process.env.APPWRITE_FUNCTION_RUNTIME_VERSION, - 'APPWRITE_FUNCTION_EVENT' : context.req.headers['x-appwrite-event'] ?? '', - 'APPWRITE_FUNCTION_EVENT_DATA' : context.req.bodyRaw ?? '', - 'APPWRITE_FUNCTION_DATA' : context.req.bodyRaw ?? '', - 'APPWRITE_FUNCTION_USER_ID' : context.req.headers['x-appwrite-user-id'] ?? '', - 'APPWRITE_FUNCTION_JWT' : context.req.headers['x-appwrite-user-jwt'] ?? '', - 'APPWRITE_FUNCTION_PROJECT_ID' : process.env.APPWRITE_FUNCTION_PROJECT_ID, - 'APPWRITE_FUNCTION_MEMORY' : process.env.APPWRITE_FUNCTION_MEMORY, - 'APPWRITE_FUNCTION_CPUS' : process.env.APPWRITE_FUNCTION_CPUS, - 'CUSTOM_VARIABLE' : process.env.CUSTOM_VARIABLE - }); + return context.res.send('OK'); } \ No newline at end of file diff --git a/tests/resources/functions/php-binary-request/index.php b/tests/resources/functions/php-binary-request/index.php deleted file mode 100644 index 53df8705e5..0000000000 --- a/tests/resources/functions/php-binary-request/index.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -return function ($context) { - $hash = md5($context->req->bodyBinary); - return $context->res->send($hash); -}; diff --git a/tests/resources/functions/php-binary-response/index.php b/tests/resources/functions/php-binary-response/index.php deleted file mode 100644 index 7715663388..0000000000 --- a/tests/resources/functions/php-binary-response/index.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -return function ($context) { - $bytes = pack('C*', ...[0, 10, 255]); - return $context->res->binary($bytes); -}; diff --git a/tests/resources/functions/php-cookie/index.php b/tests/resources/functions/php-cookie/index.php deleted file mode 100644 index 8f38f752cb..0000000000 --- a/tests/resources/functions/php-cookie/index.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php - -return function ($context) { - return $context->res->send($context->req->headers['cookie'] ?? ''); -}; diff --git a/tests/resources/functions/php-event/index.php b/tests/resources/functions/php-event/index.php deleted file mode 100644 index 550fd57729..0000000000 --- a/tests/resources/functions/php-event/index.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -return function ($context) { - $context->log($context->req->body['$id']); - $context->log($context->req->body['name']); - - return $context->res->empty(); -}; diff --git a/tests/resources/functions/php-fn/index.php b/tests/resources/functions/php-fn/index.php deleted file mode 100644 index 0b6e3d206c..0000000000 --- a/tests/resources/functions/php-fn/index.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -return function ($context) { - $context->log('Amazing Function Log'); - - return $context->res->json([ - 'APPWRITE_FUNCTION_ID' => \getenv('APPWRITE_FUNCTION_ID') ?: '', - 'APPWRITE_FUNCTION_NAME' => \getenv('APPWRITE_FUNCTION_NAME') ?: '', - 'APPWRITE_FUNCTION_DEPLOYMENT' => \getenv('APPWRITE_FUNCTION_DEPLOYMENT') ?: '', - 'APPWRITE_FUNCTION_TRIGGER' => $context->req->headers['x-appwrite-trigger'] ?? '', - 'APPWRITE_FUNCTION_RUNTIME_NAME' => \getenv('APPWRITE_FUNCTION_RUNTIME_NAME') ?: '', - 'APPWRITE_FUNCTION_RUNTIME_VERSION' => \getenv('APPWRITE_FUNCTION_RUNTIME_VERSION') ?: '', - 'APPWRITE_VERSION' => \getenv('APPWRITE_VERSION') ?: '', - 'APPWRITE_REGION' => \getenv('APPWRITE_REGION') ?: '', - 'APPWRITE_FUNCTION_EVENT' => $context->req->headers['x-appwrite-event'] ?? '', - 'APPWRITE_FUNCTION_EVENT_DATA' => $context->req->bodyRaw ?? '', - 'APPWRITE_FUNCTION_DATA' => $context->req->bodyRaw ?? '', - 'APPWRITE_FUNCTION_USER_ID' => $context->req->headers['x-appwrite-user-id'] ?? '', - 'APPWRITE_FUNCTION_JWT' => $context->req->headers['x-appwrite-user-jwt'] ?? '', - 'APPWRITE_FUNCTION_PROJECT_ID' => \getenv('APPWRITE_FUNCTION_PROJECT_ID') ?: '', - 'CUSTOM_VARIABLE' => \getenv('CUSTOM_VARIABLE') ?: '', - ]); -}; diff --git a/tests/resources/functions/php-large/composer.json b/tests/resources/functions/php-large/composer.json deleted file mode 100644 index e3c6db23e9..0000000000 --- a/tests/resources/functions/php-large/composer.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "appwrite/cloud-function-demo", - "description": "Demo cloud function script", - "type": "library", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Team Appwrite", - "email": "team@appwrite.io" - } - ], - "require": { - "php": ">=7.4.0", - "ext-curl": "*", - "ext-json": "*", - "appwrite/appwrite": "1.1.*" - } -} diff --git a/tests/resources/functions/php-large/composer.lock b/tests/resources/functions/php-large/composer.lock deleted file mode 100644 index 758c73c3f9..0000000000 --- a/tests/resources/functions/php-large/composer.lock +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "afdff6a172e6c44aee11f1562175f81a", - "packages": [ - { - "name": "appwrite/appwrite", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/appwrite/sdk-for-php.git", - "reference": "98b327d3fd18a72f4582019916afd735a0e9e0e7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-for-php/zipball/98b327d3fd18a72f4582019916afd735a0e9e0e7", - "reference": "98b327d3fd18a72f4582019916afd735a0e9e0e7", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "php": ">=7.1.0" - }, - "require-dev": { - "phpunit/phpunit": "3.7.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "Appwrite\\": "src/Appwrite" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks", - "support": { - "email": "team@localhost.test", - "issues": "https://github.com/appwrite/sdk-for-php/issues", - "source": "https://github.com/appwrite/sdk-for-php/tree/1.1.2", - "url": "https://appwrite.io/support" - }, - "time": "2020-08-15T18:24:32+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=7.4.0", - "ext-curl": "*", - "ext-json": "*" - }, - "platform-dev": [], - "plugin-api-version": "2.0.0" -} diff --git a/tests/resources/functions/php-large/index.php b/tests/resources/functions/php-large/index.php deleted file mode 100644 index abcb2e53d9..0000000000 --- a/tests/resources/functions/php-large/index.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -return function ($context) { - return $context->res->json([ - 'APPWRITE_FUNCTION_ID' => \getenv('APPWRITE_FUNCTION_ID') ?: '', - 'APPWRITE_FUNCTION_NAME' => \getenv('APPWRITE_FUNCTION_NAME') ?: '', - 'APPWRITE_FUNCTION_DEPLOYMENT' => \getenv('APPWRITE_FUNCTION_DEPLOYMENT') ?: '', - 'APPWRITE_FUNCTION_TRIGGER' => $context->req->headers['x-appwrite-trigger'] ?? '', - 'APPWRITE_FUNCTION_RUNTIME_NAME' => \getenv('APPWRITE_FUNCTION_RUNTIME_NAME') ?: '', - 'APPWRITE_FUNCTION_RUNTIME_VERSION' => \getenv('APPWRITE_FUNCTION_RUNTIME_VERSION') ?: '', - 'APPWRITE_REGION' => \getenv('APPWRITE_REGION') ?: '', - 'APPWRITE_FUNCTION_CPUS' => \getenv('APPWRITE_FUNCTION_CPUS') ?: '', - 'APPWRITE_FUNCTION_MEMORY' => \getenv('APPWRITE_FUNCTION_MEMORY') ?: '', - 'UNICODE_TEST' => "êä" - ]); -}; diff --git a/tests/resources/functions/php-scopes/composer.json b/tests/resources/functions/php-scopes/composer.json deleted file mode 100644 index 8eacdab3ec..0000000000 --- a/tests/resources/functions/php-scopes/composer.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "appwrite/php-scopes", - "description": "PHP scopes test script", - "type": "library", - "license": "BSD-3-Clause", - "authors": [ - { - "name": "Team Appwrite", - "email": "team@appwrite.io" - } - ], - "require": { - "php": ">=7.4.0", - "ext-curl": "*", - "ext-json": "*", - "appwrite/appwrite": "11.0.*" - } -} diff --git a/tests/resources/functions/php-scopes/index.php b/tests/resources/functions/php-scopes/index.php deleted file mode 100644 index 905d924eb7..0000000000 --- a/tests/resources/functions/php-scopes/index.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -require 'vendor/autoload.php'; - -use Appwrite\Client; -use Appwrite\Services\Users; - -return function ($context) { - $client = new Client(); - $client - ->setEndpoint(getenv('APPWRITE_FUNCTION_API_ENDPOINT')) - ->setProject(getenv('APPWRITE_FUNCTION_PROJECT_ID')) - ->setKey($context->req->headers['x-appwrite-key']); - $users = new Users($client); - $response = $users->list(); - $context->log($response); - return $context->res->json($response); -}; diff --git a/tests/resources/functions/php-v2/index.php b/tests/resources/functions/php-v2/index.php deleted file mode 100644 index 2bf5d83304..0000000000 --- a/tests/resources/functions/php-v2/index.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php - -return function ($req, $res) { - $res->json([ - 'v2Woks' => true - ]); -}; diff --git a/tests/resources/functions/php/index.php b/tests/resources/functions/php/index.php deleted file mode 100644 index 6c67f27ee1..0000000000 --- a/tests/resources/functions/php/index.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -return function ($context) { - if ($context->req->path === '/custom-response') { - $code = (int) ($context->req->query['code'] ?? '200'); - $body = $context->req->query['body'] ?? ''; - return $context->res->send($body, $code); - } - - $context->log('body-is-' . ($context->req->body ?? '')); - $context->log('custom-header-is-' . ($context->req->headers['x-custom-header'] ?? '')); - $context->log('method-is-' . \strtolower($context->req->method ?? '')); - $context->log('path-is-' . ($context->req->path ?? '')); - $context->log('user-is-' . $context->req->headers['x-appwrite-user-id'] ?? ''); - - if (empty($context->req->headers['x-appwrite-user-jwt'] ?? '')) { - $context->log('jwt-is-invalid'); - } else { - $context->log('jwt-is-valid'); - } - - $context->error('error-log-works'); - - $statusCode = $context->req->query['code'] ?? '200'; - - return $context->res->json([ - 'APPWRITE_FUNCTION_ID' => \getenv('APPWRITE_FUNCTION_ID') ?: '', - 'APPWRITE_FUNCTION_NAME' => \getenv('APPWRITE_FUNCTION_NAME') ?: '', - 'APPWRITE_FUNCTION_DEPLOYMENT' => \getenv('APPWRITE_FUNCTION_DEPLOYMENT') ?: '', - 'APPWRITE_FUNCTION_TRIGGER' => $context->req->headers['x-appwrite-trigger'] ?? '', - 'APPWRITE_FUNCTION_RUNTIME_NAME' => \getenv('APPWRITE_FUNCTION_RUNTIME_NAME') ?: '', - 'APPWRITE_FUNCTION_RUNTIME_VERSION' => \getenv('APPWRITE_FUNCTION_RUNTIME_VERSION') ?: '', - 'APPWRITE_REGION' => \getenv('APPWRITE_REGION') ?: '', - 'UNICODE_TEST' => "êä", - 'GLOBAL_VARIABLE' => \getenv('GLOBAL_VARIABLE') ?: '', - 'APPWRITE_FUNCTION_CPUS' => \getenv('APPWRITE_FUNCTION_CPUS') ?: '', - 'APPWRITE_FUNCTION_MEMORY' => \getenv('APPWRITE_FUNCTION_MEMORY') ?: '', - ], \intval($statusCode)); -}; diff --git a/tests/resources/functions/python/main.py b/tests/resources/functions/python/main.py deleted file mode 100644 index fda0b36f0e..0000000000 --- a/tests/resources/functions/python/main.py +++ /dev/null @@ -1,21 +0,0 @@ -import json -import os - -def main(context): - context.log('Amazing Function Log') - - return context.res.json({ - 'APPWRITE_FUNCTION_ID' : os.environ.get('APPWRITE_FUNCTION_ID',''), - 'APPWRITE_FUNCTION_NAME' : os.environ.get('APPWRITE_FUNCTION_NAME',''), - 'APPWRITE_FUNCTION_DEPLOYMENT' : os.environ.get('APPWRITE_FUNCTION_DEPLOYMENT',''), - 'APPWRITE_FUNCTION_TRIGGER' : context.req.headers.get('x-appwrite-trigger', ''), - 'APPWRITE_FUNCTION_RUNTIME_NAME' : os.environ.get('APPWRITE_FUNCTION_RUNTIME_NAME',''), - 'APPWRITE_FUNCTION_RUNTIME_VERSION' : os.environ.get('APPWRITE_FUNCTION_RUNTIME_VERSION',''), - 'APPWRITE_FUNCTION_EVENT' : context.req.headers.get('x-appwrite-event', ''), - 'APPWRITE_FUNCTION_EVENT_DATA' : context.req.body_raw, - 'APPWRITE_FUNCTION_DATA' : context.req.body_raw, - 'APPWRITE_FUNCTION_USER_ID' : context.req.headers.get('x-appwrite-user-id', ''), - 'APPWRITE_FUNCTION_JWT' : context.req.headers.get('x-appwrite-user-jwt', ''), - 'APPWRITE_FUNCTION_PROJECT_ID' : os.environ.get('APPWRITE_FUNCTION_PROJECT_ID',''), - 'CUSTOM_VARIABLE' : os.environ.get('CUSTOM_VARIABLE',''), - }) \ No newline at end of file diff --git a/tests/resources/functions/ruby/main.rb b/tests/resources/functions/ruby/main.rb deleted file mode 100644 index c14f591fa1..0000000000 --- a/tests/resources/functions/ruby/main.rb +++ /dev/null @@ -1,19 +0,0 @@ -def main(context) - context.log('Amazing Function Log') - - return context.res.json({ - 'APPWRITE_FUNCTION_ID' => ENV['APPWRITE_FUNCTION_ID'] || '', - 'APPWRITE_FUNCTION_NAME' => ENV['APPWRITE_FUNCTION_NAME'] || '', - 'APPWRITE_FUNCTION_DEPLOYMENT' => ENV['APPWRITE_FUNCTION_DEPLOYMENT'] || '', - 'APPWRITE_FUNCTION_TRIGGER' => context.req.headers['x-appwrite-trigger'] || '', - 'APPWRITE_FUNCTION_RUNTIME_NAME' => ENV['APPWRITE_FUNCTION_RUNTIME_NAME'] || '', - 'APPWRITE_FUNCTION_RUNTIME_VERSION' => ENV['APPWRITE_FUNCTION_RUNTIME_VERSION'] || '', - 'APPWRITE_FUNCTION_EVENT' => context.req.headers['x-appwrite-event'] || '', - 'APPWRITE_FUNCTION_EVENT_DATA' => context.req.body_raw || '', - 'APPWRITE_FUNCTION_DATA' => context.req.body_raw || '', - 'APPWRITE_FUNCTION_USER_ID' => context.req.headers['x-appwrite-user-id'] || '', - 'APPWRITE_FUNCTION_JWT' => context.req.headers['x-appwrite-user-jwt'] || '', - 'APPWRITE_FUNCTION_PROJECT_ID' => ENV['APPWRITE_FUNCTION_PROJECT_ID'] || '', - 'CUSTOM_VARIABLE' => ENV['CUSTOM_VARIABLE'] || '' - }) -end \ No newline at end of file diff --git a/tests/resources/functions/swift/index.swift b/tests/resources/functions/swift/index.swift deleted file mode 100644 index b3dcdbc91a..0000000000 --- a/tests/resources/functions/swift/index.swift +++ /dev/null @@ -1,17 +0,0 @@ -func main(req: RequestValue, res: RequestResponse) throws -> RequestResponse { - return res.json(data: [ - "APPWRITE_FUNCTION_ID": req.variables["APPWRITE_FUNCTION_ID"], - "APPWRITE_FUNCTION_NAME": req.variables["APPWRITE_FUNCTION_NAME"], - "APPWRITE_FUNCTION_DEPLOYMENT": req.variables["APPWRITE_FUNCTION_DEPLOYMENT"], - "APPWRITE_FUNCTION_TRIGGER": req.variables["APPWRITE_FUNCTION_TRIGGER"], - "APPWRITE_FUNCTION_RUNTIME_NAME": req.variables["APPWRITE_FUNCTION_RUNTIME_NAME"], - "APPWRITE_FUNCTION_RUNTIME_VERSION": req.variables["APPWRITE_FUNCTION_RUNTIME_VERSION"], - "APPWRITE_FUNCTION_EVENT": req.variables["APPWRITE_FUNCTION_EVENT"], - "APPWRITE_FUNCTION_EVENT_DATA": req.variables["APPWRITE_FUNCTION_EVENT_DATA"], - "APPWRITE_FUNCTION_DATA": req.variables["APPWRITE_FUNCTION_DATA"], - "APPWRITE_FUNCTION_USER_ID": req.variables["APPWRITE_FUNCTION_USER_ID"], - "APPWRITE_FUNCTION_JWT": req.variables["APPWRITE_FUNCTION_JWT"], - "APPWRITE_FUNCTION_PROJECT_ID": req.variables["APPWRITE_FUNCTION_PROJECT_ID"], - "CUSTOM_VARIABLE": req.variables["CUSTOM_VARIABLE"] - ]) -} \ No newline at end of file diff --git a/tests/resources/functions/timeout/index.js b/tests/resources/functions/timeout/index.js new file mode 100644 index 0000000000..45ad72a323 --- /dev/null +++ b/tests/resources/functions/timeout/index.js @@ -0,0 +1,4 @@ +module.exports = async(context) => { + await new Promise(resolve => setTimeout(resolve, 1000 * 60)); + return context.res.send('OK'); +}; diff --git a/tests/resources/functions/timeout/index.php b/tests/resources/functions/timeout/index.php deleted file mode 100644 index c9aedb3a30..0000000000 --- a/tests/resources/functions/timeout/index.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php - -return function ($context) { - sleep(60); - return $context->res->send('OK'); -}; diff --git a/tests/unit/Network/Validators/OriginTest.php b/tests/unit/Network/Validators/OriginTest.php index d9bc77c19f..d312f8c5a5 100644 --- a/tests/unit/Network/Validators/OriginTest.php +++ b/tests/unit/Network/Validators/OriginTest.php @@ -2,6 +2,7 @@ namespace Tests\Unit\Network\Validators; +use Appwrite\Network\Platform; use Appwrite\Network\Validator\Origin; use PHPUnit\Framework\TestCase; use Utopia\Database\Helpers\ID; @@ -14,62 +15,99 @@ class OriginTest extends TestCase [ '$collection' => ID::custom('platforms'), 'name' => 'Production', - 'type' => Origin::CLIENT_TYPE_WEB, + 'type' => Platform::TYPE_WEB, 'hostname' => 'appwrite.io', ], [ '$collection' => ID::custom('platforms'), 'name' => 'Development', - 'type' => Origin::CLIENT_TYPE_WEB, + 'type' => Platform::TYPE_WEB, 'hostname' => 'appwrite.test', ], [ '$collection' => ID::custom('platforms'), 'name' => 'Localhost', - 'type' => Origin::CLIENT_TYPE_WEB, + 'type' => Platform::TYPE_WEB, 'hostname' => 'localhost', ], [ '$collection' => ID::custom('platforms'), 'name' => 'Flutter', - 'type' => Origin::CLIENT_TYPE_FLUTTER_WEB, + 'type' => Platform::TYPE_FLUTTER_WEB, 'hostname' => 'appwrite.flutter', ], + [ + '$collection' => ID::custom('platforms'), + 'name' => 'Expo', + 'type' => Platform::TYPE_SCHEME, + 'key' => 'exp', + ], + [ + '$collection' => ID::custom('platforms'), + 'name' => 'Appwrite Callback', + 'type' => Platform::TYPE_SCHEME, + 'key' => 'appwrite-callback-123', + ], ]); - $this->assertEquals($validator->isValid('https://localhost'), true); - $this->assertEquals($validator->isValid('http://localhost'), true); - $this->assertEquals($validator->isValid('http://localhost:80'), true); + $this->assertEquals(false, $validator->isValid('')); + $this->assertEquals(false, $validator->isValid('/')); - $this->assertEquals($validator->isValid('https://appwrite.io'), true); - $this->assertEquals($validator->isValid('http://appwrite.io'), true); - $this->assertEquals($validator->isValid('http://appwrite.io:80'), true); + $this->assertEquals(true, $validator->isValid('https://localhost')); + $this->assertEquals(true, $validator->isValid('http://localhost')); + $this->assertEquals(true, $validator->isValid('http://localhost:80')); - $this->assertEquals($validator->isValid('https://appwrite.test'), true); - $this->assertEquals($validator->isValid('http://appwrite.test'), true); - $this->assertEquals($validator->isValid('http://appwrite.test:80'), true); + $this->assertEquals(true, $validator->isValid('https://appwrite.io')); + $this->assertEquals(true, $validator->isValid('http://appwrite.io')); + $this->assertEquals(true, $validator->isValid('http://appwrite.io:80')); - $this->assertEquals($validator->isValid('https://appwrite.flutter'), true); - $this->assertEquals($validator->isValid('http://appwrite.flutter'), true); - $this->assertEquals($validator->isValid('http://appwrite.flutter:80'), true); + $this->assertEquals(true, $validator->isValid('https://appwrite.test')); + $this->assertEquals(true, $validator->isValid('http://appwrite.test')); + $this->assertEquals(true, $validator->isValid('http://appwrite.test:80')); - $this->assertEquals($validator->isValid('https://example.com'), false); - $this->assertEquals($validator->isValid('http://example.com'), false); - $this->assertEquals($validator->isValid('http://example.com:80'), false); + $this->assertEquals(true, $validator->isValid('https://appwrite.flutter')); + $this->assertEquals(true, $validator->isValid('http://appwrite.flutter')); + $this->assertEquals(true, $validator->isValid('http://appwrite.flutter:80')); - $this->assertEquals($validator->isValid('appwrite-ios://com.company.appname'), false); - $this->assertEquals($validator->getDescription(), 'Invalid Origin. Register your new client (com.company.appname) as a new iOS platform on your project console dashboard'); + $this->assertEquals(false, $validator->isValid('https://example.com')); + $this->assertEquals(false, $validator->isValid('http://example.com')); + $this->assertEquals(false, $validator->isValid('http://example.com:80')); - $this->assertEquals($validator->isValid('appwrite-android://com.company.appname'), false); - $this->assertEquals($validator->getDescription(), 'Invalid Origin. Register your new client (com.company.appname) as a new Android platform on your project console dashboard'); + $this->assertEquals(true, $validator->isValid('exp://')); + $this->assertEquals(true, $validator->isValid('exp:///')); + $this->assertEquals(true, $validator->isValid('exp://index')); - $this->assertEquals($validator->isValid('appwrite-macos://com.company.appname'), false); - $this->assertEquals($validator->getDescription(), 'Invalid Origin. Register your new client (com.company.appname) as a new macOS platform on your project console dashboard'); + $this->assertEquals(true, $validator->isValid('appwrite-callback-123://')); + $this->assertEquals(false, $validator->isValid('appwrite-callback-456://')); - $this->assertEquals($validator->isValid('appwrite-linux://com.company.appname'), false); - $this->assertEquals($validator->getDescription(), 'Invalid Origin. Register your new client (com.company.appname) as a new Linux platform on your project console dashboard'); + $this->assertEquals(false, $validator->isValid('appwrite-ios://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new iOS platform on your project console dashboard', $validator->getDescription()); - $this->assertEquals($validator->isValid('appwrite-windows://com.company.appname'), false); - $this->assertEquals($validator->getDescription(), 'Invalid Origin. Register your new client (com.company.appname) as a new Windows platform on your project console dashboard'); + $this->assertEquals(false, $validator->isValid('appwrite-android://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Android platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('appwrite-macos://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new macOS platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('appwrite-linux://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Linux platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('appwrite-windows://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Windows platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('chrome-extension://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Web (Chrome Extension) platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('moz-extension://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Web (Firefox Extension) platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('safari-web-extension://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Web (Safari Extension) platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('ms-browser-extension://com.company.appname')); + $this->assertEquals('Invalid Origin. Register your new client (com.company.appname) as a new Web (Edge Extension) platform on your project console dashboard', $validator->getDescription()); + + $this->assertEquals(false, $validator->isValid('random-scheme://localhost')); + $this->assertEquals('Invalid Scheme. The scheme used (random-scheme) in the Origin (random-scheme://localhost) is not supported. If you are using a custom scheme, please change it to `appwrite-callback-<PROJECT_ID>`', $validator->getDescription()); } } diff --git a/tests/unit/URL/URLTest.php b/tests/unit/URL/URLTest.php index fecaf25bca..ceca1c6304 100644 --- a/tests/unit/URL/URLTest.php +++ b/tests/unit/URL/URLTest.php @@ -26,6 +26,15 @@ class URLTest extends TestCase $this->assertEquals(null, $url['port']); $this->assertEquals('', $url['path']); $this->assertEquals('', $url['query']); + + $url = URL::parse('appwrite-callback-project://'); + + $this->assertIsArray($url); + $this->assertEquals('appwrite-callback-project', $url['scheme']); + $this->assertEquals('', $url['host']); + $this->assertEquals(null, $url['port']); + $this->assertEquals('', $url['path']); + $this->assertEquals('', $url['query']); } public function testUnparse(): void @@ -86,6 +95,19 @@ class URLTest extends TestCase $this->assertIsString($url); $this->assertEquals('https://eldad:fux@appwrite.io/#bottom', $url); + + $url = URL::unparse([ + 'scheme' => 'https', + 'user' => '', + 'pass' => '', + 'host' => 'appwrite.io', + 'port' => null, + 'path' => '', + 'fragment' => '', + ]); + + $this->assertIsString($url); + $this->assertEquals('https://appwrite.io/#', $url); } public function testParseQuery(): void