diff --git a/CHANGES.md b/CHANGES.md index 0bedf0b12..81fb6ebcf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,25 @@ +# NOT PUBLISHED YET + +## Features + +- Added file created date to file info on the console +- Added file size to file info on the console +- Refactored Devices page in Console: + - Renamed *Devices* to *Sessions* + - Add Provider Icon to each Session + - Add Anonymous Account Placeholder +- Upgraded telegraf docker image version to v1.1.0 + +## Bugs + +- Fixed bug when removing a project member on the Appwrite console (#1214) +- Fixed Swoole buffer output size to allow downloading files bigger than allowed size (#1189) +- Fixed ClamAV status when anti virus is not running (#1188) +- Fixed deleteSession which was removing cookieFallback from the localstorage on any logout instead of current session (#1206) +- Fixed Nepal flag (#1173) +- Fixed a bug in the Twitch OAuth adapter (#1209) +- Fixed missing session object when OAuth session creation event is triggered (#1208) + # Version 0.8.0 ## Features diff --git a/app/config/auth.php b/app/config/auth.php index 8e718e680..11b89dd9e 100644 --- a/app/config/auth.php +++ b/app/config/auth.php @@ -6,7 +6,7 @@ return [ 'email-password' => [ 'name' => 'Email/Password', 'key' => 'usersAuthEmailPassword', - 'icon' => '/images/users/email-password.png', + 'icon' => '/images/users/email.png', 'docs' => 'https://appwrite.io/docs/client/account?sdk=web#accountCreateSession', 'enabled' => true, ], diff --git a/app/config/avatars/flags/np.png b/app/config/avatars/flags/np.png index 09b2a4c22..4c0c2d7e5 100644 Binary files a/app/config/avatars/flags/np.png and b/app/config/avatars/flags/np.png differ diff --git a/app/config/platforms.php b/app/config/platforms.php index bbaa4e5fd..cfb21f3d8 100644 --- a/app/config/platforms.php +++ b/app/config/platforms.php @@ -15,7 +15,7 @@ return [ [ 'key' => 'web', 'name' => 'Web', - 'version' => '3.0.0', + 'version' => '3.0.4', 'url' => 'https://github.com/appwrite/sdk-for-web', 'package' => 'https://www.npmjs.com/package/appwrite', 'enabled' => true, @@ -62,7 +62,7 @@ return [ [ 'key' => 'flutter', 'name' => 'Flutter', - 'version' => '0.6.0', + 'version' => '0.6.2', 'url' => 'https://github.com/appwrite/sdk-for-flutter', 'package' => 'https://pub.dev/packages/appwrite', 'enabled' => true, @@ -178,7 +178,7 @@ return [ [ 'key' => 'nodejs', 'name' => 'Node.js', - 'version' => '2.2.1', + 'version' => '2.2.2', 'url' => 'https://github.com/appwrite/sdk-for-node', 'package' => 'https://www.npmjs.com/package/node-appwrite', 'enabled' => true, @@ -195,7 +195,7 @@ return [ [ 'key' => 'deno', 'name' => 'Deno', - 'version' => '0.2.0', + 'version' => '0.2.1', 'url' => 'https://github.com/appwrite/sdk-for-deno', 'package' => 'https://deno.land/x/appwrite', 'enabled' => true, @@ -212,7 +212,7 @@ return [ [ 'key' => 'php', 'name' => 'PHP', - 'version' => '2.1.0', + 'version' => '2.1.1', 'url' => 'https://github.com/appwrite/sdk-for-php', 'package' => 'https://packagist.org/packages/appwrite/appwrite', 'enabled' => true, @@ -229,7 +229,7 @@ return [ [ 'key' => 'python', 'name' => 'Python', - 'version' => '0.2.0', + 'version' => '0.2.1', 'url' => 'https://github.com/appwrite/sdk-for-python', 'package' => 'https://pypi.org/project/appwrite/', 'enabled' => true, @@ -246,7 +246,7 @@ return [ [ 'key' => 'ruby', 'name' => 'Ruby', - 'version' => '2.1.0', + 'version' => '2.1.1', 'url' => 'https://github.com/appwrite/sdk-for-ruby', 'package' => 'https://rubygems.org/gems/appwrite', 'enabled' => true, @@ -314,7 +314,7 @@ return [ [ 'key' => 'dart', 'name' => 'Dart', - 'version' => '0.6.0', + 'version' => '0.6.1', 'url' => 'https://github.com/appwrite/sdk-for-dart', 'package' => 'https://pub.dev/packages/dart_appwrite', 'enabled' => true, @@ -331,7 +331,7 @@ return [ [ 'key' => 'cli', 'name' => 'Command Line', - 'version' => '0.10.0', + 'version' => '0.10.1', 'url' => 'https://github.com/appwrite/sdk-for-cli', 'package' => 'https://github.com/appwrite/sdk-for-cli', 'enabled' => true, diff --git a/app/config/specs/0.8.x.client.json b/app/config/specs/0.8.x.client.json index be79ebb55..54f0c997f 100644 --- a/app/config/specs/0.8.x.client.json +++ b/app/config/specs/0.8.x.client.json @@ -1,2 +1,2 @@ -{"swagger":"2.0","info":{"version":"0.8.0","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@appwrite.io"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","x-appwrite":{"demo":"5df5acd0d48c2"}},"JWT":{"type":"apiKey","name":"X-Appwrite-JWT","description":"Your secret JSON Web Token","in":"header","x-appwrite":{"demo":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","x-appwrite":{"demo":"en"}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"accountGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"get","weight":44,"cookies":false,"type":"","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](\/docs\/client\/account#accountCreateVerification) 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](\/docs\/client\/account#accountCreateSession).","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"create","weight":36,"cookies":false,"type":"","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":"public","platforms":["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 between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":52,"cookies":false,"type":"","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":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"accountUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":50,"cookies":false,"type":"","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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/jwt":{"post":{"summary":"Create Account 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.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":43,"cookies":false,"type":"","demo":"account\/create-j-w-t.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"account","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"accountGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":47,"cookies":false,"type":"","demo":"account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account 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","weight":48,"cookies":false,"type":"","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 Account 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 and Team Invites, oldPassword is optional.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":49,"cookies":false,"type":"","demo":"account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","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 between 6 to 32 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Old user password. Must be between 6 to 32 chars.","default":"","x-example":"password"}},"required":["password"]}}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"accountGetPrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"getPrefs","weight":45,"cookies":false,"type":"","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 Account Preferences","operationId":"accountUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":51,"cookies":false,"type":"","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":null,"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](\/docs\/client\/account#accountUpdateRecovery) 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","weight":55,"cookies":false,"type":"","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}","scope":"public","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":"Complete Password Recovery","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](\/docs\/client\/account#accountCreateRecovery) 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","weight":56,"cookies":false,"type":"","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":"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 account UID address.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"New password again. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["userId","secret","password","passwordAgain"]}}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"accountGetSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","responses":{"200":{"description":"Sessions List","schema":{"$ref":"#\/definitions\/sessionList"}}},"x-appwrite":{"method":"getSessions","weight":46,"cookies":false,"type":"","demo":"account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]},"post":{"summary":"Create Account Session","operationId":"accountCreateSession","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.","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createSession","weight":37,"cookies":false,"type":"","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":"url:{url},email:{param-email}","scope":"public","platforms":["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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]},"delete":{"summary":"Delete All Account 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","weight":54,"cookies":false,"type":"","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 account, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":42,"cookies":false,"type":"","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":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"accountCreateOAuth2Session","consumes":["application\/json"],"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.","responses":{"301":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"createOAuth2Session","weight":38,"cookies":false,"type":"webAuth","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":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, yahoo, yandex, wordpress.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"accountDeleteSession","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all their account sessions across all of their different devices. When using the option id argument, only the session unique ID provider will be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":53,"cookies":false,"type":"","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 unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"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](\/docs\/client\/account#accountUpdateVerification). 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","weight":57,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client","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":"Complete Email Verification","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","weight":58,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique 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":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":60,"cookies":false,"type":"location","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":[],"JWT":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"avatarsGetCreditCard","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":59,"cookies":false,"type":"location","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":[],"JWT":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"avatarsGetFavicon","consumes":["application\/json"],"produces":["image\/*"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFavicon","weight":63,"cookies":false,"type":"location","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":[],"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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":61,"cookies":false,"type":"location","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":[],"JWT":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"avatarsGetImage","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":62,"cookies":false,"type":"location","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":[],"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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":65,"cookies":false,"type":"location","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":[],"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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"avatarsGetQR","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":64,"cookies":false,"type":"location","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":[],"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databaseListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's documents. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":72,"cookies":false,"type":"","demo":"database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"databaseCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database#databaseCreateCollection) API or directly from your database console.","responses":{"201":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"createDocument","weight":71,"cookies":false,"type":"","demo":"database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"parentDocument":{"type":"string","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","default":"","x-example":"[PARENT_DOCUMENT]"},"parentProperty":{"type":"string","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","default":"","x-example":null},"parentPropertyType":{"type":"string","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","default":"assign","x-example":"assign"}},"required":["data"]}}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databaseGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":73,"cookies":false,"type":"","demo":"database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databaseUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":74,"cookies":false,"type":"","demo":"database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["data"]}}]},"delete":{"summary":"Delete Document","operationId":"databaseDeleteDocument","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"Delete a document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":75,"cookies":false,"type":"","demo":"database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions":{"get":{"summary":"List Executions","operationId":"functionsListExecutions","consumes":["application\/json"],"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. On admin mode, this endpoint will return a list of all of the project's executions. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Executions List","schema":{"$ref":"#\/definitions\/executionList"}}},"x-appwrite":{"method":"listExecutions","weight":172,"cookies":false,"type":"","demo":"functions\/list-executions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-executions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"execution.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Execution","operationId":"functionsCreateExecution","consumes":["application\/json"],"produces":["application\/json"],"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","weight":171,"cookies":false,"type":"","demo":"functions\/create-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-execution.md","rate-limit":60,"rate-time":60,"rate-key":"url:{url},ip:{ip}","scope":"execution.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"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":{"data":{"type":"string","description":"String of custom data to send to function.","default":"","x-example":"[DATA]"}}}}]}},"\/functions\/{functionId}\/executions\/{executionId}":{"get":{"summary":"Get Execution","operationId":"functionsGetExecution","consumes":["application\/json"],"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","weight":173,"cookies":false,"type":"","demo":"functions\/get-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"execution.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution unique ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"localeGet","consumes":["application\/json"],"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","weight":76,"cookies":false,"type":"","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":[],"JWT":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"localeGetContinents","consumes":["application\/json"],"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":"getContinents","weight":80,"cookies":false,"type":"","demo":"locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"localeGetCountries","consumes":["application\/json"],"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":"getCountries","weight":77,"cookies":false,"type":"","demo":"locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"localeGetCountriesEU","consumes":["application\/json"],"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":"getCountriesEU","weight":78,"cookies":false,"type":"","demo":"locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"localeGetCountriesPhones","consumes":["application\/json"],"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":"getCountriesPhones","weight":79,"cookies":false,"type":"","demo":"locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"localeGetCurrencies","consumes":["application\/json"],"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":"getCurrencies","weight":81,"cookies":false,"type":"","demo":"locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"localeGetLanguages","consumes":["application\/json"],"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":"getLanguages","weight":82,"cookies":false,"type":"","demo":"locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's files. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Files List","schema":{"$ref":"#\/definitions\/fileList"}}},"x-appwrite":{"method":"listFiles","weight":132,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"storageCreateFile","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":131,"cookies":false,"type":"upload","demo":"storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"storageGetFile","consumes":["application\/json"],"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","weight":133,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique 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","weight":137,"cookies":false,"type":"","demo":"storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["read","write"]}}]},"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","weight":138,"cookies":false,"type":"","demo":"storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["application\/json"],"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","weight":135,"cookies":false,"type":"location","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":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"storageGetFilePreview","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":134,"cookies":false,"type":"location","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":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"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":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"rotation","description":"Preview image rotation in degrees. Pass an integer between 0 and 360.","required":false,"type":"integer","format":"int32","x-example":0,"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","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"storageGetFileView","consumes":["application\/json"],"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","weight":136,"cookies":false,"type":"location","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":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's teams. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":140,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":139,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its unique ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":141,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"teamsUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Update a team by its unique ID. Only team owners have write access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":142,"cookies":false,"type":"","demo":"teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"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 by its unique ID. Only team owners have write access for this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":143,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team members by the team unique ID. All team members have read access for this list of resources.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":146,"cookies":false,"type":"","demo":"teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"teamsCreateMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":144,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"New team member email.","default":null,"x-example":"email@example.com"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"},"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](\/docs\/permissions). Max length for each role is 32 chars.","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. 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","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":145,"cookies":false,"type":"","demo":"teams\/update-membership-roles.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-roles.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":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique 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":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Max length for each role is 32 chars.","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","weight":148,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique 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 recieved by the user.","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":147,"cookies":false,"type":"","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 unique 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 unique ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}}},"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":"database","description":"The Database 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":"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":"functions","description":"The Functions Service allows you view, create and manage your Cloud Functions."}],"definitions":{"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"},"version":{"type":"string","description":"Server version number.","x-example":"1.0"}},"required":["message","code","version"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["sum","documents"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["sum","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["sum","files"]},"teamList":{"description":"Teams List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["sum","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["sum","memberships"]},"executionList":{"description":"Executions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["sum","executions"]},"countryList":{"description":"Countries List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["sum","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["sum","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["sum","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["sum","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["sum","phones"]},"permissions":{"description":"Permissions","type":"object","properties":{"read":{"type":"array","description":"Read permissions.","items":{"type":"string"},"x-example":"user:5e5ea5c16897e"},"write":{"type":"array","description":"Write permissions.","items":{"type":"string"},"x-example":"user:5e5ea5c16897e"}},"required":["read","write"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Collection permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Collection name.","x-example":"Movies"},"dateCreated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981550,"format":"int32"},"rules":{"type":"array","description":"Collection rules.","items":{"type":"object","$ref":"#\/definitions\/rule"},"x-example":""}},"required":["$id","$permissions","name","dateCreated","dateUpdated","rules"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$permissions":{"type":"object","description":"Document permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}}},"additionalProperties":true,"required":["$id","$collection","$permissions"]},"rule":{"description":"Rule","type":"object","properties":{"$id":{"type":"string","description":"Rule ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Rule Collection.","x-example":"5e5e66c16897e"},"type":{"type":"string","description":"Rule type. Possible values: ","x-example":"title"},"key":{"type":"string","description":"Rule key.","x-example":"title"},"label":{"type":"string","description":"Rule label.","x-example":"Title"},"default":{"type":"string","description":"Rule default value.","x-example":"Movie Name"},"array":{"type":"boolean","description":"Is array?","x-example":false},"required":{"type":"boolean","description":"Is required?","x-example":true},"list":{"type":"array","description":"List of allowed values","items":{"type":"string"},"x-example":"5e5ea5c168099"}},"required":["$id","$collection","type","key","label","default","array","required","list"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"integer","description":"Log creation time in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","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"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"registration":{"type":"integer","description":"User registration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"status":{"type":"integer","description":"User status. 0 for Unactivated, 1 for active and 2 is blocked.","x-example":0,"format":"int32"},"passwordUpdate":{"type":"integer","description":"Unix timestamp of the most recent password update","x-example":1592981250,"format":"int32"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"emailVerification":{"type":"boolean","description":"Email verification 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"}}},"required":["$id","name","registration","status","passwordUpdate","email","emailVerification","prefs"]},"preferences":{"description":"Preferences","type":"object","additionalProperties":true},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5bb8c16897e"},"expire":{"type":"integer","description":"Session expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"provider":{"type":"string","description":"Session Provider.","x-example":"email"},"providerUid":{"type":"string","description":"Session Provider User ID.","x-example":"user@example.com"},"providerToken":{"type":"string","description":"Session Provider 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}},"required":["$id","userId","expire","provider","providerUid","providerToken","ip","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName","current"]},"token":{"description":"Token","type":"object","properties":{"$id":{"type":"string","description":"Token ID.","x-example":"bb8ea5c16897e"},"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":"integer","description":"Token expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"}},"required":["$id","userId","secret","expire"]},"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 Europian 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"]},"file":{"description":"File","type":"object","properties":{"$id":{"type":"string","description":"File ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"File permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"dateCreated":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"}},"required":["$id","$permissions","name","dateCreated","signature","mimeType","sizeOriginal"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"dateCreated":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"sum":{"type":"integer","description":"Total sum of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","sum"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"VIP"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"invited":{"type":"integer","description":"Date, the user has been invited to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"joined":{"type":"integer","description":"Date, the user has accepted the invitation to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"confirm":{"type":"boolean","description":"User confirmation status, true if the user has joined the team or false otherwise.","x-example":false},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"},"x-example":"admin"}},"required":["$id","userId","teamId","name","email","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Function permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"dateCreated":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981257,"format":"int32"},"status":{"type":"string","description":"Function status. Possible values: disabled, enabled","x-example":"enabled"},"env":{"type":"string","description":"Function execution environment.","x-example":"python-3.8"},"tag":{"type":"string","description":"Function active tag ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"string","description":"Function environment variables.","x-example":{"key":"value"}},"events":{"type":"array","description":"Function trigger events.","items":{"type":"string"},"x-example":"account.create"},"schedule":{"type":"string","description":"Function execution schedult in CRON format.","x-example":"5 4 * * *"},"scheduleNext":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981292,"format":"int32"},"schedulePrevious":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981237,"format":"int32"},"timeout":{"type":"integer","description":"Function execution timeout in seconds.","x-example":1592981237,"format":"int32"}},"required":["$id","$permissions","name","dateCreated","dateUpdated","status","env","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"tag":{"description":"Tag","type":"object","properties":{"$id":{"type":"string","description":"Tag ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The tag creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"command":{"type":"string","description":"The entrypoint command in use to execute the tag code.","x-example":"enabled"},"size":{"type":"string","description":"The code size in bytes.","x-example":"python-3.8"}},"required":["$id","functionId","dateCreated","command","size"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"exitCode":{"type":"integer","description":"The script exit code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string.","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"float"}},"required":["$id","functionId","dateCreated","trigger","status","exitCode","stdout","stderr","time"]},"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":"float"},"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"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file +{"swagger":"2.0","info":{"version":"0.8.0","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@appwrite.io"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","x-appwrite":{"demo":"5df5acd0d48c2"}},"JWT":{"type":"apiKey","name":"X-Appwrite-JWT","description":"Your secret JSON Web Token","in":"header","x-appwrite":{"demo":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","x-appwrite":{"demo":"en"}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"accountGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"get","weight":44,"cookies":false,"type":"","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](\/docs\/client\/account#accountCreateVerification) 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](\/docs\/client\/account#accountCreateSession).","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"create","weight":36,"cookies":false,"type":"","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":"public","platforms":["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 between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":52,"cookies":false,"type":"","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":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"accountUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":50,"cookies":false,"type":"","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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/jwt":{"post":{"summary":"Create Account 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.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":43,"cookies":false,"type":"","demo":"account\/create-j-w-t.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"account","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"accountGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":47,"cookies":false,"type":"","demo":"account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account 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","weight":48,"cookies":false,"type":"","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 Account 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 and Team Invites, oldPassword is optional.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":49,"cookies":false,"type":"","demo":"account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","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 between 6 to 32 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Old user password. Must be between 6 to 32 chars.","default":"","x-example":"password"}},"required":["password"]}}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"accountGetPrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"getPrefs","weight":45,"cookies":false,"type":"","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 Account Preferences","operationId":"accountUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":51,"cookies":false,"type":"","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":null,"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](\/docs\/client\/account#accountUpdateRecovery) 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","weight":55,"cookies":false,"type":"","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}","scope":"public","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":"Complete Password Recovery","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](\/docs\/client\/account#accountCreateRecovery) 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","weight":56,"cookies":false,"type":"","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":"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 account UID address.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"New password again. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["userId","secret","password","passwordAgain"]}}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"accountGetSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","responses":{"200":{"description":"Sessions List","schema":{"$ref":"#\/definitions\/sessionList"}}},"x-appwrite":{"method":"getSessions","weight":46,"cookies":false,"type":"","demo":"account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]},"post":{"summary":"Create Account Session","operationId":"accountCreateSession","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.","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createSession","weight":37,"cookies":false,"type":"","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":"url:{url},email:{param-email}","scope":"public","platforms":["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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]},"delete":{"summary":"Delete All Account 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","weight":54,"cookies":false,"type":"","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 account, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":42,"cookies":false,"type":"","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":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"accountCreateOAuth2Session","consumes":["application\/json"],"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.","responses":{"301":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"createOAuth2Session","weight":38,"cookies":false,"type":"webAuth","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":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, yahoo, yandex, wordpress.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"accountDeleteSession","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all their account sessions across all of their different devices. When using the option id argument, only the session unique ID provider will be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":53,"cookies":false,"type":"","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 unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"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](\/docs\/client\/account#accountUpdateVerification). 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","weight":57,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client","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":"Complete Email Verification","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","weight":58,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique 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":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":60,"cookies":false,"type":"location","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":[],"JWT":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"avatarsGetCreditCard","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":59,"cookies":false,"type":"location","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":[],"JWT":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"avatarsGetFavicon","consumes":["application\/json"],"produces":["image\/*"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFavicon","weight":63,"cookies":false,"type":"location","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":[],"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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":61,"cookies":false,"type":"location","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":[],"JWT":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"avatarsGetImage","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":62,"cookies":false,"type":"location","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":[],"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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":65,"cookies":false,"type":"location","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":[],"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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"avatarsGetQR","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":64,"cookies":false,"type":"location","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":[],"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databaseListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's documents. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":72,"cookies":false,"type":"","demo":"database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"databaseCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database#databaseCreateCollection) API or directly from your database console.","responses":{"201":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"createDocument","weight":71,"cookies":false,"type":"","demo":"database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"parentDocument":{"type":"string","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","default":"","x-example":"[PARENT_DOCUMENT]"},"parentProperty":{"type":"string","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","default":"","x-example":null},"parentPropertyType":{"type":"string","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","default":"assign","x-example":"assign"}},"required":["data"]}}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databaseGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":73,"cookies":false,"type":"","demo":"database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databaseUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":74,"cookies":false,"type":"","demo":"database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["data"]}}]},"delete":{"summary":"Delete Document","operationId":"databaseDeleteDocument","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"Delete a document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":75,"cookies":false,"type":"","demo":"database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions":{"get":{"summary":"List Executions","operationId":"functionsListExecutions","consumes":["application\/json"],"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. On admin mode, this endpoint will return a list of all of the project's executions. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Executions List","schema":{"$ref":"#\/definitions\/executionList"}}},"x-appwrite":{"method":"listExecutions","weight":172,"cookies":false,"type":"","demo":"functions\/list-executions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-executions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"execution.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Execution","operationId":"functionsCreateExecution","consumes":["application\/json"],"produces":["application\/json"],"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","weight":171,"cookies":false,"type":"","demo":"functions\/create-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-execution.md","rate-limit":60,"rate-time":60,"rate-key":"url:{url},ip:{ip}","scope":"execution.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"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":{"data":{"type":"string","description":"String of custom data to send to function.","default":"","x-example":"[DATA]"}}}}]}},"\/functions\/{functionId}\/executions\/{executionId}":{"get":{"summary":"Get Execution","operationId":"functionsGetExecution","consumes":["application\/json"],"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","weight":173,"cookies":false,"type":"","demo":"functions\/get-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"execution.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution unique ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/locale":{"get":{"summary":"Get User Locale","operationId":"localeGet","consumes":["application\/json"],"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","weight":76,"cookies":false,"type":"","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":[],"JWT":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"localeGetContinents","consumes":["application\/json"],"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":"getContinents","weight":80,"cookies":false,"type":"","demo":"locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"localeGetCountries","consumes":["application\/json"],"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":"getCountries","weight":77,"cookies":false,"type":"","demo":"locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"localeGetCountriesEU","consumes":["application\/json"],"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":"getCountriesEU","weight":78,"cookies":false,"type":"","demo":"locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"localeGetCountriesPhones","consumes":["application\/json"],"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":"getCountriesPhones","weight":79,"cookies":false,"type":"","demo":"locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"localeGetCurrencies","consumes":["application\/json"],"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":"getCurrencies","weight":81,"cookies":false,"type":"","demo":"locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"localeGetLanguages","consumes":["application\/json"],"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":"getLanguages","weight":82,"cookies":false,"type":"","demo":"locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's files. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Files List","schema":{"$ref":"#\/definitions\/fileList"}}},"x-appwrite":{"method":"listFiles","weight":132,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"storageCreateFile","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":131,"cookies":false,"type":"upload","demo":"storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"storageGetFile","consumes":["application\/json"],"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","weight":133,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique 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","weight":137,"cookies":false,"type":"","demo":"storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["read","write"]}}]},"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","weight":138,"cookies":false,"type":"","demo":"storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["application\/json"],"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","weight":135,"cookies":false,"type":"location","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":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"storageGetFilePreview","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":134,"cookies":false,"type":"location","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":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"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 0 and 360.","required":false,"type":"integer","format":"int32","x-example":0,"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","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"storageGetFileView","consumes":["application\/json"],"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","weight":136,"cookies":false,"type":"location","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":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's teams. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":140,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":139,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its unique ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":141,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"teamsUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Update a team by its unique ID. Only team owners have write access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":142,"cookies":false,"type":"","demo":"teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"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 by its unique ID. Only team owners have write access for this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":143,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team members by the team unique ID. All team members have read access for this list of resources.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":146,"cookies":false,"type":"","demo":"teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"teamsCreateMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":144,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"New team member email.","default":null,"x-example":"email@example.com"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"},"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](\/docs\/permissions). Max length for each role is 32 chars.","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. 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","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":145,"cookies":false,"type":"","demo":"teams\/update-membership-roles.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-roles.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":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique 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":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Max length for each role is 32 chars.","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","weight":148,"cookies":false,"type":"","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":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique 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 recieved by the user.","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":147,"cookies":false,"type":"","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 unique 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 unique ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}}},"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":"database","description":"The Database 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":"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":"functions","description":"The Functions Service allows you view, create and manage your Cloud Functions."}],"definitions":{"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"},"version":{"type":"string","description":"Server version number.","x-example":"1.0"}},"required":["message","code","version"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["sum","documents"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["sum","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["sum","files"]},"teamList":{"description":"Teams List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["sum","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["sum","memberships"]},"executionList":{"description":"Executions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["sum","executions"]},"countryList":{"description":"Countries List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["sum","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["sum","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["sum","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["sum","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["sum","phones"]},"permissions":{"description":"Permissions","type":"object","properties":{"read":{"type":"array","description":"Read permissions.","items":{"type":"string"},"x-example":"user:5e5ea5c16897e"},"write":{"type":"array","description":"Write permissions.","items":{"type":"string"},"x-example":"user:5e5ea5c16897e"}},"required":["read","write"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Collection permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Collection name.","x-example":"Movies"},"dateCreated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981550,"format":"int32"},"rules":{"type":"array","description":"Collection rules.","items":{"type":"object","$ref":"#\/definitions\/rule"},"x-example":""}},"required":["$id","$permissions","name","dateCreated","dateUpdated","rules"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$permissions":{"type":"object","description":"Document permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}}},"additionalProperties":true,"required":["$id","$collection","$permissions"]},"rule":{"description":"Rule","type":"object","properties":{"$id":{"type":"string","description":"Rule ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Rule Collection.","x-example":"5e5e66c16897e"},"type":{"type":"string","description":"Rule type. Possible values: ","x-example":"title"},"key":{"type":"string","description":"Rule key.","x-example":"title"},"label":{"type":"string","description":"Rule label.","x-example":"Title"},"default":{"type":"string","description":"Rule default value.","x-example":"Movie Name"},"array":{"type":"boolean","description":"Is array?","x-example":false},"required":{"type":"boolean","description":"Is required?","x-example":true},"list":{"type":"array","description":"List of allowed values","items":{"type":"string"},"x-example":"5e5ea5c168099"}},"required":["$id","$collection","type","key","label","default","array","required","list"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"integer","description":"Log creation time in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","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"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"registration":{"type":"integer","description":"User registration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"status":{"type":"integer","description":"User status. 0 for Unactivated, 1 for active and 2 is blocked.","x-example":0,"format":"int32"},"passwordUpdate":{"type":"integer","description":"Unix timestamp of the most recent password update","x-example":1592981250,"format":"int32"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"emailVerification":{"type":"boolean","description":"Email verification 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"}}},"required":["$id","name","registration","status","passwordUpdate","email","emailVerification","prefs"]},"preferences":{"description":"Preferences","type":"object","additionalProperties":true},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5bb8c16897e"},"expire":{"type":"integer","description":"Session expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"provider":{"type":"string","description":"Session Provider.","x-example":"email"},"providerUid":{"type":"string","description":"Session Provider User ID.","x-example":"user@example.com"},"providerToken":{"type":"string","description":"Session Provider 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}},"required":["$id","userId","expire","provider","providerUid","providerToken","ip","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName","current"]},"token":{"description":"Token","type":"object","properties":{"$id":{"type":"string","description":"Token ID.","x-example":"bb8ea5c16897e"},"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":"integer","description":"Token expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"}},"required":["$id","userId","secret","expire"]},"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 Europian 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"]},"file":{"description":"File","type":"object","properties":{"$id":{"type":"string","description":"File ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"File permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"dateCreated":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"}},"required":["$id","$permissions","name","dateCreated","signature","mimeType","sizeOriginal"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"dateCreated":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"sum":{"type":"integer","description":"Total sum of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","sum"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"VIP"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"invited":{"type":"integer","description":"Date, the user has been invited to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"joined":{"type":"integer","description":"Date, the user has accepted the invitation to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"confirm":{"type":"boolean","description":"User confirmation status, true if the user has joined the team or false otherwise.","x-example":false},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"},"x-example":"admin"}},"required":["$id","userId","teamId","name","email","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Function permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"dateCreated":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981257,"format":"int32"},"status":{"type":"string","description":"Function status. Possible values: disabled, enabled","x-example":"enabled"},"env":{"type":"string","description":"Function execution environment.","x-example":"python-3.8"},"tag":{"type":"string","description":"Function active tag ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"string","description":"Function environment variables.","x-example":{"key":"value"}},"events":{"type":"array","description":"Function trigger events.","items":{"type":"string"},"x-example":"account.create"},"schedule":{"type":"string","description":"Function execution schedult in CRON format.","x-example":"5 4 * * *"},"scheduleNext":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981292,"format":"int32"},"schedulePrevious":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981237,"format":"int32"},"timeout":{"type":"integer","description":"Function execution timeout in seconds.","x-example":1592981237,"format":"int32"}},"required":["$id","$permissions","name","dateCreated","dateUpdated","status","env","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"tag":{"description":"Tag","type":"object","properties":{"$id":{"type":"string","description":"Tag ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The tag creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"command":{"type":"string","description":"The entrypoint command in use to execute the tag code.","x-example":"enabled"},"size":{"type":"string","description":"The code size in bytes.","x-example":"python-3.8"}},"required":["$id","functionId","dateCreated","command","size"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"exitCode":{"type":"integer","description":"The script exit code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string.","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"float"}},"required":["$id","functionId","dateCreated","trigger","status","exitCode","stdout","stderr","time"]},"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":"float"},"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"]}},"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/0.8.x.console.json b/app/config/specs/0.8.x.console.json index 3eb34bfe2..8620b96d2 100644 --- a/app/config/specs/0.8.x.console.json +++ b/app/config/specs/0.8.x.console.json @@ -1 +1,2 @@ -{"swagger":"2.0","info":{"version":"0.8.0","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@appwrite.io"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","x-appwrite":{"demo":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","x-appwrite":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"JWT":{"type":"apiKey","name":"X-Appwrite-JWT","description":"Your secret JSON Web Token","in":"header","x-appwrite":{"demo":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."}},"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":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"get","weight":44,"cookies":false,"type":"","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](\/docs\/client\/account#accountCreateVerification) 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](\/docs\/client\/account#accountCreateSession).","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"create","weight":36,"cookies":false,"type":"","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":"public","platforms":["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 between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":52,"cookies":false,"type":"","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":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"accountUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":50,"cookies":false,"type":"","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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/jwt":{"post":{"summary":"Create Account 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.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":43,"cookies":false,"type":"","demo":"account\/create-j-w-t.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"account","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"accountGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":47,"cookies":false,"type":"","demo":"account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account 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","weight":48,"cookies":false,"type":"","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 Account 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 and Team Invites, oldPassword is optional.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":49,"cookies":false,"type":"","demo":"account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","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 between 6 to 32 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Old user password. Must be between 6 to 32 chars.","default":"","x-example":"password"}},"required":["password"]}}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"accountGetPrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"getPrefs","weight":45,"cookies":false,"type":"","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 Account Preferences","operationId":"accountUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":51,"cookies":false,"type":"","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":null,"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](\/docs\/client\/account#accountUpdateRecovery) 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","weight":55,"cookies":false,"type":"","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}","scope":"public","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":"Complete Password Recovery","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](\/docs\/client\/account#accountCreateRecovery) 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","weight":56,"cookies":false,"type":"","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":"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 account UID address.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"New password again. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["userId","secret","password","passwordAgain"]}}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"accountGetSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","responses":{"200":{"description":"Sessions List","schema":{"$ref":"#\/definitions\/sessionList"}}},"x-appwrite":{"method":"getSessions","weight":46,"cookies":false,"type":"","demo":"account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]},"post":{"summary":"Create Account Session","operationId":"accountCreateSession","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.","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createSession","weight":37,"cookies":false,"type":"","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":"url:{url},email:{param-email}","scope":"public","platforms":["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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]},"delete":{"summary":"Delete All Account 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","weight":54,"cookies":false,"type":"","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 account, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":42,"cookies":false,"type":"","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":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"accountCreateOAuth2Session","consumes":["application\/json"],"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.","responses":{"301":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"createOAuth2Session","weight":38,"cookies":false,"type":"webAuth","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":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, yahoo, yandex, wordpress.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"accountDeleteSession","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all their account sessions across all of their different devices. When using the option id argument, only the session unique ID provider will be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":53,"cookies":false,"type":"","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 unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"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](\/docs\/client\/account#accountUpdateVerification). 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","weight":57,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client","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":"Complete Email Verification","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","weight":58,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique 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":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":60,"cookies":false,"type":"location","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","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"avatarsGetCreditCard","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":59,"cookies":false,"type":"location","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, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"avatarsGetFavicon","consumes":["application\/json"],"produces":["image\/*"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFavicon","weight":63,"cookies":false,"type":"location","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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":61,"cookies":false,"type":"location","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","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"avatarsGetImage","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":62,"cookies":false,"type":"location","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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":65,"cookies":false,"type":"location","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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"avatarsGetQR","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":64,"cookies":false,"type":"location","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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"databaseListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's collections. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":67,"cookies":false,"type":"","demo":"database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"databaseCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Collection.","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":66,"cookies":false,"type":"","demo":"database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","read","write","rules"]}}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databaseGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":68,"cookies":false,"type":"","demo":"database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databaseUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Update a collection by its unique ID.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":69,"cookies":false,"type":"","demo":"database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique 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]"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]},"delete":{"summary":"Delete Collection","operationId":"databaseDeleteCollection","consumes":["application\/json"],"produces":[],"tags":["database"],"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","weight":70,"cookies":false,"type":"","demo":"database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databaseListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's documents. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":72,"cookies":false,"type":"","demo":"database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"databaseCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database#databaseCreateCollection) API or directly from your database console.","responses":{"201":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"createDocument","weight":71,"cookies":false,"type":"","demo":"database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"parentDocument":{"type":"string","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","default":"","x-example":"[PARENT_DOCUMENT]"},"parentProperty":{"type":"string","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","default":"","x-example":null},"parentPropertyType":{"type":"string","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","default":"assign","x-example":"assign"}},"required":["data"]}}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databaseGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":73,"cookies":false,"type":"","demo":"database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databaseUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":74,"cookies":false,"type":"","demo":"database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["data"]}}]},"delete":{"summary":"Delete Document","operationId":"databaseDeleteDocument","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"Delete a document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":75,"cookies":false,"type":"","demo":"database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions":{"get":{"summary":"List Functions","operationId":"functionsList","consumes":["application\/json"],"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","weight":161,"cookies":false,"type":"","demo":"functions\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Function","operationId":"functionsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function. You can pass a list of [permissions](\/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","weight":160,"cookies":false,"type":"","demo":"functions\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"execute":{"type":"array","description":"An array of strings with execution permissions. By default no user is granted with any execute permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"env":{"type":"string","description":"Execution enviornment.","default":null,"x-example":"dotnet-3.1"},"vars":{"type":"object","description":"Key-value JSON object.","default":{},"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name","execute","env"]}}]}},"\/functions\/{functionId}":{"get":{"summary":"Get Function","operationId":"functionsGet","consumes":["application\/json"],"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","weight":162,"cookies":false,"type":"","demo":"functions\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]},"put":{"summary":"Update Function","operationId":"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","weight":164,"cookies":false,"type":"","demo":"functions\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"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":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"execute":{"type":"array","description":"An array of strings with execution permissions. By default no user is granted with any execute permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"vars":{"type":"object","description":"Key-value JSON object.","default":{},"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name","execute"]}}]},"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","weight":166,"cookies":false,"type":"","demo":"functions\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions":{"get":{"summary":"List Executions","operationId":"functionsListExecutions","consumes":["application\/json"],"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. On admin mode, this endpoint will return a list of all of the project's executions. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Executions List","schema":{"$ref":"#\/definitions\/executionList"}}},"x-appwrite":{"method":"listExecutions","weight":172,"cookies":false,"type":"","demo":"functions\/list-executions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-executions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"execution.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Execution","operationId":"functionsCreateExecution","consumes":["application\/json"],"produces":["application\/json"],"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","weight":171,"cookies":false,"type":"","demo":"functions\/create-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-execution.md","rate-limit":60,"rate-time":60,"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 unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"string","description":"String of custom data to send to function.","default":"","x-example":"[DATA]"}}}}]}},"\/functions\/{functionId}\/executions\/{executionId}":{"get":{"summary":"Get Execution","operationId":"functionsGetExecution","consumes":["application\/json"],"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","weight":173,"cookies":false,"type":"","demo":"functions\/get-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"execution.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution unique ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/tag":{"patch":{"summary":"Update Function Tag","operationId":"functionsUpdateTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code tag ID using the unique function ID. Use this endpoint to switch the code tag that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateTag","weight":165,"cookies":false,"type":"","demo":"functions\/update-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-tag.md","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":{"tag":{"type":"string","description":"Tag unique ID.","default":null,"x-example":"[TAG]"}},"required":["tag"]}}]}},"\/functions\/{functionId}\/tags":{"get":{"summary":"List Tags","operationId":"functionsListTags","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code tags. You can use the query params to filter your results.","responses":{"200":{"description":"Tags List","schema":{"$ref":"#\/definitions\/tagList"}}},"x-appwrite":{"method":"listTags","weight":168,"cookies":false,"type":"","demo":"functions\/list-tags.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-tags.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"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":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Tag","operationId":"functionsCreateTag","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code tag. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's tag to use your new tag UID.\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](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"201":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"createTag","weight":167,"cookies":false,"type":"","demo":"functions\/create-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"packaging":true,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"command","description":"Code execution command.","required":true,"type":"string","x-example":"[COMMAND]","in":"formData"},{"name":"code","description":"Gzip file 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"}]}},"\/functions\/{functionId}\/tags\/{tagId}":{"get":{"summary":"Get Tag","operationId":"functionsGetTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code tag by its unique ID.","responses":{"200":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"getTag","weight":169,"cookies":false,"type":"","demo":"functions\/get-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"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":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]},"delete":{"summary":"Delete Tag","operationId":"functionsDeleteTag","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code tag by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteTag","weight":170,"cookies":false,"type":"","demo":"functions\/delete-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"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":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]}},"\/functions\/{functionId}\/usage":{"get":{"summary":"Get Function Usage","operationId":"functionsGetUsage","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getUsage","weight":163,"cookies":false,"type":"","demo":"functions\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","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 unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"healthGet","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"get","weight":83,"cookies":false,"type":"","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 Anti virus","operationId":"healthGetAntiVirus","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getAntiVirus","weight":95,"cookies":false,"type":"","demo":"health\/get-anti-virus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getCache","weight":86,"cookies":false,"type":"","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\/db":{"get":{"summary":"Get DB","operationId":"healthGetDB","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getDB","weight":85,"cookies":false,"type":"","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\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":[],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueCertificates","weight":92,"cookies":false,"type":"","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":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"healthGetQueueFunctions","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueFunctions","weight":93,"cookies":false,"type":"","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":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"healthGetQueueLogs","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueLogs","weight":90,"cookies":false,"type":"","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":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"healthGetQueueTasks","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueTasks","weight":89,"cookies":false,"type":"","demo":"health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"healthGetQueueUsage","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueUsage","weight":91,"cookies":false,"type":"","demo":"health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":88,"cookies":false,"type":"","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":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"healthGetStorageLocal","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getStorageLocal","weight":94,"cookies":false,"type":"","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":["application\/json"],"produces":[],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getTime","weight":87,"cookies":false,"type":"","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":["application\/json"],"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","weight":76,"cookies":false,"type":"","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\/continents":{"get":{"summary":"List Continents","operationId":"localeGetContinents","consumes":["application\/json"],"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":"getContinents","weight":80,"cookies":false,"type":"","demo":"locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"localeGetCountries","consumes":["application\/json"],"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":"getCountries","weight":77,"cookies":false,"type":"","demo":"locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"localeGetCountriesEU","consumes":["application\/json"],"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":"getCountriesEU","weight":78,"cookies":false,"type":"","demo":"locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"localeGetCountriesPhones","consumes":["application\/json"],"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":"getCountriesPhones","weight":79,"cookies":false,"type":"","demo":"locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"localeGetCurrencies","consumes":["application\/json"],"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":"getCurrencies","weight":81,"cookies":false,"type":"","demo":"locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"localeGetLanguages","consumes":["application\/json"],"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":"getLanguages","weight":82,"cookies":false,"type":"","demo":"locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/projects":{"get":{"summary":"List Projects","operationId":"projectsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Projects List","schema":{"$ref":"#\/definitions\/projectList"}}},"x-appwrite":{"method":"list","weight":98,"cookies":false,"type":"","demo":"projects\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Project","operationId":"projectsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"create","weight":97,"cookies":false,"type":"","demo":"projects\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"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]"},"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","teamId"]}}]}},"\/projects\/{projectId}":{"get":{"summary":"Get Project","operationId":"projectsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"get","weight":99,"cookies":false,"type":"","demo":"projects\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"update","weight":101,"cookies":false,"type":"","demo":"projects\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":105,"cookies":false,"type":"","demo":"projects\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":{"password":{"type":"string","description":"Your user password for confirmation. Must be between 6 to 32 chars.","default":null,"x-example":"[PASSWORD]"}},"required":["password"]}}]}},"\/projects\/{projectId}\/auth\/limit":{"patch":{"summary":"Update Project users limit","operationId":"projectsUpdateAuthLimit","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateAuthLimit","weight":103,"cookies":false,"type":"","demo":"projects\/update-auth-limit.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"string","description":"Set the max number of users allowed in this project. Use 0 for unlimited.","default":null,"x-example":null}},"required":["limit"]}}]}},"\/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":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateAuthStatus","weight":104,"cookies":false,"type":"","demo":"projects\/update-auth-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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,anonymous,invites,jwt,phone","required":true,"type":"string","x-example":"email-password","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}\/domains":{"get":{"summary":"List Domains","operationId":"projectsListDomains","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Domains List","schema":{"$ref":"#\/definitions\/domainList"}}},"x-appwrite":{"method":"listDomains","weight":127,"cookies":false,"type":"","demo":"projects\/list-domains.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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 Domain","operationId":"projectsCreateDomain","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Domain","schema":{"$ref":"#\/definitions\/domain"}}},"x-appwrite":{"method":"createDomain","weight":126,"cookies":false,"type":"","demo":"projects\/create-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":{"domain":{"type":"string","description":"Domain name.","default":null,"x-example":null}},"required":["domain"]}}]}},"\/projects\/{projectId}\/domains\/{domainId}":{"get":{"summary":"Get Domain","operationId":"projectsGetDomain","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Domain","schema":{"$ref":"#\/definitions\/domain"}}},"x-appwrite":{"method":"getDomain","weight":128,"cookies":false,"type":"","demo":"projects\/get-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]},"delete":{"summary":"Delete Domain","operationId":"projectsDeleteDomain","consumes":["application\/json"],"produces":[],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDomain","weight":130,"cookies":false,"type":"","demo":"projects\/delete-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/domains\/{domainId}\/verification":{"patch":{"summary":"Update Domain Verification Status","operationId":"projectsUpdateDomainVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Domain","schema":{"$ref":"#\/definitions\/domain"}}},"x-appwrite":{"method":"updateDomainVerification","weight":129,"cookies":false,"type":"","demo":"projects\/update-domain-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/keys":{"get":{"summary":"List Keys","operationId":"projectsListKeys","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"API Keys List","schema":{"$ref":"#\/definitions\/keyList"}}},"x-appwrite":{"method":"listKeys","weight":112,"cookies":false,"type":"","demo":"projects\/list-keys.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"","responses":{"201":{"description":"Key","schema":{"$ref":"#\/definitions\/key"}}},"x-appwrite":{"method":"createKey","weight":111,"cookies":false,"type":"","demo":"projects\/create-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","scopes"]}}]}},"\/projects\/{projectId}\/keys\/{keyId}":{"get":{"summary":"Get Key","operationId":"projectsGetKey","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Key","schema":{"$ref":"#\/definitions\/key"}}},"x-appwrite":{"method":"getKey","weight":113,"cookies":false,"type":"","demo":"projects\/get-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"","responses":{"200":{"description":"Key","schema":{"$ref":"#\/definitions\/key"}}},"x-appwrite":{"method":"updateKey","weight":114,"cookies":false,"type":"","demo":"projects\/update-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","scopes"]}}]},"delete":{"summary":"Delete Key","operationId":"projectsDeleteKey","consumes":["application\/json"],"produces":[],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteKey","weight":115,"cookies":false,"type":"","demo":"projects\/delete-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateOAuth2","weight":102,"cookies":false,"type":"","demo":"projects\/update-o-auth2.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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"},"appId":{"type":"string","description":"Provider app ID. Max length: 256 chars.","default":"","x-example":"[APP_ID]"},"secret":{"type":"string","description":"Provider secret key. Max length: 512 chars.","default":"","x-example":"[SECRET]"}},"required":["provider"]}}]}},"\/projects\/{projectId}\/platforms":{"get":{"summary":"List Platforms","operationId":"projectsListPlatforms","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Platforms List","schema":{"$ref":"#\/definitions\/platformList"}}},"x-appwrite":{"method":"listPlatforms","weight":122,"cookies":false,"type":"","demo":"projects\/list-platforms.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"","responses":{"201":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"createPlatform","weight":121,"cookies":false,"type":"","demo":"projects\/create-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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"},"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 hostname. Max length: 256 chars.","default":"","x-example":"[HOSTNAME]"}},"required":["type","name"]}}]}},"\/projects\/{projectId}\/platforms\/{platformId}":{"get":{"summary":"Get Platform","operationId":"projectsGetPlatform","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"getPlatform","weight":123,"cookies":false,"type":"","demo":"projects\/get-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"","responses":{"200":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"updatePlatform","weight":124,"cookies":false,"type":"","demo":"projects\/update-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"[HOSTNAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Platform","operationId":"projectsDeletePlatform","consumes":["application\/json"],"produces":[],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deletePlatform","weight":125,"cookies":false,"type":"","demo":"projects\/delete-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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}\/tasks":{"get":{"summary":"List Tasks","operationId":"projectsListTasks","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Tasks List","schema":{"$ref":"#\/definitions\/taskList"}}},"x-appwrite":{"method":"listTasks","weight":117,"cookies":false,"type":"","demo":"projects\/list-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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 Task","operationId":"projectsCreateTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Task","schema":{"$ref":"#\/definitions\/task"}}},"x-appwrite":{"method":"createTask","weight":116,"cookies":false,"type":"","demo":"projects\/create-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"Task name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"status":{"type":"string","description":"Task status.","default":null,"x-example":"play"},"schedule":{"type":"string","description":"Task schedule CRON syntax.","default":null,"x-example":null},"security":{"type":"boolean","description":"Certificate verification, false for disabled or true for enabled.","default":null,"x-example":false},"httpMethod":{"type":"string","description":"Task HTTP method.","default":null,"x-example":"GET"},"httpUrl":{"type":"string","description":"Task HTTP URL","default":null,"x-example":"https:\/\/example.com"},"httpHeaders":{"type":"array","description":"Task HTTP headers list.","default":null,"x-example":null,"items":{"type":"string"}},"httpUser":{"type":"string","description":"Task HTTP user. Max length: 256 chars.","default":"","x-example":"[HTTP_USER]"},"httpPass":{"type":"string","description":"Task HTTP password. Max length: 256 chars.","default":"","x-example":"[HTTP_PASS]"}},"required":["name","status","schedule","security","httpMethod","httpUrl"]}}]}},"\/projects\/{projectId}\/tasks\/{taskId}":{"get":{"summary":"Get Task","operationId":"projectsGetTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Task","schema":{"$ref":"#\/definitions\/task"}}},"x-appwrite":{"method":"getTask","weight":118,"cookies":false,"type":"","demo":"projects\/get-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]},"put":{"summary":"Update Task","operationId":"projectsUpdateTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Task","schema":{"$ref":"#\/definitions\/task"}}},"x-appwrite":{"method":"updateTask","weight":119,"cookies":false,"type":"","demo":"projects\/update-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Task name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"status":{"type":"string","description":"Task status.","default":null,"x-example":"play"},"schedule":{"type":"string","description":"Task schedule CRON syntax.","default":null,"x-example":null},"security":{"type":"boolean","description":"Certificate verification, false for disabled or true for enabled.","default":null,"x-example":false},"httpMethod":{"type":"string","description":"Task HTTP method.","default":null,"x-example":"GET"},"httpUrl":{"type":"string","description":"Task HTTP URL.","default":null,"x-example":"https:\/\/example.com"},"httpHeaders":{"type":"array","description":"Task HTTP headers list.","default":null,"x-example":null,"items":{"type":"string"}},"httpUser":{"type":"string","description":"Task HTTP user. Max length: 256 chars.","default":"","x-example":"[HTTP_USER]"},"httpPass":{"type":"string","description":"Task HTTP password. Max length: 256 chars.","default":"","x-example":"[HTTP_PASS]"}},"required":["name","status","schedule","security","httpMethod","httpUrl"]}}]},"delete":{"summary":"Delete Task","operationId":"projectsDeleteTask","consumes":["application\/json"],"produces":[],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteTask","weight":120,"cookies":false,"type":"","demo":"projects\/delete-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get Project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":[],"tags":["projects"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getUsage","weight":100,"cookies":false,"type":"","demo":"projects\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/projects\/{projectId}\/webhooks":{"get":{"summary":"List Webhooks","operationId":"projectsListWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Webhooks List","schema":{"$ref":"#\/definitions\/webhookList"}}},"x-appwrite":{"method":"listWebhooks","weight":107,"cookies":false,"type":"","demo":"projects\/list-webhooks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"","responses":{"201":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"createWebhook","weight":106,"cookies":false,"type":"","demo":"projects\/create-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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]"},"events":{"type":"array","description":"Events list.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"Webhook URL.","default":null,"x-example":"https:\/\/example.com"},"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":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"getWebhook","weight":108,"cookies":false,"type":"","demo":"projects\/get-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"","responses":{"200":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"updateWebhook","weight":109,"cookies":false,"type":"","demo":"projects\/update-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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]"},"events":{"type":"array","description":"Events list.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"Webhook URL.","default":null,"x-example":"https:\/\/example.com"},"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":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteWebhook","weight":110,"cookies":false,"type":"","demo":"projects\/delete-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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"}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's files. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Files List","schema":{"$ref":"#\/definitions\/fileList"}}},"x-appwrite":{"method":"listFiles","weight":132,"cookies":false,"type":"","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":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"storageCreateFile","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":131,"cookies":false,"type":"upload","demo":"storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"storageGetFile","consumes":["application\/json"],"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","weight":133,"cookies":false,"type":"","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":"fileId","description":"File unique 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","weight":137,"cookies":false,"type":"","demo":"storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["read","write"]}}]},"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","weight":138,"cookies":false,"type":"","demo":"storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["application\/json"],"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","weight":135,"cookies":false,"type":"location","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":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"storageGetFilePreview","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":134,"cookies":false,"type":"location","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":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"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":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"rotation","description":"Preview image rotation in degrees. Pass an integer between 0 and 360.","required":false,"type":"integer","format":"int32","x-example":0,"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","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"storageGetFileView","consumes":["application\/json"],"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","weight":136,"cookies":false,"type":"location","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":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's teams. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":140,"cookies":false,"type":"","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":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":139,"cookies":false,"type":"","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":{"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](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its unique ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":141,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"teamsUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Update a team by its unique ID. Only team owners have write access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":142,"cookies":false,"type":"","demo":"teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"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 by its unique ID. Only team owners have write access for this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":143,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team members by the team unique ID. All team members have read access for this list of resources.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":146,"cookies":false,"type":"","demo":"teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"teamsCreateMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":144,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"New team member email.","default":null,"x-example":"email@example.com"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"},"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](\/docs\/permissions). Max length for each role is 32 chars.","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. 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","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":145,"cookies":false,"type":"","demo":"teams\/update-membership-roles.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-roles.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 unique 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":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Max length for each role is 32 chars.","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","weight":148,"cookies":false,"type":"","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 unique 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 recieved by the user.","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":147,"cookies":false,"type":"","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 unique 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 unique ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/users":{"get":{"summary":"List Users","operationId":"usersList","consumes":["application\/json"],"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","weight":150,"cookies":false,"type":"","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":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create User","operationId":"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","weight":149,"cookies":false,"type":"","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":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"usersGet","consumes":["application\/json"],"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","weight":151,"cookies":false,"type":"","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 unique 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.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":159,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get a user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":154,"cookies":false,"type":"","demo":"users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"usersGetPrefs","consumes":["application\/json"],"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","weight":152,"cookies":false,"type":"","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 unique 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. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":156,"cookies":false,"type":"","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 unique 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":null,"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"usersGetSessions","consumes":["application\/json"],"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":"getSessions","weight":153,"cookies":false,"type":"","demo":"users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"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","weight":158,"cookies":false,"type":"","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 unique 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","weight":157,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":155,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"integer","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","default":null,"x-example":1}},"required":["status"]}}]}}},"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":"database","description":"The Database 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":"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":"functions","description":"The Functions Service allows you view, create and manage your Cloud Functions."}],"definitions":{"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"},"version":{"type":"string","description":"Server version number.","x-example":"1.0"}},"required":["message","code","version"]},"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["sum","collections"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["sum","documents"]},"userList":{"description":"Users List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"},"x-example":""}},"required":["sum","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["sum","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["sum","files"]},"teamList":{"description":"Teams List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["sum","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["sum","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["sum","functions"]},"tagList":{"description":"Tags List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"tags":{"type":"array","description":"List of tags.","items":{"type":"object","$ref":"#\/definitions\/tag"},"x-example":""}},"required":["sum","tags"]},"executionList":{"description":"Executions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["sum","executions"]},"projectList":{"description":"Projects List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"projects":{"type":"array","description":"List of projects.","items":{"type":"object","$ref":"#\/definitions\/project"},"x-example":""}},"required":["sum","projects"]},"webhookList":{"description":"Webhooks List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"webhooks":{"type":"array","description":"List of webhooks.","items":{"type":"object","$ref":"#\/definitions\/webhook"},"x-example":""}},"required":["sum","webhooks"]},"keyList":{"description":"API Keys List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["sum","keys"]},"taskList":{"description":"Tasks List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"tasks":{"type":"array","description":"List of tasks.","items":{"type":"object","$ref":"#\/definitions\/task"},"x-example":""}},"required":["sum","tasks"]},"platformList":{"description":"Platforms List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"platforms":{"type":"array","description":"List of platforms.","items":{"type":"object","$ref":"#\/definitions\/platform"},"x-example":""}},"required":["sum","platforms"]},"domainList":{"description":"Domains List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"domains":{"type":"array","description":"List of domains.","items":{"type":"object","$ref":"#\/definitions\/domain"},"x-example":""}},"required":["sum","domains"]},"countryList":{"description":"Countries List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["sum","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["sum","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["sum","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["sum","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["sum","phones"]},"permissions":{"description":"Permissions","type":"object","properties":{"read":{"type":"array","description":"Read permissions.","items":{"type":"string"},"x-example":"user:5e5ea5c16897e"},"write":{"type":"array","description":"Write permissions.","items":{"type":"string"},"x-example":"user:5e5ea5c16897e"}},"required":["read","write"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Collection permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Collection name.","x-example":"Movies"},"dateCreated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981550,"format":"int32"},"rules":{"type":"array","description":"Collection rules.","items":{"type":"object","$ref":"#\/definitions\/rule"},"x-example":""}},"required":["$id","$permissions","name","dateCreated","dateUpdated","rules"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$permissions":{"type":"object","description":"Document permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}}},"additionalProperties":true,"required":["$id","$collection","$permissions"]},"rule":{"description":"Rule","type":"object","properties":{"$id":{"type":"string","description":"Rule ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Rule Collection.","x-example":"5e5e66c16897e"},"type":{"type":"string","description":"Rule type. Possible values: ","x-example":"title"},"key":{"type":"string","description":"Rule key.","x-example":"title"},"label":{"type":"string","description":"Rule label.","x-example":"Title"},"default":{"type":"string","description":"Rule default value.","x-example":"Movie Name"},"array":{"type":"boolean","description":"Is array?","x-example":false},"required":{"type":"boolean","description":"Is required?","x-example":true},"list":{"type":"array","description":"List of allowed values","items":{"type":"string"},"x-example":"5e5ea5c168099"}},"required":["$id","$collection","type","key","label","default","array","required","list"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"integer","description":"Log creation time in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","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"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"registration":{"type":"integer","description":"User registration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"status":{"type":"integer","description":"User status. 0 for Unactivated, 1 for active and 2 is blocked.","x-example":0,"format":"int32"},"passwordUpdate":{"type":"integer","description":"Unix timestamp of the most recent password update","x-example":1592981250,"format":"int32"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"emailVerification":{"type":"boolean","description":"Email verification 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"}}},"required":["$id","name","registration","status","passwordUpdate","email","emailVerification","prefs"]},"preferences":{"description":"Preferences","type":"object","additionalProperties":true},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5bb8c16897e"},"expire":{"type":"integer","description":"Session expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"provider":{"type":"string","description":"Session Provider.","x-example":"email"},"providerUid":{"type":"string","description":"Session Provider User ID.","x-example":"user@example.com"},"providerToken":{"type":"string","description":"Session Provider 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}},"required":["$id","userId","expire","provider","providerUid","providerToken","ip","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName","current"]},"token":{"description":"Token","type":"object","properties":{"$id":{"type":"string","description":"Token ID.","x-example":"bb8ea5c16897e"},"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":"integer","description":"Token expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"}},"required":["$id","userId","secret","expire"]},"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 Europian 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"]},"file":{"description":"File","type":"object","properties":{"$id":{"type":"string","description":"File ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"File permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"dateCreated":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"}},"required":["$id","$permissions","name","dateCreated","signature","mimeType","sizeOriginal"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"dateCreated":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"sum":{"type":"integer","description":"Total sum of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","sum"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"VIP"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"invited":{"type":"integer","description":"Date, the user has been invited to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"joined":{"type":"integer","description":"Date, the user has accepted the invitation to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"confirm":{"type":"boolean","description":"User confirmation status, true if the user has joined the team or false otherwise.","x-example":false},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"},"x-example":"admin"}},"required":["$id","userId","teamId","name","email","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Function permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"dateCreated":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981257,"format":"int32"},"status":{"type":"string","description":"Function status. Possible values: disabled, enabled","x-example":"enabled"},"env":{"type":"string","description":"Function execution environment.","x-example":"python-3.8"},"tag":{"type":"string","description":"Function active tag ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"string","description":"Function environment variables.","x-example":{"key":"value"}},"events":{"type":"array","description":"Function trigger events.","items":{"type":"string"},"x-example":"account.create"},"schedule":{"type":"string","description":"Function execution schedult in CRON format.","x-example":"5 4 * * *"},"scheduleNext":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981292,"format":"int32"},"schedulePrevious":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981237,"format":"int32"},"timeout":{"type":"integer","description":"Function execution timeout in seconds.","x-example":1592981237,"format":"int32"}},"required":["$id","$permissions","name","dateCreated","dateUpdated","status","env","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"tag":{"description":"Tag","type":"object","properties":{"$id":{"type":"string","description":"Tag ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The tag creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"command":{"type":"string","description":"The entrypoint command in use to execute the tag code.","x-example":"enabled"},"size":{"type":"string","description":"The code size in bytes.","x-example":"python-3.8"}},"required":["$id","functionId","dateCreated","command","size"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"exitCode":{"type":"integer","description":"The script exit code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string.","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"float"}},"required":["$id","functionId","dateCreated","trigger","status","exitCode","stdout","stderr","time"]},"project":{"description":"Project","type":"object","properties":{"$id":{"type":"string","description":"Project ID.","x-example":"5e5ea5c16897e"},"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"},"usersAuthLimit":{"type":"boolean","description":"Max users allowed. 0 is unlimited.","x-example":100},"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":{}},"domains":{"type":"array","description":"List of Domains.","items":{"type":"object","$ref":"#\/definitions\/domain"},"x-example":{}},"tasks":{"type":"array","description":"List of Tasks.","items":{"type":"object","$ref":"#\/definitions\/task"},"x-example":{}},"usersOauth2AmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2AmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2AppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2AppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2BitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2BitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2BitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2BitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2BoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2BoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2DiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2DiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2DropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2DropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2FacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2FacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2GithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2GithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2GitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2GitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2GoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2GoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2LinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2LinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2MicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2MicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2PaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2PaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2PaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2PaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2SalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2SalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2SlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2SlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2SpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2SpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2TradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2TradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2TradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2TradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2TwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2TwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2VkAppid":{"type":"string","description":"VK OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2VkSecret":{"type":"string","description":"VK OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2YahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2YahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2YandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2YandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2WordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2WordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2MockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2MockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersAuthEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"usersAuthAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"usersAuthInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"usersAuthJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"usersAuthPhone":{"type":"boolean","description":"Phone auth method status","x-example":true}},"required":["$id","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","usersAuthLimit","platforms","webhooks","keys","domains","tasks","usersOauth2AmazonAppid","usersOauth2AmazonSecret","usersOauth2AppleAppid","usersOauth2AppleSecret","usersOauth2BitbucketAppid","usersOauth2BitbucketSecret","usersOauth2BitlyAppid","usersOauth2BitlySecret","usersOauth2BoxAppid","usersOauth2BoxSecret","usersOauth2DiscordAppid","usersOauth2DiscordSecret","usersOauth2DropboxAppid","usersOauth2DropboxSecret","usersOauth2FacebookAppid","usersOauth2FacebookSecret","usersOauth2GithubAppid","usersOauth2GithubSecret","usersOauth2GitlabAppid","usersOauth2GitlabSecret","usersOauth2GoogleAppid","usersOauth2GoogleSecret","usersOauth2LinkedinAppid","usersOauth2LinkedinSecret","usersOauth2MicrosoftAppid","usersOauth2MicrosoftSecret","usersOauth2PaypalAppid","usersOauth2PaypalSecret","usersOauth2PaypalSandboxAppid","usersOauth2PaypalSandboxSecret","usersOauth2SalesforceAppid","usersOauth2SalesforceSecret","usersOauth2SlackAppid","usersOauth2SlackSecret","usersOauth2SpotifyAppid","usersOauth2SpotifySecret","usersOauth2TradeshiftAppid","usersOauth2TradeshiftSecret","usersOauth2TradeshiftBoxAppid","usersOauth2TradeshiftBoxSecret","usersOauth2TwitchAppid","usersOauth2TwitchSecret","usersOauth2VkAppid","usersOauth2VkSecret","usersOauth2YahooAppid","usersOauth2YahooSecret","usersOauth2YandexAppid","usersOauth2YandexSecret","usersOauth2WordpressAppid","usersOauth2WordpressSecret","usersOauth2MockAppid","usersOauth2MockSecret","usersAuthEmailPassword","usersAuthAnonymous","usersAuthInvites","usersAuthJWT","usersAuthPhone"]},"webhook":{"description":"Webhook","type":"object","properties":{"$id":{"type":"string","description":"Webhook ID.","x-example":"5e5ea5c16897e"},"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"}},"required":["$id","name","url","events","security","httpUser","httpPass"]},"key":{"description":"Key","type":"object","properties":{"$id":{"type":"string","description":"Key ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Key name.","x-example":"My API Key"},"scopes":{"type":"array","description":"Allowed permission scopes.","items":{"type":"string"},"x-example":"users.read"},"secret":{"type":"string","description":"Secret key.","x-example":"919c2d18fb5d4...a2ae413da83346ad2"}},"required":["$id","name","scopes","secret"]},"task":{"description":"Task","type":"object","properties":{"$id":{"type":"string","description":"Task ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Task name.","x-example":"My Task"},"security":{"type":"boolean","description":"Indicated if SSL \/ TLS Certificate verification is enabled.","x-example":true},"httpMethod":{"type":"string","description":"Task HTTP Method.","x-example":"POST"},"httpUrl":{"type":"string","description":"Task HTTP URL.","x-example":"https:\/\/example.com\/task"},"httpHeaders":{"type":"array","description":"Task HTTP headers.","items":{"type":"string"},"x-example":"key:value"},"httpUser":{"type":"string","description":"HTTP basic authentication username.","x-example":"username"},"httpPass":{"type":"string","description":"HTTP basic authentication password.","x-example":"password"},"duration":{"type":"number","description":"Task duration in seconds.","x-example":1.2,"format":"float"},"delay":{"type":"number","description":"Task delay time in seconds.","x-example":1.2,"format":"float"},"failures":{"type":"integer","description":"Number of recurring task failures.","x-example":0,"format":"int32"},"schedule":{"type":"string","description":"Task schedule in CRON syntax.","x-example":"* * * * *"},"status":{"type":"string","description":"Task status. Possible values: play, pause","x-example":"enabled"},"updated":{"type":"integer","description":"Task last updated time in Unix timestamp.","x-example":1592981250,"format":"int32"},"previous":{"type":"integer","description":"Task previous run time in Unix timestamp.","x-example":1592981250,"format":"int32"},"next":{"type":"integer","description":"Task next run time in Unix timestamp.","x-example":1592981650,"format":"int32"}},"required":["$id","name","security","httpMethod","httpUrl","httpHeaders","httpUser","httpPass","duration","delay","failures","schedule","status","updated","previous","next"]},"domain":{"description":"Domain","type":"object","properties":{"$id":{"type":"string","description":"Domain ID.","x-example":"5e5ea5c16897e"},"domain":{"type":"string","description":"Domain name.","x-example":"appwrite.company.com"},"registerable":{"type":"string","description":"Registerable domain name.","x-example":"company.com"},"tld":{"type":"string","description":"TLD name.","x-example":"com"},"verification":{"type":"boolean","description":"Verification process status.","x-example":true},"certificateId":{"type":"string","description":"Certificate ID.","x-example":"6ejea5c13377e"}},"required":["$id","domain","registerable","tld","verification","certificateId"]},"platform":{"description":"Platform","type":"object","properties":{"$id":{"type":"string","description":"Platform ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Platform name.","x-example":"My Web App"},"type":{"type":"string","description":"Platform type. Possible values are: web, flutter-ios, flutter-android, ios, android, and unity.","x-example":"My Web App"},"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","name","type","key","store","hostname","httpUser","httpPass"]},"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":"float"},"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"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file + +{"swagger":"2.0","info":{"version":"0.8.0","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@appwrite.io"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","x-appwrite":{"demo":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","x-appwrite":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"JWT":{"type":"apiKey","name":"X-Appwrite-JWT","description":"Your secret JSON Web Token","in":"header","x-appwrite":{"demo":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."}},"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":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"get","weight":44,"cookies":false,"type":"","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](\/docs\/client\/account#accountCreateVerification) 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](\/docs\/client\/account#accountCreateSession).","responses":{"201":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"create","weight":36,"cookies":false,"type":"","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":"public","platforms":["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 between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":52,"cookies":false,"type":"","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":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"accountUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":50,"cookies":false,"type":"","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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/jwt":{"post":{"summary":"Create Account 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.","responses":{"201":{"description":"JWT","schema":{"$ref":"#\/definitions\/jwt"}}},"x-appwrite":{"method":"createJWT","weight":43,"cookies":false,"type":"","demo":"account\/create-j-w-t.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-jwt.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"account","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"accountGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":47,"cookies":false,"type":"","demo":"account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account 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","weight":48,"cookies":false,"type":"","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 Account 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 and Team Invites, oldPassword is optional.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":49,"cookies":false,"type":"","demo":"account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","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 between 6 to 32 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Old user password. Must be between 6 to 32 chars.","default":"","x-example":"password"}},"required":["password"]}}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"accountGetPrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"getPrefs","weight":45,"cookies":false,"type":"","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 Account Preferences","operationId":"accountUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":51,"cookies":false,"type":"","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":null,"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](\/docs\/client\/account#accountUpdateRecovery) 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","weight":55,"cookies":false,"type":"","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}","scope":"public","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":"Complete Password Recovery","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](\/docs\/client\/account#accountCreateRecovery) 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","weight":56,"cookies":false,"type":"","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":"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 account UID address.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"New password again. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["userId","secret","password","passwordAgain"]}}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"accountGetSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","responses":{"200":{"description":"Sessions List","schema":{"$ref":"#\/definitions\/sessionList"}}},"x-appwrite":{"method":"getSessions","weight":46,"cookies":false,"type":"","demo":"account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}]},"post":{"summary":"Create Account Session","operationId":"accountCreateSession","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.","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createSession","weight":37,"cookies":false,"type":"","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":"url:{url},email:{param-email}","scope":"public","platforms":["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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]},"delete":{"summary":"Delete All Account 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","weight":54,"cookies":false,"type":"","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 account, you need to update its [email and password](\/docs\/client\/account#accountUpdateEmail).","responses":{"201":{"description":"Session","schema":{"$ref":"#\/definitions\/session"}}},"x-appwrite":{"method":"createAnonymousSession","weight":42,"cookies":false,"type":"","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":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}]}},"\/account\/sessions\/oauth2\/{provider}":{"get":{"summary":"Create Account Session with OAuth2","operationId":"accountCreateOAuth2Session","consumes":["application\/json"],"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.","responses":{"301":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"createOAuth2Session","weight":38,"cookies":false,"type":"webAuth","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":"public","platforms":["client"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"provider","description":"OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, yahoo, yandex, wordpress.","required":true,"type":"string","x-example":"amazon","in":"path"},{"name":"success","description":"URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/success","in":"query"},{"name":"failure","description":"URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https:\/\/cheatsheetseries.owasp.org\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.","required":false,"type":"string","format":"url","x-example":"https:\/\/example.com","default":"https:\/\/appwrite.io\/auth\/oauth2\/failure","in":"query"},{"name":"scopes","description":"A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"accountDeleteSession","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all their account sessions across all of their different devices. When using the option id argument, only the session unique ID provider will be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":53,"cookies":false,"type":"","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 unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"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](\/docs\/client\/account#accountUpdateVerification). 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","weight":57,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client","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":"Complete Email Verification","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","weight":58,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique 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":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":60,"cookies":false,"type":"location","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","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"avatarsGetCreditCard","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":59,"cookies":false,"type":"location","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, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"avatarsGetFavicon","consumes":["application\/json"],"produces":["image\/*"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFavicon","weight":63,"cookies":false,"type":"location","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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":61,"cookies":false,"type":"location","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","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"avatarsGetImage","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":62,"cookies":false,"type":"location","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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":65,"cookies":false,"type":"location","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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"avatarsGetQR","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":64,"cookies":false,"type":"location","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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"databaseListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's collections. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":67,"cookies":false,"type":"","demo":"database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"databaseCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Collection.","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":66,"cookies":false,"type":"","demo":"database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","read","write","rules"]}}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databaseGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":68,"cookies":false,"type":"","demo":"database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databaseUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Update a collection by its unique ID.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":69,"cookies":false,"type":"","demo":"database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique 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]"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]},"delete":{"summary":"Delete Collection","operationId":"databaseDeleteCollection","consumes":["application\/json"],"produces":[],"tags":["database"],"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","weight":70,"cookies":false,"type":"","demo":"database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databaseListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's documents. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":72,"cookies":false,"type":"","demo":"database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"databaseCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database#databaseCreateCollection) API or directly from your database console.","responses":{"201":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"createDocument","weight":71,"cookies":false,"type":"","demo":"database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"parentDocument":{"type":"string","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","default":"","x-example":"[PARENT_DOCUMENT]"},"parentProperty":{"type":"string","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","default":"","x-example":null},"parentPropertyType":{"type":"string","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","default":"assign","x-example":"assign"}},"required":["data"]}}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databaseGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":73,"cookies":false,"type":"","demo":"database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databaseUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":74,"cookies":false,"type":"","demo":"database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["data"]}}]},"delete":{"summary":"Delete Document","operationId":"databaseDeleteDocument","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"Delete a document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":75,"cookies":false,"type":"","demo":"database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions":{"get":{"summary":"List Functions","operationId":"functionsList","consumes":["application\/json"],"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","weight":161,"cookies":false,"type":"","demo":"functions\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Function","operationId":"functionsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function. You can pass a list of [permissions](\/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","weight":160,"cookies":false,"type":"","demo":"functions\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"execute":{"type":"array","description":"An array of strings with execution permissions. By default no user is granted with any execute permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"env":{"type":"string","description":"Execution enviornment.","default":null,"x-example":"dotnet-3.1"},"vars":{"type":"object","description":"Key-value JSON object.","default":{},"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name","execute","env"]}}]}},"\/functions\/{functionId}":{"get":{"summary":"Get Function","operationId":"functionsGet","consumes":["application\/json"],"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","weight":162,"cookies":false,"type":"","demo":"functions\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]},"put":{"summary":"Update Function","operationId":"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","weight":164,"cookies":false,"type":"","demo":"functions\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"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":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"execute":{"type":"array","description":"An array of strings with execution permissions. By default no user is granted with any execute permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"vars":{"type":"object","description":"Key-value JSON object.","default":{},"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name","execute"]}}]},"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","weight":166,"cookies":false,"type":"","demo":"functions\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/executions":{"get":{"summary":"List Executions","operationId":"functionsListExecutions","consumes":["application\/json"],"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. On admin mode, this endpoint will return a list of all of the project's executions. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Executions List","schema":{"$ref":"#\/definitions\/executionList"}}},"x-appwrite":{"method":"listExecutions","weight":172,"cookies":false,"type":"","demo":"functions\/list-executions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-executions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"execution.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Execution","operationId":"functionsCreateExecution","consumes":["application\/json"],"produces":["application\/json"],"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","weight":171,"cookies":false,"type":"","demo":"functions\/create-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-execution.md","rate-limit":60,"rate-time":60,"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 unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"string","description":"String of custom data to send to function.","default":"","x-example":"[DATA]"}}}}]}},"\/functions\/{functionId}\/executions\/{executionId}":{"get":{"summary":"Get Execution","operationId":"functionsGetExecution","consumes":["application\/json"],"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","weight":173,"cookies":false,"type":"","demo":"functions\/get-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"execution.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution unique ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/tag":{"patch":{"summary":"Update Function Tag","operationId":"functionsUpdateTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code tag ID using the unique function ID. Use this endpoint to switch the code tag that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateTag","weight":165,"cookies":false,"type":"","demo":"functions\/update-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-tag.md","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":{"tag":{"type":"string","description":"Tag unique ID.","default":null,"x-example":"[TAG]"}},"required":["tag"]}}]}},"\/functions\/{functionId}\/tags":{"get":{"summary":"List Tags","operationId":"functionsListTags","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code tags. You can use the query params to filter your results.","responses":{"200":{"description":"Tags List","schema":{"$ref":"#\/definitions\/tagList"}}},"x-appwrite":{"method":"listTags","weight":168,"cookies":false,"type":"","demo":"functions\/list-tags.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-tags.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"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":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Tag","operationId":"functionsCreateTag","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code tag. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's tag to use your new tag UID.\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](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"201":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"createTag","weight":167,"cookies":false,"type":"","demo":"functions\/create-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"packaging":true,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"command","description":"Code execution command.","required":true,"type":"string","x-example":"[COMMAND]","in":"formData"},{"name":"code","description":"Gzip file 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"}]}},"\/functions\/{functionId}\/tags\/{tagId}":{"get":{"summary":"Get Tag","operationId":"functionsGetTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code tag by its unique ID.","responses":{"200":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"getTag","weight":169,"cookies":false,"type":"","demo":"functions\/get-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"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":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]},"delete":{"summary":"Delete Tag","operationId":"functionsDeleteTag","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code tag by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteTag","weight":170,"cookies":false,"type":"","demo":"functions\/delete-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"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":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]}},"\/functions\/{functionId}\/usage":{"get":{"summary":"Get Function Usage","operationId":"functionsGetUsage","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getUsage","weight":163,"cookies":false,"type":"","demo":"functions\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","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 unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"healthGet","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"get","weight":83,"cookies":false,"type":"","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 Anti virus","operationId":"healthGetAntiVirus","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getAntiVirus","weight":95,"cookies":false,"type":"","demo":"health\/get-anti-virus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getCache","weight":86,"cookies":false,"type":"","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\/db":{"get":{"summary":"Get DB","operationId":"healthGetDB","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getDB","weight":85,"cookies":false,"type":"","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\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":[],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueCertificates","weight":92,"cookies":false,"type":"","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":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"healthGetQueueFunctions","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueFunctions","weight":93,"cookies":false,"type":"","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":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"healthGetQueueLogs","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueLogs","weight":90,"cookies":false,"type":"","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":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"healthGetQueueTasks","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueTasks","weight":89,"cookies":false,"type":"","demo":"health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"healthGetQueueUsage","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueUsage","weight":91,"cookies":false,"type":"","demo":"health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":88,"cookies":false,"type":"","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":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"healthGetStorageLocal","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getStorageLocal","weight":94,"cookies":false,"type":"","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":["application\/json"],"produces":[],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getTime","weight":87,"cookies":false,"type":"","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":["application\/json"],"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","weight":76,"cookies":false,"type":"","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\/continents":{"get":{"summary":"List Continents","operationId":"localeGetContinents","consumes":["application\/json"],"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":"getContinents","weight":80,"cookies":false,"type":"","demo":"locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"localeGetCountries","consumes":["application\/json"],"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":"getCountries","weight":77,"cookies":false,"type":"","demo":"locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"localeGetCountriesEU","consumes":["application\/json"],"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":"getCountriesEU","weight":78,"cookies":false,"type":"","demo":"locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"localeGetCountriesPhones","consumes":["application\/json"],"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":"getCountriesPhones","weight":79,"cookies":false,"type":"","demo":"locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"localeGetCurrencies","consumes":["application\/json"],"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":"getCurrencies","weight":81,"cookies":false,"type":"","demo":"locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"localeGetLanguages","consumes":["application\/json"],"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":"getLanguages","weight":82,"cookies":false,"type":"","demo":"locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/projects":{"get":{"summary":"List Projects","operationId":"projectsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Projects List","schema":{"$ref":"#\/definitions\/projectList"}}},"x-appwrite":{"method":"list","weight":98,"cookies":false,"type":"","demo":"projects\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Project","operationId":"projectsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"create","weight":97,"cookies":false,"type":"","demo":"projects\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["console"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"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]"},"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","teamId"]}}]}},"\/projects\/{projectId}":{"get":{"summary":"Get Project","operationId":"projectsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"get","weight":99,"cookies":false,"type":"","demo":"projects\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"update","weight":101,"cookies":false,"type":"","demo":"projects\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":105,"cookies":false,"type":"","demo":"projects\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":{"password":{"type":"string","description":"Your user password for confirmation. Must be between 6 to 32 chars.","default":null,"x-example":"[PASSWORD]"}},"required":["password"]}}]}},"\/projects\/{projectId}\/auth\/limit":{"patch":{"summary":"Update Project users limit","operationId":"projectsUpdateAuthLimit","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateAuthLimit","weight":103,"cookies":false,"type":"","demo":"projects\/update-auth-limit.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"string","description":"Set the max number of users allowed in this project. Use 0 for unlimited.","default":null,"x-example":null}},"required":["limit"]}}]}},"\/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":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateAuthStatus","weight":104,"cookies":false,"type":"","demo":"projects\/update-auth-status.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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,anonymous,invites,jwt,phone","required":true,"type":"string","x-example":"email-password","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}\/domains":{"get":{"summary":"List Domains","operationId":"projectsListDomains","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Domains List","schema":{"$ref":"#\/definitions\/domainList"}}},"x-appwrite":{"method":"listDomains","weight":127,"cookies":false,"type":"","demo":"projects\/list-domains.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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 Domain","operationId":"projectsCreateDomain","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Domain","schema":{"$ref":"#\/definitions\/domain"}}},"x-appwrite":{"method":"createDomain","weight":126,"cookies":false,"type":"","demo":"projects\/create-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":{"domain":{"type":"string","description":"Domain name.","default":null,"x-example":null}},"required":["domain"]}}]}},"\/projects\/{projectId}\/domains\/{domainId}":{"get":{"summary":"Get Domain","operationId":"projectsGetDomain","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Domain","schema":{"$ref":"#\/definitions\/domain"}}},"x-appwrite":{"method":"getDomain","weight":128,"cookies":false,"type":"","demo":"projects\/get-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]},"delete":{"summary":"Delete Domain","operationId":"projectsDeleteDomain","consumes":["application\/json"],"produces":[],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDomain","weight":130,"cookies":false,"type":"","demo":"projects\/delete-domain.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/domains\/{domainId}\/verification":{"patch":{"summary":"Update Domain Verification Status","operationId":"projectsUpdateDomainVerification","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Domain","schema":{"$ref":"#\/definitions\/domain"}}},"x-appwrite":{"method":"updateDomainVerification","weight":129,"cookies":false,"type":"","demo":"projects\/update-domain-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"domainId","description":"Domain unique ID.","required":true,"type":"string","x-example":"[DOMAIN_ID]","in":"path"}]}},"\/projects\/{projectId}\/keys":{"get":{"summary":"List Keys","operationId":"projectsListKeys","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"API Keys List","schema":{"$ref":"#\/definitions\/keyList"}}},"x-appwrite":{"method":"listKeys","weight":112,"cookies":false,"type":"","demo":"projects\/list-keys.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"","responses":{"201":{"description":"Key","schema":{"$ref":"#\/definitions\/key"}}},"x-appwrite":{"method":"createKey","weight":111,"cookies":false,"type":"","demo":"projects\/create-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","scopes"]}}]}},"\/projects\/{projectId}\/keys\/{keyId}":{"get":{"summary":"Get Key","operationId":"projectsGetKey","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Key","schema":{"$ref":"#\/definitions\/key"}}},"x-appwrite":{"method":"getKey","weight":113,"cookies":false,"type":"","demo":"projects\/get-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"","responses":{"200":{"description":"Key","schema":{"$ref":"#\/definitions\/key"}}},"x-appwrite":{"method":"updateKey","weight":114,"cookies":false,"type":"","demo":"projects\/update-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","scopes"]}}]},"delete":{"summary":"Delete Key","operationId":"projectsDeleteKey","consumes":["application\/json"],"produces":[],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteKey","weight":115,"cookies":false,"type":"","demo":"projects\/delete-key.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"","responses":{"200":{"description":"Project","schema":{"$ref":"#\/definitions\/project"}}},"x-appwrite":{"method":"updateOAuth2","weight":102,"cookies":false,"type":"","demo":"projects\/update-o-auth2.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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"},"appId":{"type":"string","description":"Provider app ID. Max length: 256 chars.","default":"","x-example":"[APP_ID]"},"secret":{"type":"string","description":"Provider secret key. Max length: 512 chars.","default":"","x-example":"[SECRET]"}},"required":["provider"]}}]}},"\/projects\/{projectId}\/platforms":{"get":{"summary":"List Platforms","operationId":"projectsListPlatforms","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Platforms List","schema":{"$ref":"#\/definitions\/platformList"}}},"x-appwrite":{"method":"listPlatforms","weight":122,"cookies":false,"type":"","demo":"projects\/list-platforms.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"","responses":{"201":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"createPlatform","weight":121,"cookies":false,"type":"","demo":"projects\/create-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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"},"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 hostname. Max length: 256 chars.","default":"","x-example":"[HOSTNAME]"}},"required":["type","name"]}}]}},"\/projects\/{projectId}\/platforms\/{platformId}":{"get":{"summary":"Get Platform","operationId":"projectsGetPlatform","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"getPlatform","weight":123,"cookies":false,"type":"","demo":"projects\/get-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"","responses":{"200":{"description":"Platform","schema":{"$ref":"#\/definitions\/platform"}}},"x-appwrite":{"method":"updatePlatform","weight":124,"cookies":false,"type":"","demo":"projects\/update-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"[HOSTNAME]"}},"required":["name"]}}]},"delete":{"summary":"Delete Platform","operationId":"projectsDeletePlatform","consumes":["application\/json"],"produces":[],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deletePlatform","weight":125,"cookies":false,"type":"","demo":"projects\/delete-platform.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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}\/tasks":{"get":{"summary":"List Tasks","operationId":"projectsListTasks","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Tasks List","schema":{"$ref":"#\/definitions\/taskList"}}},"x-appwrite":{"method":"listTasks","weight":117,"cookies":false,"type":"","demo":"projects\/list-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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 Task","operationId":"projectsCreateTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"201":{"description":"Task","schema":{"$ref":"#\/definitions\/task"}}},"x-appwrite":{"method":"createTask","weight":116,"cookies":false,"type":"","demo":"projects\/create-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"Task name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"status":{"type":"string","description":"Task status.","default":null,"x-example":"play"},"schedule":{"type":"string","description":"Task schedule CRON syntax.","default":null,"x-example":null},"security":{"type":"boolean","description":"Certificate verification, false for disabled or true for enabled.","default":null,"x-example":false},"httpMethod":{"type":"string","description":"Task HTTP method.","default":null,"x-example":"GET"},"httpUrl":{"type":"string","description":"Task HTTP URL","default":null,"x-example":"https:\/\/example.com"},"httpHeaders":{"type":"array","description":"Task HTTP headers list.","default":null,"x-example":null,"items":{"type":"string"}},"httpUser":{"type":"string","description":"Task HTTP user. Max length: 256 chars.","default":"","x-example":"[HTTP_USER]"},"httpPass":{"type":"string","description":"Task HTTP password. Max length: 256 chars.","default":"","x-example":"[HTTP_PASS]"}},"required":["name","status","schedule","security","httpMethod","httpUrl"]}}]}},"\/projects\/{projectId}\/tasks\/{taskId}":{"get":{"summary":"Get Task","operationId":"projectsGetTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Task","schema":{"$ref":"#\/definitions\/task"}}},"x-appwrite":{"method":"getTask","weight":118,"cookies":false,"type":"","demo":"projects\/get-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]},"put":{"summary":"Update Task","operationId":"projectsUpdateTask","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Task","schema":{"$ref":"#\/definitions\/task"}}},"x-appwrite":{"method":"updateTask","weight":119,"cookies":false,"type":"","demo":"projects\/update-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Task name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"status":{"type":"string","description":"Task status.","default":null,"x-example":"play"},"schedule":{"type":"string","description":"Task schedule CRON syntax.","default":null,"x-example":null},"security":{"type":"boolean","description":"Certificate verification, false for disabled or true for enabled.","default":null,"x-example":false},"httpMethod":{"type":"string","description":"Task HTTP method.","default":null,"x-example":"GET"},"httpUrl":{"type":"string","description":"Task HTTP URL.","default":null,"x-example":"https:\/\/example.com"},"httpHeaders":{"type":"array","description":"Task HTTP headers list.","default":null,"x-example":null,"items":{"type":"string"}},"httpUser":{"type":"string","description":"Task HTTP user. Max length: 256 chars.","default":"","x-example":"[HTTP_USER]"},"httpPass":{"type":"string","description":"Task HTTP password. Max length: 256 chars.","default":"","x-example":"[HTTP_PASS]"}},"required":["name","status","schedule","security","httpMethod","httpUrl"]}}]},"delete":{"summary":"Delete Task","operationId":"projectsDeleteTask","consumes":["application\/json"],"produces":[],"tags":["projects"],"description":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteTask","weight":120,"cookies":false,"type":"","demo":"projects\/delete-task.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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":"taskId","description":"Task unique ID.","required":true,"type":"string","x-example":"[TASK_ID]","in":"path"}]}},"\/projects\/{projectId}\/usage":{"get":{"summary":"Get Project","operationId":"projectsGetUsage","consumes":["application\/json"],"produces":[],"tags":["projects"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getUsage","weight":100,"cookies":false,"type":"","demo":"projects\/get-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"range","description":"Date range.","required":false,"type":"string","x-example":"24h","default":"30d","in":"query"}]}},"\/projects\/{projectId}\/webhooks":{"get":{"summary":"List Webhooks","operationId":"projectsListWebhooks","consumes":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Webhooks List","schema":{"$ref":"#\/definitions\/webhookList"}}},"x-appwrite":{"method":"listWebhooks","weight":107,"cookies":false,"type":"","demo":"projects\/list-webhooks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"","responses":{"201":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"createWebhook","weight":106,"cookies":false,"type":"","demo":"projects\/create-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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]"},"events":{"type":"array","description":"Events list.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"Webhook URL.","default":null,"x-example":"https:\/\/example.com"},"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":["application\/json"],"produces":["application\/json"],"tags":["projects"],"description":"","responses":{"200":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"getWebhook","weight":108,"cookies":false,"type":"","demo":"projects\/get-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.read","platforms":["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":"","responses":{"200":{"description":"Webhook","schema":{"$ref":"#\/definitions\/webhook"}}},"x-appwrite":{"method":"updateWebhook","weight":109,"cookies":false,"type":"","demo":"projects\/update-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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]"},"events":{"type":"array","description":"Events list.","default":null,"x-example":null,"items":{"type":"string"}},"url":{"type":"string","description":"Webhook URL.","default":null,"x-example":"https:\/\/example.com"},"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":"","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteWebhook","weight":110,"cookies":false,"type":"","demo":"projects\/delete-webhook.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"projects.write","platforms":["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"}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's files. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Files List","schema":{"$ref":"#\/definitions\/fileList"}}},"x-appwrite":{"method":"listFiles","weight":132,"cookies":false,"type":"","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":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"storageCreateFile","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":131,"cookies":false,"type":"upload","demo":"storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"storageGetFile","consumes":["application\/json"],"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","weight":133,"cookies":false,"type":"","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":"fileId","description":"File unique 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","weight":137,"cookies":false,"type":"","demo":"storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["read","write"]}}]},"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","weight":138,"cookies":false,"type":"","demo":"storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["application\/json"],"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","weight":135,"cookies":false,"type":"location","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":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"storageGetFilePreview","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":134,"cookies":false,"type":"location","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":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"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 0 and 360.","required":false,"type":"integer","format":"int32","x-example":0,"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","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"storageGetFileView","consumes":["application\/json"],"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","weight":136,"cookies":false,"type":"location","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":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's teams. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":140,"cookies":false,"type":"","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":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":139,"cookies":false,"type":"","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":{"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](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its unique ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":141,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"teamsUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Update a team by its unique ID. Only team owners have write access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":142,"cookies":false,"type":"","demo":"teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"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 by its unique ID. Only team owners have write access for this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":143,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team members by the team unique ID. All team members have read access for this list of resources.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":146,"cookies":false,"type":"","demo":"teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"teamsCreateMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":144,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"New team member email.","default":null,"x-example":"email@example.com"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"},"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](\/docs\/permissions). Max length for each role is 32 chars.","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. 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","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":145,"cookies":false,"type":"","demo":"teams\/update-membership-roles.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-roles.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 unique 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":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Max length for each role is 32 chars.","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","weight":148,"cookies":false,"type":"","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 unique 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 recieved by the user.","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":147,"cookies":false,"type":"","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 unique 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 unique ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/users":{"get":{"summary":"List Users","operationId":"usersList","consumes":["application\/json"],"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","weight":150,"cookies":false,"type":"","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":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create User","operationId":"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","weight":149,"cookies":false,"type":"","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":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"usersGet","consumes":["application\/json"],"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","weight":151,"cookies":false,"type":"","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 unique 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.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":159,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get a user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":154,"cookies":false,"type":"","demo":"users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"usersGetPrefs","consumes":["application\/json"],"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","weight":152,"cookies":false,"type":"","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 unique 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. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":156,"cookies":false,"type":"","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 unique 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":null,"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"usersGetSessions","consumes":["application\/json"],"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":"getSessions","weight":153,"cookies":false,"type":"","demo":"users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"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","weight":158,"cookies":false,"type":"","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 unique 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","weight":157,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":155,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"integer","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","default":null,"x-example":1}},"required":["status"]}}]}}},"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":"database","description":"The Database 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":"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":"functions","description":"The Functions Service allows you view, create and manage your Cloud Functions."}],"definitions":{"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"},"version":{"type":"string","description":"Server version number.","x-example":"1.0"}},"required":["message","code","version"]},"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["sum","collections"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["sum","documents"]},"userList":{"description":"Users List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"},"x-example":""}},"required":["sum","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["sum","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["sum","files"]},"teamList":{"description":"Teams List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["sum","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["sum","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["sum","functions"]},"tagList":{"description":"Tags List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"tags":{"type":"array","description":"List of tags.","items":{"type":"object","$ref":"#\/definitions\/tag"},"x-example":""}},"required":["sum","tags"]},"executionList":{"description":"Executions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["sum","executions"]},"projectList":{"description":"Projects List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"projects":{"type":"array","description":"List of projects.","items":{"type":"object","$ref":"#\/definitions\/project"},"x-example":""}},"required":["sum","projects"]},"webhookList":{"description":"Webhooks List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"webhooks":{"type":"array","description":"List of webhooks.","items":{"type":"object","$ref":"#\/definitions\/webhook"},"x-example":""}},"required":["sum","webhooks"]},"keyList":{"description":"API Keys List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"keys":{"type":"array","description":"List of keys.","items":{"type":"object","$ref":"#\/definitions\/key"},"x-example":""}},"required":["sum","keys"]},"taskList":{"description":"Tasks List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"tasks":{"type":"array","description":"List of tasks.","items":{"type":"object","$ref":"#\/definitions\/task"},"x-example":""}},"required":["sum","tasks"]},"platformList":{"description":"Platforms List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"platforms":{"type":"array","description":"List of platforms.","items":{"type":"object","$ref":"#\/definitions\/platform"},"x-example":""}},"required":["sum","platforms"]},"domainList":{"description":"Domains List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"domains":{"type":"array","description":"List of domains.","items":{"type":"object","$ref":"#\/definitions\/domain"},"x-example":""}},"required":["sum","domains"]},"countryList":{"description":"Countries List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["sum","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["sum","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["sum","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["sum","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["sum","phones"]},"permissions":{"description":"Permissions","type":"object","properties":{"read":{"type":"array","description":"Read permissions.","items":{"type":"string"},"x-example":"user:5e5ea5c16897e"},"write":{"type":"array","description":"Write permissions.","items":{"type":"string"},"x-example":"user:5e5ea5c16897e"}},"required":["read","write"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Collection permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Collection name.","x-example":"Movies"},"dateCreated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981550,"format":"int32"},"rules":{"type":"array","description":"Collection rules.","items":{"type":"object","$ref":"#\/definitions\/rule"},"x-example":""}},"required":["$id","$permissions","name","dateCreated","dateUpdated","rules"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$permissions":{"type":"object","description":"Document permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}}},"additionalProperties":true,"required":["$id","$collection","$permissions"]},"rule":{"description":"Rule","type":"object","properties":{"$id":{"type":"string","description":"Rule ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Rule Collection.","x-example":"5e5e66c16897e"},"type":{"type":"string","description":"Rule type. Possible values: ","x-example":"title"},"key":{"type":"string","description":"Rule key.","x-example":"title"},"label":{"type":"string","description":"Rule label.","x-example":"Title"},"default":{"type":"string","description":"Rule default value.","x-example":"Movie Name"},"array":{"type":"boolean","description":"Is array?","x-example":false},"required":{"type":"boolean","description":"Is required?","x-example":true},"list":{"type":"array","description":"List of allowed values","items":{"type":"string"},"x-example":"5e5ea5c168099"}},"required":["$id","$collection","type","key","label","default","array","required","list"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"integer","description":"Log creation time in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","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"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"registration":{"type":"integer","description":"User registration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"status":{"type":"integer","description":"User status. 0 for Unactivated, 1 for active and 2 is blocked.","x-example":0,"format":"int32"},"passwordUpdate":{"type":"integer","description":"Unix timestamp of the most recent password update","x-example":1592981250,"format":"int32"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"emailVerification":{"type":"boolean","description":"Email verification 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"}}},"required":["$id","name","registration","status","passwordUpdate","email","emailVerification","prefs"]},"preferences":{"description":"Preferences","type":"object","additionalProperties":true},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5bb8c16897e"},"expire":{"type":"integer","description":"Session expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"provider":{"type":"string","description":"Session Provider.","x-example":"email"},"providerUid":{"type":"string","description":"Session Provider User ID.","x-example":"user@example.com"},"providerToken":{"type":"string","description":"Session Provider 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}},"required":["$id","userId","expire","provider","providerUid","providerToken","ip","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName","current"]},"token":{"description":"Token","type":"object","properties":{"$id":{"type":"string","description":"Token ID.","x-example":"bb8ea5c16897e"},"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":"integer","description":"Token expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"}},"required":["$id","userId","secret","expire"]},"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 Europian 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"]},"file":{"description":"File","type":"object","properties":{"$id":{"type":"string","description":"File ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"File permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"dateCreated":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"}},"required":["$id","$permissions","name","dateCreated","signature","mimeType","sizeOriginal"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"dateCreated":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"sum":{"type":"integer","description":"Total sum of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","sum"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"VIP"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"invited":{"type":"integer","description":"Date, the user has been invited to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"joined":{"type":"integer","description":"Date, the user has accepted the invitation to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"confirm":{"type":"boolean","description":"User confirmation status, true if the user has joined the team or false otherwise.","x-example":false},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"},"x-example":"admin"}},"required":["$id","userId","teamId","name","email","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Function permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"dateCreated":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981257,"format":"int32"},"status":{"type":"string","description":"Function status. Possible values: disabled, enabled","x-example":"enabled"},"env":{"type":"string","description":"Function execution environment.","x-example":"python-3.8"},"tag":{"type":"string","description":"Function active tag ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"string","description":"Function environment variables.","x-example":{"key":"value"}},"events":{"type":"array","description":"Function trigger events.","items":{"type":"string"},"x-example":"account.create"},"schedule":{"type":"string","description":"Function execution schedult in CRON format.","x-example":"5 4 * * *"},"scheduleNext":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981292,"format":"int32"},"schedulePrevious":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981237,"format":"int32"},"timeout":{"type":"integer","description":"Function execution timeout in seconds.","x-example":1592981237,"format":"int32"}},"required":["$id","$permissions","name","dateCreated","dateUpdated","status","env","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"tag":{"description":"Tag","type":"object","properties":{"$id":{"type":"string","description":"Tag ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The tag creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"command":{"type":"string","description":"The entrypoint command in use to execute the tag code.","x-example":"enabled"},"size":{"type":"string","description":"The code size in bytes.","x-example":"python-3.8"}},"required":["$id","functionId","dateCreated","command","size"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"exitCode":{"type":"integer","description":"The script exit code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string.","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"float"}},"required":["$id","functionId","dateCreated","trigger","status","exitCode","stdout","stderr","time"]},"project":{"description":"Project","type":"object","properties":{"$id":{"type":"string","description":"Project ID.","x-example":"5e5ea5c16897e"},"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"},"usersAuthLimit":{"type":"boolean","description":"Max users allowed. 0 is unlimited.","x-example":100},"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":{}},"domains":{"type":"array","description":"List of Domains.","items":{"type":"object","$ref":"#\/definitions\/domain"},"x-example":{}},"tasks":{"type":"array","description":"List of Tasks.","items":{"type":"object","$ref":"#\/definitions\/task"},"x-example":{}},"usersOauth2AmazonAppid":{"type":"string","description":"Amazon OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2AmazonSecret":{"type":"string","description":"Amazon OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2AppleAppid":{"type":"string","description":"Apple OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2AppleSecret":{"type":"string","description":"Apple OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2BitbucketAppid":{"type":"string","description":"BitBucket OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2BitbucketSecret":{"type":"string","description":"BitBucket OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2BitlyAppid":{"type":"string","description":"Bitly OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2BitlySecret":{"type":"string","description":"Bitly OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2BoxAppid":{"type":"string","description":"Box OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2BoxSecret":{"type":"string","description":"Box OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2DiscordAppid":{"type":"string","description":"Discord OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2DiscordSecret":{"type":"string","description":"Discord OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2DropboxAppid":{"type":"string","description":"Dropbox OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2DropboxSecret":{"type":"string","description":"Dropbox OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2FacebookAppid":{"type":"string","description":"Facebook OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2FacebookSecret":{"type":"string","description":"Facebook OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2GithubAppid":{"type":"string","description":"GitHub OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2GithubSecret":{"type":"string","description":"GitHub OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2GitlabAppid":{"type":"string","description":"GitLab OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2GitlabSecret":{"type":"string","description":"GitLab OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2GoogleAppid":{"type":"string","description":"Google OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2GoogleSecret":{"type":"string","description":"Google OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2LinkedinAppid":{"type":"string","description":"LinkedIn OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2LinkedinSecret":{"type":"string","description":"LinkedIn OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2MicrosoftAppid":{"type":"string","description":"Microsoft OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2MicrosoftSecret":{"type":"string","description":"Microsoft OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2PaypalAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2PaypalSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2PaypalSandboxAppid":{"type":"string","description":"PayPal OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2PaypalSandboxSecret":{"type":"string","description":"PayPal OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2SalesforceAppid":{"type":"string","description":"Salesforce OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2SalesforceSecret":{"type":"string","description":"Salesforce OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2SlackAppid":{"type":"string","description":"Slack OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2SlackSecret":{"type":"string","description":"Slack OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2SpotifyAppid":{"type":"string","description":"Spotify OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2SpotifySecret":{"type":"string","description":"Spotify OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2TradeshiftAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2TradeshiftSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2TradeshiftBoxAppid":{"type":"string","description":"Tradeshift OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2TradeshiftBoxSecret":{"type":"string","description":"Tradeshift OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2TwitchAppid":{"type":"string","description":"Twitch OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2TwitchSecret":{"type":"string","description":"Twitch OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2VkAppid":{"type":"string","description":"VK OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2VkSecret":{"type":"string","description":"VK OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2YahooAppid":{"type":"string","description":"Yahoo OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2YahooSecret":{"type":"string","description":"Yahoo OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2YandexAppid":{"type":"string","description":"Yandex OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2YandexSecret":{"type":"string","description":"Yandex OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2WordpressAppid":{"type":"string","description":"WordPress OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2WordpressSecret":{"type":"string","description":"WordPress OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersOauth2MockAppid":{"type":"string","description":"Mock OAuth app ID.","x-example":"123247283472834787438"},"usersOauth2MockSecret":{"type":"string","description":"Mock OAuth secret ID.","x-example":"djsgudsdsewe43434343dd34..."},"usersAuthEmailPassword":{"type":"boolean","description":"Email\/Password auth method status","x-example":true},"usersAuthAnonymous":{"type":"boolean","description":"Anonymous auth method status","x-example":true},"usersAuthInvites":{"type":"boolean","description":"Invites auth method status","x-example":true},"usersAuthJWT":{"type":"boolean","description":"JWT auth method status","x-example":true},"usersAuthPhone":{"type":"boolean","description":"Phone auth method status","x-example":true}},"required":["$id","name","description","teamId","logo","url","legalName","legalCountry","legalState","legalCity","legalAddress","legalTaxId","usersAuthLimit","platforms","webhooks","keys","domains","tasks","usersOauth2AmazonAppid","usersOauth2AmazonSecret","usersOauth2AppleAppid","usersOauth2AppleSecret","usersOauth2BitbucketAppid","usersOauth2BitbucketSecret","usersOauth2BitlyAppid","usersOauth2BitlySecret","usersOauth2BoxAppid","usersOauth2BoxSecret","usersOauth2DiscordAppid","usersOauth2DiscordSecret","usersOauth2DropboxAppid","usersOauth2DropboxSecret","usersOauth2FacebookAppid","usersOauth2FacebookSecret","usersOauth2GithubAppid","usersOauth2GithubSecret","usersOauth2GitlabAppid","usersOauth2GitlabSecret","usersOauth2GoogleAppid","usersOauth2GoogleSecret","usersOauth2LinkedinAppid","usersOauth2LinkedinSecret","usersOauth2MicrosoftAppid","usersOauth2MicrosoftSecret","usersOauth2PaypalAppid","usersOauth2PaypalSecret","usersOauth2PaypalSandboxAppid","usersOauth2PaypalSandboxSecret","usersOauth2SalesforceAppid","usersOauth2SalesforceSecret","usersOauth2SlackAppid","usersOauth2SlackSecret","usersOauth2SpotifyAppid","usersOauth2SpotifySecret","usersOauth2TradeshiftAppid","usersOauth2TradeshiftSecret","usersOauth2TradeshiftBoxAppid","usersOauth2TradeshiftBoxSecret","usersOauth2TwitchAppid","usersOauth2TwitchSecret","usersOauth2VkAppid","usersOauth2VkSecret","usersOauth2YahooAppid","usersOauth2YahooSecret","usersOauth2YandexAppid","usersOauth2YandexSecret","usersOauth2WordpressAppid","usersOauth2WordpressSecret","usersOauth2MockAppid","usersOauth2MockSecret","usersAuthEmailPassword","usersAuthAnonymous","usersAuthInvites","usersAuthJWT","usersAuthPhone"]},"webhook":{"description":"Webhook","type":"object","properties":{"$id":{"type":"string","description":"Webhook ID.","x-example":"5e5ea5c16897e"},"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"}},"required":["$id","name","url","events","security","httpUser","httpPass"]},"key":{"description":"Key","type":"object","properties":{"$id":{"type":"string","description":"Key ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Key name.","x-example":"My API Key"},"scopes":{"type":"array","description":"Allowed permission scopes.","items":{"type":"string"},"x-example":"users.read"},"secret":{"type":"string","description":"Secret key.","x-example":"919c2d18fb5d4...a2ae413da83346ad2"}},"required":["$id","name","scopes","secret"]},"task":{"description":"Task","type":"object","properties":{"$id":{"type":"string","description":"Task ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Task name.","x-example":"My Task"},"security":{"type":"boolean","description":"Indicated if SSL \/ TLS Certificate verification is enabled.","x-example":true},"httpMethod":{"type":"string","description":"Task HTTP Method.","x-example":"POST"},"httpUrl":{"type":"string","description":"Task HTTP URL.","x-example":"https:\/\/example.com\/task"},"httpHeaders":{"type":"array","description":"Task HTTP headers.","items":{"type":"string"},"x-example":"key:value"},"httpUser":{"type":"string","description":"HTTP basic authentication username.","x-example":"username"},"httpPass":{"type":"string","description":"HTTP basic authentication password.","x-example":"password"},"duration":{"type":"number","description":"Task duration in seconds.","x-example":1.2,"format":"float"},"delay":{"type":"number","description":"Task delay time in seconds.","x-example":1.2,"format":"float"},"failures":{"type":"integer","description":"Number of recurring task failures.","x-example":0,"format":"int32"},"schedule":{"type":"string","description":"Task schedule in CRON syntax.","x-example":"* * * * *"},"status":{"type":"string","description":"Task status. Possible values: play, pause","x-example":"enabled"},"updated":{"type":"integer","description":"Task last updated time in Unix timestamp.","x-example":1592981250,"format":"int32"},"previous":{"type":"integer","description":"Task previous run time in Unix timestamp.","x-example":1592981250,"format":"int32"},"next":{"type":"integer","description":"Task next run time in Unix timestamp.","x-example":1592981650,"format":"int32"}},"required":["$id","name","security","httpMethod","httpUrl","httpHeaders","httpUser","httpPass","duration","delay","failures","schedule","status","updated","previous","next"]},"domain":{"description":"Domain","type":"object","properties":{"$id":{"type":"string","description":"Domain ID.","x-example":"5e5ea5c16897e"},"domain":{"type":"string","description":"Domain name.","x-example":"appwrite.company.com"},"registerable":{"type":"string","description":"Registerable domain name.","x-example":"company.com"},"tld":{"type":"string","description":"TLD name.","x-example":"com"},"verification":{"type":"boolean","description":"Verification process status.","x-example":true},"certificateId":{"type":"string","description":"Certificate ID.","x-example":"6ejea5c13377e"}},"required":["$id","domain","registerable","tld","verification","certificateId"]},"platform":{"description":"Platform","type":"object","properties":{"$id":{"type":"string","description":"Platform ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Platform name.","x-example":"My Web App"},"type":{"type":"string","description":"Platform type. Possible values are: web, flutter-ios, flutter-android, ios, android, and unity.","x-example":"My Web App"},"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","name","type","key","store","hostname","httpUser","httpPass"]},"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":"float"},"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"]}},"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/0.8.x.server.json b/app/config/specs/0.8.x.server.json index 8e760ac97..8fd930baf 100644 --- a/app/config/specs/0.8.x.server.json +++ b/app/config/specs/0.8.x.server.json @@ -1 +1,2 @@ -{"swagger":"2.0","info":{"version":"0.8.0","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@appwrite.io"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","x-appwrite":{"demo":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","x-appwrite":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"JWT":{"type":"apiKey","name":"X-Appwrite-JWT","description":"Your secret JSON Web Token","in":"header","x-appwrite":{"demo":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","x-appwrite":{"demo":"en"}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"accountGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"get","weight":44,"cookies":false,"type":"","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":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":52,"cookies":false,"type":"","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":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"accountUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":50,"cookies":false,"type":"","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":[],"JWT":[]}},"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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"accountGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":47,"cookies":false,"type":"","demo":"account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account 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","weight":48,"cookies":false,"type":"","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":[],"JWT":[]}},"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 Account 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 and Team Invites, oldPassword is optional.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":49,"cookies":false,"type":"","demo":"account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Old user password. Must be between 6 to 32 chars.","default":"","x-example":"password"}},"required":["password"]}}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"accountGetPrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"getPrefs","weight":45,"cookies":false,"type":"","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":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"accountUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":51,"cookies":false,"type":"","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":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":null,"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](\/docs\/client\/account#accountUpdateRecovery) 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","weight":55,"cookies":false,"type":"","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}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"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":"Complete Password Recovery","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](\/docs\/client\/account#accountCreateRecovery) 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","weight":56,"cookies":false,"type":"","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":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User account UID address.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"New password again. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["userId","secret","password","passwordAgain"]}}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"accountGetSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","responses":{"200":{"description":"Sessions List","schema":{"$ref":"#\/definitions\/sessionList"}}},"x-appwrite":{"method":"getSessions","weight":46,"cookies":false,"type":"","demo":"account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]},"delete":{"summary":"Delete All Account 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","weight":54,"cookies":false,"type":"","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":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"accountDeleteSession","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all their account sessions across all of their different devices. When using the option id argument, only the session unique ID provider will be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":53,"cookies":false,"type":"","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":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"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](\/docs\/client\/account#accountUpdateVerification). 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","weight":57,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"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":"Complete Email Verification","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","weight":58,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique 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":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":60,"cookies":false,"type":"location","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"avatarsGetCreditCard","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":59,"cookies":false,"type":"location","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"avatarsGetFavicon","consumes":["application\/json"],"produces":["image\/*"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFavicon","weight":63,"cookies":false,"type":"location","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":[],"Key":[]}},"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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":61,"cookies":false,"type":"location","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"avatarsGetImage","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":62,"cookies":false,"type":"location","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":[],"Key":[]}},"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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":65,"cookies":false,"type":"location","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":[],"Key":[]}},"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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"avatarsGetQR","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":64,"cookies":false,"type":"location","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":[],"Key":[]}},"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"databaseListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's collections. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":67,"cookies":false,"type":"","demo":"database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"databaseCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Collection.","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":66,"cookies":false,"type":"","demo":"database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","read","write","rules"]}}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databaseGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":68,"cookies":false,"type":"","demo":"database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databaseUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Update a collection by its unique ID.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":69,"cookies":false,"type":"","demo":"database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique 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]"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]},"delete":{"summary":"Delete Collection","operationId":"databaseDeleteCollection","consumes":["application\/json"],"produces":[],"tags":["database"],"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","weight":70,"cookies":false,"type":"","demo":"database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databaseListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's documents. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":72,"cookies":false,"type":"","demo":"database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"databaseCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database#databaseCreateCollection) API or directly from your database console.","responses":{"201":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"createDocument","weight":71,"cookies":false,"type":"","demo":"database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"parentDocument":{"type":"string","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","default":"","x-example":"[PARENT_DOCUMENT]"},"parentProperty":{"type":"string","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","default":"","x-example":null},"parentPropertyType":{"type":"string","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","default":"assign","x-example":"assign"}},"required":["data"]}}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databaseGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":73,"cookies":false,"type":"","demo":"database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databaseUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":74,"cookies":false,"type":"","demo":"database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["data"]}}]},"delete":{"summary":"Delete Document","operationId":"databaseDeleteDocument","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"Delete a document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":75,"cookies":false,"type":"","demo":"database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions":{"get":{"summary":"List Functions","operationId":"functionsList","consumes":["application\/json"],"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","weight":161,"cookies":false,"type":"","demo":"functions\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Function","operationId":"functionsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function. You can pass a list of [permissions](\/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","weight":160,"cookies":false,"type":"","demo":"functions\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"execute":{"type":"array","description":"An array of strings with execution permissions. By default no user is granted with any execute permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"env":{"type":"string","description":"Execution enviornment.","default":null,"x-example":"dotnet-3.1"},"vars":{"type":"object","description":"Key-value JSON object.","default":{},"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name","execute","env"]}}]}},"\/functions\/{functionId}":{"get":{"summary":"Get Function","operationId":"functionsGet","consumes":["application\/json"],"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","weight":162,"cookies":false,"type":"","demo":"functions\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"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"}]},"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","weight":164,"cookies":false,"type":"","demo":"functions\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"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":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"execute":{"type":"array","description":"An array of strings with execution permissions. By default no user is granted with any execute permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"vars":{"type":"object","description":"Key-value JSON object.","default":{},"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name","execute"]}}]},"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","weight":166,"cookies":false,"type":"","demo":"functions\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"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"}]}},"\/functions\/{functionId}\/executions":{"get":{"summary":"List Executions","operationId":"functionsListExecutions","consumes":["application\/json"],"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. On admin mode, this endpoint will return a list of all of the project's executions. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Executions List","schema":{"$ref":"#\/definitions\/executionList"}}},"x-appwrite":{"method":"listExecutions","weight":172,"cookies":false,"type":"","demo":"functions\/list-executions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-executions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"execution.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Execution","operationId":"functionsCreateExecution","consumes":["application\/json"],"produces":["application\/json"],"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","weight":171,"cookies":false,"type":"","demo":"functions\/create-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-execution.md","rate-limit":60,"rate-time":60,"rate-key":"url:{url},ip:{ip}","scope":"execution.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"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":{"data":{"type":"string","description":"String of custom data to send to function.","default":"","x-example":"[DATA]"}}}}]}},"\/functions\/{functionId}\/executions\/{executionId}":{"get":{"summary":"Get Execution","operationId":"functionsGetExecution","consumes":["application\/json"],"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","weight":173,"cookies":false,"type":"","demo":"functions\/get-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"execution.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution unique ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/tag":{"patch":{"summary":"Update Function Tag","operationId":"functionsUpdateTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code tag ID using the unique function ID. Use this endpoint to switch the code tag that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateTag","weight":165,"cookies":false,"type":"","demo":"functions\/update-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-tag.md","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":{"tag":{"type":"string","description":"Tag unique ID.","default":null,"x-example":"[TAG]"}},"required":["tag"]}}]}},"\/functions\/{functionId}\/tags":{"get":{"summary":"List Tags","operationId":"functionsListTags","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code tags. You can use the query params to filter your results.","responses":{"200":{"description":"Tags List","schema":{"$ref":"#\/definitions\/tagList"}}},"x-appwrite":{"method":"listTags","weight":168,"cookies":false,"type":"","demo":"functions\/list-tags.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-tags.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"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":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Tag","operationId":"functionsCreateTag","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code tag. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's tag to use your new tag UID.\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](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"201":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"createTag","weight":167,"cookies":false,"type":"","demo":"functions\/create-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"packaging":true,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"command","description":"Code execution command.","required":true,"type":"string","x-example":"[COMMAND]","in":"formData"},{"name":"code","description":"Gzip file 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"}]}},"\/functions\/{functionId}\/tags\/{tagId}":{"get":{"summary":"Get Tag","operationId":"functionsGetTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code tag by its unique ID.","responses":{"200":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"getTag","weight":169,"cookies":false,"type":"","demo":"functions\/get-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"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":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]},"delete":{"summary":"Delete Tag","operationId":"functionsDeleteTag","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code tag by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteTag","weight":170,"cookies":false,"type":"","demo":"functions\/delete-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"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":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"healthGet","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"get","weight":83,"cookies":false,"type":"","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 Anti virus","operationId":"healthGetAntiVirus","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getAntiVirus","weight":95,"cookies":false,"type":"","demo":"health\/get-anti-virus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getCache","weight":86,"cookies":false,"type":"","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\/db":{"get":{"summary":"Get DB","operationId":"healthGetDB","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getDB","weight":85,"cookies":false,"type":"","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\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":[],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueCertificates","weight":92,"cookies":false,"type":"","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":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"healthGetQueueFunctions","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueFunctions","weight":93,"cookies":false,"type":"","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":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"healthGetQueueLogs","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueLogs","weight":90,"cookies":false,"type":"","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":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"healthGetQueueTasks","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueTasks","weight":89,"cookies":false,"type":"","demo":"health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"healthGetQueueUsage","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueUsage","weight":91,"cookies":false,"type":"","demo":"health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":88,"cookies":false,"type":"","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":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"healthGetStorageLocal","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getStorageLocal","weight":94,"cookies":false,"type":"","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":["application\/json"],"produces":[],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getTime","weight":87,"cookies":false,"type":"","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":["application\/json"],"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","weight":76,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"localeGetContinents","consumes":["application\/json"],"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":"getContinents","weight":80,"cookies":false,"type":"","demo":"locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"localeGetCountries","consumes":["application\/json"],"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":"getCountries","weight":77,"cookies":false,"type":"","demo":"locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"localeGetCountriesEU","consumes":["application\/json"],"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":"getCountriesEU","weight":78,"cookies":false,"type":"","demo":"locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"localeGetCountriesPhones","consumes":["application\/json"],"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":"getCountriesPhones","weight":79,"cookies":false,"type":"","demo":"locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"localeGetCurrencies","consumes":["application\/json"],"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":"getCurrencies","weight":81,"cookies":false,"type":"","demo":"locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"localeGetLanguages","consumes":["application\/json"],"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":"getLanguages","weight":82,"cookies":false,"type":"","demo":"locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's files. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Files List","schema":{"$ref":"#\/definitions\/fileList"}}},"x-appwrite":{"method":"listFiles","weight":132,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"storageCreateFile","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":131,"cookies":false,"type":"upload","demo":"storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"storageGetFile","consumes":["application\/json"],"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","weight":133,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique 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","weight":137,"cookies":false,"type":"","demo":"storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["read","write"]}}]},"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","weight":138,"cookies":false,"type":"","demo":"storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["application\/json"],"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","weight":135,"cookies":false,"type":"location","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"storageGetFilePreview","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":134,"cookies":false,"type":"location","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"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":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"rotation","description":"Preview image rotation in degrees. Pass an integer between 0 and 360.","required":false,"type":"integer","format":"int32","x-example":0,"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","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"storageGetFileView","consumes":["application\/json"],"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","weight":136,"cookies":false,"type":"location","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's teams. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":140,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":139,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its unique ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":141,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"teamsUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Update a team by its unique ID. Only team owners have write access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":142,"cookies":false,"type":"","demo":"teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"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 by its unique ID. Only team owners have write access for this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":143,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team members by the team unique ID. All team members have read access for this list of resources.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":146,"cookies":false,"type":"","demo":"teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"teamsCreateMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":144,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"New team member email.","default":null,"x-example":"email@example.com"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"},"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](\/docs\/permissions). Max length for each role is 32 chars.","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. 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","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":145,"cookies":false,"type":"","demo":"teams\/update-membership-roles.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-roles.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique 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":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Max length for each role is 32 chars.","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","weight":148,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique 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 recieved by the user.","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":147,"cookies":false,"type":"","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":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique 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 unique ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/users":{"get":{"summary":"List Users","operationId":"usersList","consumes":["application\/json"],"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","weight":150,"cookies":false,"type":"","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":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create User","operationId":"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","weight":149,"cookies":false,"type":"","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":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"usersGet","consumes":["application\/json"],"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","weight":151,"cookies":false,"type":"","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 unique 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.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":159,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get a user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":154,"cookies":false,"type":"","demo":"users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"usersGetPrefs","consumes":["application\/json"],"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","weight":152,"cookies":false,"type":"","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 unique 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. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":156,"cookies":false,"type":"","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 unique 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":null,"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"usersGetSessions","consumes":["application\/json"],"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":"getSessions","weight":153,"cookies":false,"type":"","demo":"users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"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","weight":158,"cookies":false,"type":"","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 unique 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","weight":157,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":155,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"integer","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","default":null,"x-example":1}},"required":["status"]}}]}}},"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":"database","description":"The Database 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":"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":"functions","description":"The Functions Service allows you view, create and manage your Cloud Functions."}],"definitions":{"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"},"version":{"type":"string","description":"Server version number.","x-example":"1.0"}},"required":["message","code","version"]},"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["sum","collections"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["sum","documents"]},"userList":{"description":"Users List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"},"x-example":""}},"required":["sum","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["sum","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["sum","files"]},"teamList":{"description":"Teams List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["sum","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["sum","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["sum","functions"]},"tagList":{"description":"Tags List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"tags":{"type":"array","description":"List of tags.","items":{"type":"object","$ref":"#\/definitions\/tag"},"x-example":""}},"required":["sum","tags"]},"executionList":{"description":"Executions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["sum","executions"]},"countryList":{"description":"Countries List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["sum","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["sum","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["sum","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["sum","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["sum","phones"]},"permissions":{"description":"Permissions","type":"object","properties":{"read":{"type":"array","description":"Read permissions.","items":{"type":"string"},"x-example":"user:5e5ea5c16897e"},"write":{"type":"array","description":"Write permissions.","items":{"type":"string"},"x-example":"user:5e5ea5c16897e"}},"required":["read","write"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Collection permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Collection name.","x-example":"Movies"},"dateCreated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981550,"format":"int32"},"rules":{"type":"array","description":"Collection rules.","items":{"type":"object","$ref":"#\/definitions\/rule"},"x-example":""}},"required":["$id","$permissions","name","dateCreated","dateUpdated","rules"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$permissions":{"type":"object","description":"Document permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}}},"additionalProperties":true,"required":["$id","$collection","$permissions"]},"rule":{"description":"Rule","type":"object","properties":{"$id":{"type":"string","description":"Rule ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Rule Collection.","x-example":"5e5e66c16897e"},"type":{"type":"string","description":"Rule type. Possible values: ","x-example":"title"},"key":{"type":"string","description":"Rule key.","x-example":"title"},"label":{"type":"string","description":"Rule label.","x-example":"Title"},"default":{"type":"string","description":"Rule default value.","x-example":"Movie Name"},"array":{"type":"boolean","description":"Is array?","x-example":false},"required":{"type":"boolean","description":"Is required?","x-example":true},"list":{"type":"array","description":"List of allowed values","items":{"type":"string"},"x-example":"5e5ea5c168099"}},"required":["$id","$collection","type","key","label","default","array","required","list"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"integer","description":"Log creation time in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","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"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"registration":{"type":"integer","description":"User registration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"status":{"type":"integer","description":"User status. 0 for Unactivated, 1 for active and 2 is blocked.","x-example":0,"format":"int32"},"passwordUpdate":{"type":"integer","description":"Unix timestamp of the most recent password update","x-example":1592981250,"format":"int32"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"emailVerification":{"type":"boolean","description":"Email verification 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"}}},"required":["$id","name","registration","status","passwordUpdate","email","emailVerification","prefs"]},"preferences":{"description":"Preferences","type":"object","additionalProperties":true},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5bb8c16897e"},"expire":{"type":"integer","description":"Session expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"provider":{"type":"string","description":"Session Provider.","x-example":"email"},"providerUid":{"type":"string","description":"Session Provider User ID.","x-example":"user@example.com"},"providerToken":{"type":"string","description":"Session Provider 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}},"required":["$id","userId","expire","provider","providerUid","providerToken","ip","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName","current"]},"token":{"description":"Token","type":"object","properties":{"$id":{"type":"string","description":"Token ID.","x-example":"bb8ea5c16897e"},"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":"integer","description":"Token expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"}},"required":["$id","userId","secret","expire"]},"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 Europian 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"]},"file":{"description":"File","type":"object","properties":{"$id":{"type":"string","description":"File ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"File permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"dateCreated":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"}},"required":["$id","$permissions","name","dateCreated","signature","mimeType","sizeOriginal"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"dateCreated":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"sum":{"type":"integer","description":"Total sum of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","sum"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"VIP"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"invited":{"type":"integer","description":"Date, the user has been invited to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"joined":{"type":"integer","description":"Date, the user has accepted the invitation to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"confirm":{"type":"boolean","description":"User confirmation status, true if the user has joined the team or false otherwise.","x-example":false},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"},"x-example":"admin"}},"required":["$id","userId","teamId","name","email","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Function permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"dateCreated":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981257,"format":"int32"},"status":{"type":"string","description":"Function status. Possible values: disabled, enabled","x-example":"enabled"},"env":{"type":"string","description":"Function execution environment.","x-example":"python-3.8"},"tag":{"type":"string","description":"Function active tag ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"string","description":"Function environment variables.","x-example":{"key":"value"}},"events":{"type":"array","description":"Function trigger events.","items":{"type":"string"},"x-example":"account.create"},"schedule":{"type":"string","description":"Function execution schedult in CRON format.","x-example":"5 4 * * *"},"scheduleNext":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981292,"format":"int32"},"schedulePrevious":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981237,"format":"int32"},"timeout":{"type":"integer","description":"Function execution timeout in seconds.","x-example":1592981237,"format":"int32"}},"required":["$id","$permissions","name","dateCreated","dateUpdated","status","env","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"tag":{"description":"Tag","type":"object","properties":{"$id":{"type":"string","description":"Tag ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The tag creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"command":{"type":"string","description":"The entrypoint command in use to execute the tag code.","x-example":"enabled"},"size":{"type":"string","description":"The code size in bytes.","x-example":"python-3.8"}},"required":["$id","functionId","dateCreated","command","size"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"exitCode":{"type":"integer","description":"The script exit code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string.","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"float"}},"required":["$id","functionId","dateCreated","trigger","status","exitCode","stdout","stderr","time"]},"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":"float"},"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"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file + +{"swagger":"2.0","info":{"version":"0.8.0","title":"Appwrite","description":"Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https:\/\/appwrite.io\/docs](https:\/\/appwrite.io\/docs)","termsOfService":"https:\/\/appwrite.io\/policy\/terms","contact":{"name":"Appwrite Team","url":"https:\/\/appwrite.io\/support","email":"team@appwrite.io"},"license":{"name":"BSD-3-Clause","url":"https:\/\/raw.githubusercontent.com\/appwrite\/appwrite\/master\/LICENSE"}},"host":"appwrite.io","basePath":"\/v1","schemes":["https"],"consumes":["application\/json","multipart\/form-data"],"produces":["application\/json"],"securityDefinitions":{"Project":{"type":"apiKey","name":"X-Appwrite-Project","description":"Your project ID","in":"header","x-appwrite":{"demo":"5df5acd0d48c2"}},"Key":{"type":"apiKey","name":"X-Appwrite-Key","description":"Your secret API key","in":"header","x-appwrite":{"demo":"919c2d18fb5d4...a2ae413da83346ad2"}},"JWT":{"type":"apiKey","name":"X-Appwrite-JWT","description":"Your secret JSON Web Token","in":"header","x-appwrite":{"demo":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."}},"Locale":{"type":"apiKey","name":"X-Appwrite-Locale","description":"","in":"header","x-appwrite":{"demo":"en"}}},"paths":{"\/account":{"get":{"summary":"Get Account","operationId":"accountGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user data as JSON object.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"get","weight":44,"cookies":false,"type":"","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":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]},"delete":{"summary":"Delete Account","operationId":"accountDelete","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":52,"cookies":false,"type":"","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":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/email":{"patch":{"summary":"Update Account Email","operationId":"accountUpdateEmail","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateEmail","weight":50,"cookies":false,"type":"","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":[],"JWT":[]}},"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 between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["email","password"]}}]}},"\/account\/logs":{"get":{"summary":"Get Account Logs","operationId":"accountGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":47,"cookies":false,"type":"","demo":"account\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/name":{"patch":{"summary":"Update Account 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","weight":48,"cookies":false,"type":"","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":[],"JWT":[]}},"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 Account 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 and Team Invites, oldPassword is optional.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePassword","weight":49,"cookies":false,"type":"","demo":"account\/update-password.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-password.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"password":{"type":"string","description":"New user password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"oldPassword":{"type":"string","description":"Old user password. Must be between 6 to 32 chars.","default":"","x-example":"password"}},"required":["password"]}}]}},"\/account\/prefs":{"get":{"summary":"Get Account Preferences","operationId":"accountGetPrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user preferences as a key-value object.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"getPrefs","weight":45,"cookies":false,"type":"","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":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]},"patch":{"summary":"Update Account Preferences","operationId":"accountUpdatePrefs","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Update currently logged in user account preferences. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updatePrefs","weight":51,"cookies":false,"type":"","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":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"prefs":{"type":"object","description":"Prefs key-value JSON object.","default":null,"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](\/docs\/client\/account#accountUpdateRecovery) 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","weight":55,"cookies":false,"type":"","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}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"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":"Complete Password Recovery","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](\/docs\/client\/account#accountCreateRecovery) 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","weight":56,"cookies":false,"type":"","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":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User account UID address.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Valid reset token.","default":null,"x-example":"[SECRET]"},"password":{"type":"string","description":"New password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"passwordAgain":{"type":"string","description":"New password again. Must be between 6 to 32 chars.","default":null,"x-example":"password"}},"required":["userId","secret","password","passwordAgain"]}}]}},"\/account\/sessions":{"get":{"summary":"Get Account Sessions","operationId":"accountGetSessions","consumes":["application\/json"],"produces":["application\/json"],"tags":["account"],"description":"Get currently logged in user list of active sessions across different devices.","responses":{"200":{"description":"Sessions List","schema":{"$ref":"#\/definitions\/sessionList"}}},"x-appwrite":{"method":"getSessions","weight":46,"cookies":false,"type":"","demo":"account\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/get-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]},"delete":{"summary":"Delete All Account 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","weight":54,"cookies":false,"type":"","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":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}]}},"\/account\/sessions\/{sessionId}":{"delete":{"summary":"Delete Account Session","operationId":"accountDeleteSession","consumes":["application\/json"],"produces":[],"tags":["account"],"description":"Use this endpoint to log out the currently logged in user from all their account sessions across all of their different devices. When using the option id argument, only the session unique ID provider will be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteSession","weight":53,"cookies":false,"type":"","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":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"sessionId","description":"Session unique ID. Use the string 'current' to delete the current device session.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/account\/verification":{"post":{"summary":"Create Email Verification","operationId":"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](\/docs\/client\/account#accountUpdateVerification). 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","weight":57,"cookies":false,"type":"","demo":"account\/create-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/create-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},email:{param-email}","scope":"account","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"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":"Complete Email Verification","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","weight":58,"cookies":false,"type":"","demo":"account\/update-verification.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/account\/update-verification.md","rate-limit":10,"rate-time":3600,"rate-key":"url:{url},userId:{param-userId}","scope":"public","platforms":["client","server"],"packaging":false,"auth":{"Project":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"userId":{"type":"string","description":"User unique 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":["application\/json"],"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 \/account\/sessions endpoint. Use width, height and quality arguments to change the output settings.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getBrowser","weight":60,"cookies":false,"type":"location","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"code","description":"Browser Code.","required":true,"type":"string","x-example":"aa","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/credit-cards\/{code}":{"get":{"summary":"Get Credit Card Icon","operationId":"avatarsGetCreditCard","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getCreditCard","weight":59,"cookies":false,"type":"location","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"code","description":"Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.","required":true,"type":"string","x-example":"amex","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/favicon":{"get":{"summary":"Get Favicon","operationId":"avatarsGetFavicon","consumes":["application\/json"],"produces":["image\/*"],"tags":["avatars"],"description":"Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFavicon","weight":63,"cookies":false,"type":"location","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":[],"Key":[]}},"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":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFlag","weight":61,"cookies":false,"type":"location","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"code","description":"Country Code. ISO Alpha-2 country code format.","required":true,"type":"string","x-example":"af","in":"path"},{"name":"width","description":"Image width. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"height","description":"Image height. Pass an integer between 0 to 2000. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"quality","description":"Image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"}]}},"\/avatars\/image":{"get":{"summary":"Get Image from URL","operationId":"avatarsGetImage","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getImage","weight":62,"cookies":false,"type":"location","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":[],"Key":[]}},"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.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 2000.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"}]}},"\/avatars\/initials":{"get":{"summary":"Get User Initials","operationId":"avatarsGetInitials","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getInitials","weight":65,"cookies":false,"type":"location","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":[],"Key":[]}},"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":"color","description":"Changes text color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"},{"name":"background","description":"Changes background color. By default a random color will be picked and stay will persistent to the given name.","required":false,"type":"string","default":"","in":"query"}]}},"\/avatars\/qr":{"get":{"summary":"Get QR Code","operationId":"avatarsGetQR","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getQR","weight":64,"cookies":false,"type":"location","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":[],"Key":[]}},"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 0 to 1000. Defaults to 400.","required":false,"type":"integer","format":"int32","x-example":0,"default":400,"in":"query"},{"name":"margin","description":"Margin from edge. Pass an integer between 0 to 10. Defaults to 1.","required":false,"type":"integer","format":"int32","x-example":0,"default":1,"in":"query"},{"name":"download","description":"Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.","required":false,"type":"boolean","x-example":false,"default":false,"in":"query"}]}},"\/database\/collections":{"get":{"summary":"List Collections","operationId":"databaseListCollections","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user collections. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's collections. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Collections List","schema":{"$ref":"#\/definitions\/collectionList"}}},"x-appwrite":{"method":"listCollections","weight":67,"cookies":false,"type":"","demo":"database\/list-collections.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-collections.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Collection","operationId":"databaseCreateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Collection.","responses":{"201":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"createCollection","weight":66,"cookies":false,"type":"","demo":"database\/create-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Collection name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["name","read","write","rules"]}}]}},"\/database\/collections\/{collectionId}":{"get":{"summary":"Get Collection","operationId":"databaseGetCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":68,"cookies":false,"type":"","demo":"database\/get-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]},"put":{"summary":"Update Collection","operationId":"databaseUpdateCollection","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Update a collection by its unique ID.","responses":{"200":{"description":"Collection","schema":{"$ref":"#\/definitions\/collection"}}},"x-appwrite":{"method":"updateCollection","weight":69,"cookies":false,"type":"","demo":"database\/update-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique 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]"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"rules":{"type":"array","description":"Array of [rule objects](\/docs\/rules). Each rule define a collection field name, data type and validation.","default":[],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]},"delete":{"summary":"Delete Collection","operationId":"databaseDeleteCollection","consumes":["application\/json"],"produces":[],"tags":["database"],"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","weight":70,"cookies":false,"type":"","demo":"database\/delete-collection.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-collection.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"collections.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID.","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"}]}},"\/database\/collections\/{collectionId}\/documents":{"get":{"summary":"List Documents","operationId":"databaseListDocuments","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's documents. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Documents List","schema":{"$ref":"#\/definitions\/documentList"}}},"x-appwrite":{"method":"listDocuments","weight":72,"cookies":false,"type":"","demo":"database\/list-documents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/list-documents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"filters","description":"Array of filter strings. Each filter is constructed from a key name, comparison operator (=, !=, >, <, <=, >=) and a value. You can also use a dot (.) separator in attribute names to filter by child document attributes. Examples: 'name=John Doe' or 'category.$id>=5bed2d152c362'.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"default":[],"in":"query"},{"name":"limit","description":"Maximum number of documents to return in response. Use this value to manage pagination. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Offset value. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderField","description":"Document field that results will be sorted by.","required":false,"type":"string","x-example":"[ORDER_FIELD]","default":"","in":"query"},{"name":"orderType","description":"Order direction. Possible values are DESC for descending order, or ASC for ascending order.","required":false,"type":"string","x-example":"DESC","default":"ASC","in":"query"},{"name":"orderCast","description":"Order field type casting. Possible values are int, string, date, time or datetime. The database will attempt to cast the order field to the value you pass here. The default value is a string.","required":false,"type":"string","x-example":"int","default":"string","in":"query"},{"name":"search","description":"Search query. Enter any free text search. The database will try to find a match against all document attributes and children. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"}]},"post":{"summary":"Create Document","operationId":"databaseCreateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"description":"Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](\/docs\/server\/database#databaseCreateCollection) API or directly from your database console.","responses":{"201":{"description":"Document","schema":{"$ref":"#\/definitions\/document"}}},"x-appwrite":{"method":"createDocument","weight":71,"cookies":false,"type":"","demo":"database\/create-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/create-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"parentDocument":{"type":"string","description":"Parent document unique ID. Use when you want your new document to be a child of a parent document.","default":"","x-example":"[PARENT_DOCUMENT]"},"parentProperty":{"type":"string","description":"Parent document property name. Use when you want your new document to be a child of a parent document.","default":"","x-example":null},"parentPropertyType":{"type":"string","description":"Parent document property connection type. You can set this value to **assign**, **append** or **prepend**, default value is assign. Use when you want your new document to be a child of a parent document.","default":"assign","x-example":"assign"}},"required":["data"]}}]}},"\/database\/collections\/{collectionId}\/documents\/{documentId}":{"get":{"summary":"Get Document","operationId":"databaseGetDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":73,"cookies":false,"type":"","demo":"database\/get-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/get-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]},"patch":{"summary":"Update Document","operationId":"databaseUpdateDocument","consumes":["application\/json"],"produces":["application\/json"],"tags":["database"],"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","weight":74,"cookies":false,"type":"","demo":"database\/update-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/update-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"data":{"type":"object","description":"Document data as JSON object.","default":null,"x-example":"{}"},"read":{"type":"array","description":"An array of strings with read permissions. By default inherits the existing read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default inherits the existing write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["data"]}}]},"delete":{"summary":"Delete Document","operationId":"databaseDeleteDocument","consumes":["application\/json"],"produces":[],"tags":["database"],"description":"Delete a document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents **will not** be deleted.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteDocument","weight":75,"cookies":false,"type":"","demo":"database\/delete-document.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/database\/delete-document.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"documents.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"collectionId","description":"Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](\/docs\/server\/database#createCollection).","required":true,"type":"string","x-example":"[COLLECTION_ID]","in":"path"},{"name":"documentId","description":"Document unique ID.","required":true,"type":"string","x-example":"[DOCUMENT_ID]","in":"path"}]}},"\/functions":{"get":{"summary":"List Functions","operationId":"functionsList","consumes":["application\/json"],"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","weight":161,"cookies":false,"type":"","demo":"functions\/list.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-functions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Function","operationId":"functionsCreate","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function. You can pass a list of [permissions](\/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","weight":160,"cookies":false,"type":"","demo":"functions\/create.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"execute":{"type":"array","description":"An array of strings with execution permissions. By default no user is granted with any execute permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"env":{"type":"string","description":"Execution enviornment.","default":null,"x-example":"dotnet-3.1"},"vars":{"type":"object","description":"Key-value JSON object.","default":{},"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name","execute","env"]}}]}},"\/functions\/{functionId}":{"get":{"summary":"Get Function","operationId":"functionsGet","consumes":["application\/json"],"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","weight":162,"cookies":false,"type":"","demo":"functions\/get.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"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"}]},"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","weight":164,"cookies":false,"type":"","demo":"functions\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"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":{"name":{"type":"string","description":"Function name. Max length: 128 chars.","default":null,"x-example":"[NAME]"},"execute":{"type":"array","description":"An array of strings with execution permissions. By default no user is granted with any execute permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"vars":{"type":"object","description":"Key-value JSON object.","default":{},"x-example":"{}"},"events":{"type":"array","description":"Events list.","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}},"required":["name","execute"]}}]},"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","weight":166,"cookies":false,"type":"","demo":"functions\/delete.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-function.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"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"}]}},"\/functions\/{functionId}\/executions":{"get":{"summary":"List Executions","operationId":"functionsListExecutions","consumes":["application\/json"],"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. On admin mode, this endpoint will return a list of all of the project's executions. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Executions List","schema":{"$ref":"#\/definitions\/executionList"}}},"x-appwrite":{"method":"listExecutions","weight":172,"cookies":false,"type":"","demo":"functions\/list-executions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-executions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"execution.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Execution","operationId":"functionsCreateExecution","consumes":["application\/json"],"produces":["application\/json"],"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","weight":171,"cookies":false,"type":"","demo":"functions\/create-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-execution.md","rate-limit":60,"rate-time":60,"rate-key":"url:{url},ip:{ip}","scope":"execution.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"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":{"data":{"type":"string","description":"String of custom data to send to function.","default":"","x-example":"[DATA]"}}}}]}},"\/functions\/{functionId}\/executions\/{executionId}":{"get":{"summary":"Get Execution","operationId":"functionsGetExecution","consumes":["application\/json"],"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","weight":173,"cookies":false,"type":"","demo":"functions\/get-execution.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-execution.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"execution.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"executionId","description":"Execution unique ID.","required":true,"type":"string","x-example":"[EXECUTION_ID]","in":"path"}]}},"\/functions\/{functionId}\/tag":{"patch":{"summary":"Update Function Tag","operationId":"functionsUpdateTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Update the function code tag ID using the unique function ID. Use this endpoint to switch the code tag that should be executed by the execution endpoint.","responses":{"200":{"description":"Function","schema":{"$ref":"#\/definitions\/function"}}},"x-appwrite":{"method":"updateTag","weight":165,"cookies":false,"type":"","demo":"functions\/update-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/update-function-tag.md","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":{"tag":{"type":"string","description":"Tag unique ID.","default":null,"x-example":"[TAG]"}},"required":["tag"]}}]}},"\/functions\/{functionId}\/tags":{"get":{"summary":"List Tags","operationId":"functionsListTags","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a list of all the project's code tags. You can use the query params to filter your results.","responses":{"200":{"description":"Tags List","schema":{"$ref":"#\/definitions\/tagList"}}},"x-appwrite":{"method":"listTags","weight":168,"cookies":false,"type":"","demo":"functions\/list-tags.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/list-tags.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"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":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Tag","operationId":"functionsCreateTag","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["functions"],"description":"Create a new function code tag. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's tag to use your new tag UID.\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](\/docs\/functions).\n\nUse the \"command\" param to set the entry point used to execute your code.","responses":{"201":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"createTag","weight":167,"cookies":false,"type":"","demo":"functions\/create-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/create-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"packaging":true,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"functionId","description":"Function unique ID.","required":true,"type":"string","x-example":"[FUNCTION_ID]","in":"path"},{"name":"command","description":"Code execution command.","required":true,"type":"string","x-example":"[COMMAND]","in":"formData"},{"name":"code","description":"Gzip file 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"}]}},"\/functions\/{functionId}\/tags\/{tagId}":{"get":{"summary":"Get Tag","operationId":"functionsGetTag","consumes":["application\/json"],"produces":["application\/json"],"tags":["functions"],"description":"Get a code tag by its unique ID.","responses":{"200":{"description":"Tag","schema":{"$ref":"#\/definitions\/tag"}}},"x-appwrite":{"method":"getTag","weight":169,"cookies":false,"type":"","demo":"functions\/get-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/get-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.read","platforms":["server"],"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":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]},"delete":{"summary":"Delete Tag","operationId":"functionsDeleteTag","consumes":["application\/json"],"produces":[],"tags":["functions"],"description":"Delete a code tag by its unique ID.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"deleteTag","weight":170,"cookies":false,"type":"","demo":"functions\/delete-tag.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/functions\/delete-tag.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"functions.write","platforms":["server"],"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":"tagId","description":"Tag unique ID.","required":true,"type":"string","x-example":"[TAG_ID]","in":"path"}]}},"\/health":{"get":{"summary":"Get HTTP","operationId":"healthGet","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite HTTP server is up and responsive.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"get","weight":83,"cookies":false,"type":"","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 Anti virus","operationId":"healthGetAntiVirus","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite Anti Virus server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getAntiVirus","weight":95,"cookies":false,"type":"","demo":"health\/get-anti-virus.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-storage-anti-virus.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/cache":{"get":{"summary":"Get Cache","operationId":"healthGetCache","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite in-memory cache server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getCache","weight":86,"cookies":false,"type":"","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\/db":{"get":{"summary":"Get DB","operationId":"healthGetDB","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite database server is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getDB","weight":85,"cookies":false,"type":"","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\/queue\/certificates":{"get":{"summary":"Get Certificate Queue","operationId":"healthGetQueueCertificates","consumes":["application\/json"],"produces":[],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueCertificates","weight":92,"cookies":false,"type":"","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":[]}]}},"\/health\/queue\/functions":{"get":{"summary":"Get Functions Queue","operationId":"healthGetQueueFunctions","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueFunctions","weight":93,"cookies":false,"type":"","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":[]}]}},"\/health\/queue\/logs":{"get":{"summary":"Get Logs Queue","operationId":"healthGetQueueLogs","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of logs that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueLogs","weight":90,"cookies":false,"type":"","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":[]}]}},"\/health\/queue\/tasks":{"get":{"summary":"Get Tasks Queue","operationId":"healthGetQueueTasks","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of tasks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueTasks","weight":89,"cookies":false,"type":"","demo":"health\/get-queue-tasks.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-tasks.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/usage":{"get":{"summary":"Get Usage Queue","operationId":"healthGetQueueUsage","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of usage stats that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueUsage","weight":91,"cookies":false,"type":"","demo":"health\/get-queue-usage.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/health\/get-queue-usage.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"health.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}]}},"\/health\/queue\/webhooks":{"get":{"summary":"Get Webhooks Queue","operationId":"healthGetQueueWebhooks","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getQueueWebhooks","weight":88,"cookies":false,"type":"","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":[]}]}},"\/health\/storage\/local":{"get":{"summary":"Get Local Storage","operationId":"healthGetStorageLocal","consumes":["application\/json"],"produces":[],"tags":["health"],"description":"Check the Appwrite local storage device is up and connection is successful.","responses":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getStorageLocal","weight":94,"cookies":false,"type":"","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":["application\/json"],"produces":[],"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":{"500":{"description":"File","schema":{"type":"file"}}},"x-appwrite":{"method":"getTime","weight":87,"cookies":false,"type":"","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":["application\/json"],"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","weight":76,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/continents":{"get":{"summary":"List Continents","operationId":"localeGetContinents","consumes":["application\/json"],"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":"getContinents","weight":80,"cookies":false,"type":"","demo":"locale\/get-continents.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-continents.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/countries":{"get":{"summary":"List Countries","operationId":"localeGetCountries","consumes":["application\/json"],"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":"getCountries","weight":77,"cookies":false,"type":"","demo":"locale\/get-countries.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/countries\/eu":{"get":{"summary":"List EU Countries","operationId":"localeGetCountriesEU","consumes":["application\/json"],"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":"getCountriesEU","weight":78,"cookies":false,"type":"","demo":"locale\/get-countries-e-u.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-eu.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/countries\/phones":{"get":{"summary":"List Countries Phone Codes","operationId":"localeGetCountriesPhones","consumes":["application\/json"],"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":"getCountriesPhones","weight":79,"cookies":false,"type":"","demo":"locale\/get-countries-phones.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-countries-phones.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/currencies":{"get":{"summary":"List Currencies","operationId":"localeGetCurrencies","consumes":["application\/json"],"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":"getCurrencies","weight":81,"cookies":false,"type":"","demo":"locale\/get-currencies.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-currencies.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/locale\/languages":{"get":{"summary":"List Languages","operationId":"localeGetLanguages","consumes":["application\/json"],"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":"getLanguages","weight":82,"cookies":false,"type":"","demo":"locale\/get-languages.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/locale\/get-languages.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"locale.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}]}},"\/storage\/files":{"get":{"summary":"List Files","operationId":"storageListFiles","consumes":["application\/json"],"produces":["application\/json"],"tags":["storage"],"description":"Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's files. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Files List","schema":{"$ref":"#\/definitions\/fileList"}}},"x-appwrite":{"method":"listFiles","weight":132,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create File","operationId":"storageCreateFile","consumes":["multipart\/form-data"],"produces":["application\/json"],"tags":["storage"],"description":"Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments.","responses":{"201":{"description":"File","schema":{"$ref":"#\/definitions\/file"}}},"x-appwrite":{"method":"createFile","weight":131,"cookies":false,"type":"upload","demo":"storage\/create-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/create-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"file","description":"Binary file.","required":true,"type":"file","in":"formData"},{"name":"read","description":"An array of strings with read permissions. By default only the current user is granted with read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"},{"name":"write","description":"An array of strings with write permissions. By default only the current user is granted with write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","required":false,"type":"array","collectionFormat":"multi","items":{"type":"string"},"in":"formData"}]}},"\/storage\/files\/{fileId}":{"get":{"summary":"Get File","operationId":"storageGetFile","consumes":["application\/json"],"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","weight":133,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique 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","weight":137,"cookies":false,"type":"","demo":"storage\/update-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/update-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"read":{"type":"array","description":"An array of strings with read permissions. By default no user is granted with any read permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}},"write":{"type":"array","description":"An array of strings with write permissions. By default no user is granted with any write permissions. [learn more about permissions](\/docs\/permissions) and get a full list of available permissions.","default":null,"x-example":null,"items":{"type":"string"}}},"required":["read","write"]}}]},"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","weight":138,"cookies":false,"type":"","demo":"storage\/delete-file.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/storage\/delete-file.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"files.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/download":{"get":{"summary":"Get File for Download","operationId":"storageGetFileDownload","consumes":["application\/json"],"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","weight":135,"cookies":false,"type":"location","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/storage\/files\/{fileId}\/preview":{"get":{"summary":"Get File Preview","operationId":"storageGetFilePreview","consumes":["application\/json"],"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.","responses":{"200":{"description":"Image","schema":{"type":"file"}}},"x-appwrite":{"method":"getFilePreview","weight":134,"cookies":false,"type":"location","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"},{"name":"width","description":"Resize preview image width, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"height","description":"Resize preview image height, Pass an integer between 0 to 4000.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"quality","description":"Preview image quality. Pass an integer between 0 to 100. Defaults to 100.","required":false,"type":"integer","format":"int32","x-example":0,"default":100,"in":"query"},{"name":"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 0 and 360.","required":false,"type":"integer","format":"int32","x-example":0,"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","default":"","in":"query"}]}},"\/storage\/files\/{fileId}\/view":{"get":{"summary":"Get File for View","operationId":"storageGetFileView","consumes":["application\/json"],"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","weight":136,"cookies":false,"type":"location","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"fileId","description":"File unique ID.","required":true,"type":"string","x-example":"[FILE_ID]","in":"path"}]}},"\/teams":{"get":{"summary":"List Teams","operationId":"teamsList","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's teams. [Learn more about different API modes](\/docs\/admin).","responses":{"200":{"description":"Teams List","schema":{"$ref":"#\/definitions\/teamList"}}},"x-appwrite":{"method":"list","weight":140,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team","operationId":"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. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.","responses":{"201":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"create","weight":139,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"payload","in":"body","schema":{"type":"object","properties":{"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](\/docs\/permissions). Max length for each role is 32 chars.","default":["owner"],"x-example":null,"items":{"type":"string"}}},"required":["name"]}}]}},"\/teams\/{teamId}":{"get":{"summary":"Get Team","operationId":"teamsGet","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team by its unique ID. All team members have read access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"get","weight":141,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]},"put":{"summary":"Update Team","operationId":"teamsUpdate","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Update a team by its unique ID. Only team owners have write access for this resource.","responses":{"200":{"description":"Team","schema":{"$ref":"#\/definitions\/team"}}},"x-appwrite":{"method":"update","weight":142,"cookies":false,"type":"","demo":"teams\/update.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"name":{"type":"string","description":"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 by its unique ID. Only team owners have write access for this resource.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":143,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"}]}},"\/teams\/{teamId}\/memberships":{"get":{"summary":"Get Team Memberships","operationId":"teamsGetMemberships","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Get a team members by the team unique ID. All team members have read access for this list of resources.","responses":{"200":{"description":"Memberships List","schema":{"$ref":"#\/definitions\/membershipList"}}},"x-appwrite":{"method":"getMemberships","weight":146,"cookies":false,"type":"","demo":"teams\/get-memberships.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/get-team-members.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.read","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create Team Membership","operationId":"teamsCreateMembership","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.\n\nUse the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](\/docs\/client\/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that in order to avoid a [Redirect Attacks](https:\/\/github.com\/OWASP\/CheatSheetSeries\/blob\/master\/cheatsheets\/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.","responses":{"201":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"createMembership","weight":144,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique ID.","required":true,"type":"string","x-example":"[TEAM_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"email":{"type":"string","description":"New team member email.","default":null,"x-example":"email@example.com"},"name":{"type":"string","description":"New team member name. Max length: 128 chars.","default":"","x-example":"[NAME]"},"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](\/docs\/permissions). Max length for each role is 32 chars.","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. 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","roles","url"]}}]}},"\/teams\/{teamId}\/memberships\/{membershipId}":{"patch":{"summary":"Update Membership Roles","operationId":"teamsUpdateMembershipRoles","consumes":["application\/json"],"produces":["application\/json"],"tags":["teams"],"description":"","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipRoles","weight":145,"cookies":false,"type":"","demo":"teams\/update-membership-roles.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/teams\/update-team-membership-roles.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"teams.write","platforms":["client","server","server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique 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":"Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](\/docs\/permissions). Max length for each role is 32 chars.","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","weight":148,"cookies":false,"type":"","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":[],"Key":[]}},"security":[{"Project":[],"Key":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique 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 recieved by the user.","responses":{"200":{"description":"Membership","schema":{"$ref":"#\/definitions\/membership"}}},"x-appwrite":{"method":"updateMembershipStatus","weight":147,"cookies":false,"type":"","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":[],"JWT":[]}},"security":[{"Project":[],"JWT":[]}],"parameters":[{"name":"teamId","description":"Team unique 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 unique ID.","default":null,"x-example":"[USER_ID]"},"secret":{"type":"string","description":"Secret key.","default":null,"x-example":"[SECRET]"}},"required":["userId","secret"]}}]}},"\/users":{"get":{"summary":"List Users","operationId":"usersList","consumes":["application\/json"],"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","weight":150,"cookies":false,"type":"","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":"search","description":"Search term to filter your list results. Max length: 256 chars.","required":false,"type":"string","x-example":"[SEARCH]","default":"","in":"query"},{"name":"limit","description":"Results limit value. By default will return maximum 25 results. Maximum of 100 results allowed per request.","required":false,"type":"integer","format":"int32","x-example":0,"default":25,"in":"query"},{"name":"offset","description":"Results offset. The default value is 0. Use this param to manage pagination.","required":false,"type":"integer","format":"int32","x-example":0,"default":0,"in":"query"},{"name":"orderType","description":"Order result by ASC or DESC order.","required":false,"type":"string","x-example":"ASC","default":"ASC","in":"query"}]},"post":{"summary":"Create User","operationId":"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","weight":149,"cookies":false,"type":"","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":{"email":{"type":"string","description":"User email.","default":null,"x-example":"email@example.com"},"password":{"type":"string","description":"User password. Must be between 6 to 32 chars.","default":null,"x-example":"password"},"name":{"type":"string","description":"User name. Max length: 128 chars.","default":"","x-example":"[NAME]"}},"required":["email","password"]}}]}},"\/users\/{userId}":{"get":{"summary":"Get User","operationId":"usersGet","consumes":["application\/json"],"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","weight":151,"cookies":false,"type":"","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 unique 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.","responses":{"204":{"description":"No content"}},"x-appwrite":{"method":"delete","weight":159,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/logs":{"get":{"summary":"Get User Logs","operationId":"usersGetLogs","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Get a user activity logs list by its unique ID.","responses":{"200":{"description":"Logs List","schema":{"$ref":"#\/definitions\/logList"}}},"x-appwrite":{"method":"getLogs","weight":154,"cookies":false,"type":"","demo":"users\/get-logs.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-logs.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]}},"\/users\/{userId}\/prefs":{"get":{"summary":"Get User Preferences","operationId":"usersGetPrefs","consumes":["application\/json"],"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","weight":152,"cookies":false,"type":"","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 unique 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. You can pass only the specific settings you wish to update.","responses":{"200":{"description":"Preferences","schema":{"$ref":"#\/definitions\/preferences"}}},"x-appwrite":{"method":"updatePrefs","weight":156,"cookies":false,"type":"","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 unique 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":null,"x-example":"{}"}},"required":["prefs"]}}]}},"\/users\/{userId}\/sessions":{"get":{"summary":"Get User Sessions","operationId":"usersGetSessions","consumes":["application\/json"],"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":"getSessions","weight":153,"cookies":false,"type":"","demo":"users\/get-sessions.md","edit":"https:\/\/github.com\/appwrite\/appwrite\/edit\/master\/docs\/references\/users\/get-user-sessions.md","rate-limit":0,"rate-time":3600,"rate-key":"url:{url},ip:{ip}","scope":"users.read","platforms":["server"],"packaging":false,"auth":{"Project":[],"Key":[]}},"security":[{"Project":[],"Key":[]}],"parameters":[{"name":"userId","description":"User unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"}]},"delete":{"summary":"Delete User Sessions","operationId":"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","weight":158,"cookies":false,"type":"","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 unique 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","weight":157,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"sessionId","description":"User unique session ID.","required":true,"type":"string","x-example":"[SESSION_ID]","in":"path"}]}},"\/users\/{userId}\/status":{"patch":{"summary":"Update User Status","operationId":"usersUpdateStatus","consumes":["application\/json"],"produces":["application\/json"],"tags":["users"],"description":"Update the user status by its unique ID.","responses":{"200":{"description":"User","schema":{"$ref":"#\/definitions\/user"}}},"x-appwrite":{"method":"updateStatus","weight":155,"cookies":false,"type":"","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 unique ID.","required":true,"type":"string","x-example":"[USER_ID]","in":"path"},{"name":"payload","in":"body","schema":{"type":"object","properties":{"status":{"type":"integer","description":"User Status code. To activate the user pass 1, to block the user pass 2 and for disabling the user pass 0","default":null,"x-example":1}},"required":["status"]}}]}}},"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":"database","description":"The Database 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":"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":"functions","description":"The Functions Service allows you view, create and manage your Cloud Functions."}],"definitions":{"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"},"version":{"type":"string","description":"Server version number.","x-example":"1.0"}},"required":["message","code","version"]},"collectionList":{"description":"Collections List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"collections":{"type":"array","description":"List of collections.","items":{"type":"object","$ref":"#\/definitions\/collection"},"x-example":""}},"required":["sum","collections"]},"documentList":{"description":"Documents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"documents":{"type":"array","description":"List of documents.","items":{"type":"object","$ref":"#\/definitions\/document"},"x-example":""}},"required":["sum","documents"]},"userList":{"description":"Users List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"users":{"type":"array","description":"List of users.","items":{"type":"object","$ref":"#\/definitions\/user"},"x-example":""}},"required":["sum","users"]},"sessionList":{"description":"Sessions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"sessions":{"type":"array","description":"List of sessions.","items":{"type":"object","$ref":"#\/definitions\/session"},"x-example":""}},"required":["sum","sessions"]},"logList":{"description":"Logs List","type":"object","properties":{"logs":{"type":"array","description":"List of logs.","items":{"type":"object","$ref":"#\/definitions\/log"},"x-example":""}},"required":["logs"]},"fileList":{"description":"Files List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"files":{"type":"array","description":"List of files.","items":{"type":"object","$ref":"#\/definitions\/file"},"x-example":""}},"required":["sum","files"]},"teamList":{"description":"Teams List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"teams":{"type":"array","description":"List of teams.","items":{"type":"object","$ref":"#\/definitions\/team"},"x-example":""}},"required":["sum","teams"]},"membershipList":{"description":"Memberships List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"memberships":{"type":"array","description":"List of memberships.","items":{"type":"object","$ref":"#\/definitions\/membership"},"x-example":""}},"required":["sum","memberships"]},"functionList":{"description":"Functions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"functions":{"type":"array","description":"List of functions.","items":{"type":"object","$ref":"#\/definitions\/function"},"x-example":""}},"required":["sum","functions"]},"tagList":{"description":"Tags List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"tags":{"type":"array","description":"List of tags.","items":{"type":"object","$ref":"#\/definitions\/tag"},"x-example":""}},"required":["sum","tags"]},"executionList":{"description":"Executions List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"executions":{"type":"array","description":"List of executions.","items":{"type":"object","$ref":"#\/definitions\/execution"},"x-example":""}},"required":["sum","executions"]},"countryList":{"description":"Countries List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"countries":{"type":"array","description":"List of countries.","items":{"type":"object","$ref":"#\/definitions\/country"},"x-example":""}},"required":["sum","countries"]},"continentList":{"description":"Continents List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"continents":{"type":"array","description":"List of continents.","items":{"type":"object","$ref":"#\/definitions\/continent"},"x-example":""}},"required":["sum","continents"]},"languageList":{"description":"Languages List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"languages":{"type":"array","description":"List of languages.","items":{"type":"object","$ref":"#\/definitions\/language"},"x-example":""}},"required":["sum","languages"]},"currencyList":{"description":"Currencies List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"currencies":{"type":"array","description":"List of currencies.","items":{"type":"object","$ref":"#\/definitions\/currency"},"x-example":""}},"required":["sum","currencies"]},"phoneList":{"description":"Phones List","type":"object","properties":{"sum":{"type":"integer","description":"Total sum of items in the list.","x-example":5,"format":"int32"},"phones":{"type":"array","description":"List of phones.","items":{"type":"object","$ref":"#\/definitions\/phone"},"x-example":""}},"required":["sum","phones"]},"permissions":{"description":"Permissions","type":"object","properties":{"read":{"type":"array","description":"Read permissions.","items":{"type":"string"},"x-example":"user:5e5ea5c16897e"},"write":{"type":"array","description":"Write permissions.","items":{"type":"string"},"x-example":"user:5e5ea5c16897e"}},"required":["read","write"]},"collection":{"description":"Collection","type":"object","properties":{"$id":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Collection permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Collection name.","x-example":"Movies"},"dateCreated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Collection creation date in Unix timestamp.","x-example":1592981550,"format":"int32"},"rules":{"type":"array","description":"Collection rules.","items":{"type":"object","$ref":"#\/definitions\/rule"},"x-example":""}},"required":["$id","$permissions","name","dateCreated","dateUpdated","rules"]},"document":{"description":"Document","type":"object","properties":{"$id":{"type":"string","description":"Document ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Collection ID.","x-example":"5e5ea5c15117e"},"$permissions":{"type":"object","description":"Document permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}}},"additionalProperties":true,"required":["$id","$collection","$permissions"]},"rule":{"description":"Rule","type":"object","properties":{"$id":{"type":"string","description":"Rule ID.","x-example":"5e5ea5c16897e"},"$collection":{"type":"string","description":"Rule Collection.","x-example":"5e5e66c16897e"},"type":{"type":"string","description":"Rule type. Possible values: ","x-example":"title"},"key":{"type":"string","description":"Rule key.","x-example":"title"},"label":{"type":"string","description":"Rule label.","x-example":"Title"},"default":{"type":"string","description":"Rule default value.","x-example":"Movie Name"},"array":{"type":"boolean","description":"Is array?","x-example":false},"required":{"type":"boolean","description":"Is required?","x-example":true},"list":{"type":"array","description":"List of allowed values","items":{"type":"string"},"x-example":"5e5ea5c168099"}},"required":["$id","$collection","type","key","label","default","array","required","list"]},"log":{"description":"Log","type":"object","properties":{"event":{"type":"string","description":"Event name.","x-example":"account.sessions.create"},"ip":{"type":"string","description":"IP session in use when the session was created.","x-example":"127.0.0.1"},"time":{"type":"integer","description":"Log creation time in Unix timestamp.","x-example":1592981250,"format":"int32"},"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","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"},"name":{"type":"string","description":"User name.","x-example":"John Doe"},"registration":{"type":"integer","description":"User registration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"status":{"type":"integer","description":"User status. 0 for Unactivated, 1 for active and 2 is blocked.","x-example":0,"format":"int32"},"passwordUpdate":{"type":"integer","description":"Unix timestamp of the most recent password update","x-example":1592981250,"format":"int32"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"emailVerification":{"type":"boolean","description":"Email verification 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"}}},"required":["$id","name","registration","status","passwordUpdate","email","emailVerification","prefs"]},"preferences":{"description":"Preferences","type":"object","additionalProperties":true},"session":{"description":"Session","type":"object","properties":{"$id":{"type":"string","description":"Session ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5bb8c16897e"},"expire":{"type":"integer","description":"Session expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"},"provider":{"type":"string","description":"Session Provider.","x-example":"email"},"providerUid":{"type":"string","description":"Session Provider User ID.","x-example":"user@example.com"},"providerToken":{"type":"string","description":"Session Provider 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}},"required":["$id","userId","expire","provider","providerUid","providerToken","ip","osCode","osName","osVersion","clientType","clientCode","clientName","clientVersion","clientEngine","clientEngineVersion","deviceName","deviceBrand","deviceModel","countryCode","countryName","current"]},"token":{"description":"Token","type":"object","properties":{"$id":{"type":"string","description":"Token ID.","x-example":"bb8ea5c16897e"},"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":"integer","description":"Token expiration date in Unix timestamp.","x-example":1592981250,"format":"int32"}},"required":["$id","userId","secret","expire"]},"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 Europian 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"]},"file":{"description":"File","type":"object","properties":{"$id":{"type":"string","description":"File ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"File permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"File name.","x-example":"Pink.png"},"dateCreated":{"type":"integer","description":"File creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"}},"required":["$id","$permissions","name","dateCreated","signature","mimeType","sizeOriginal"]},"team":{"description":"Team","type":"object","properties":{"$id":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"Team name.","x-example":"VIP"},"dateCreated":{"type":"integer","description":"Team creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"sum":{"type":"integer","description":"Total sum of team members.","x-example":7,"format":"int32"}},"required":["$id","name","dateCreated","sum"]},"membership":{"description":"Membership","type":"object","properties":{"$id":{"type":"string","description":"Membership ID.","x-example":"5e5ea5c16897e"},"userId":{"type":"string","description":"User ID.","x-example":"5e5ea5c16897e"},"teamId":{"type":"string","description":"Team ID.","x-example":"5e5ea5c16897e"},"name":{"type":"string","description":"User name.","x-example":"VIP"},"email":{"type":"string","description":"User email address.","x-example":"john@appwrite.io"},"invited":{"type":"integer","description":"Date, the user has been invited to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"joined":{"type":"integer","description":"Date, the user has accepted the invitation to join the team in Unix timestamp.","x-example":1592981250,"format":"int32"},"confirm":{"type":"boolean","description":"User confirmation status, true if the user has joined the team or false otherwise.","x-example":false},"roles":{"type":"array","description":"User list of roles","items":{"type":"string"},"x-example":"admin"}},"required":["$id","userId","teamId","name","email","invited","joined","confirm","roles"]},"function":{"description":"Function","type":"object","properties":{"$id":{"type":"string","description":"Function ID.","x-example":"5e5ea5c16897e"},"$permissions":{"type":"object","description":"Function permissions.","x-example":{},"items":{"type":"object","$ref":"#\/definitions\/permissions"}},"name":{"type":"string","description":"Function name.","x-example":"My Function"},"dateCreated":{"type":"integer","description":"Function creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"dateUpdated":{"type":"integer","description":"Function update date in Unix timestamp.","x-example":1592981257,"format":"int32"},"status":{"type":"string","description":"Function status. Possible values: disabled, enabled","x-example":"enabled"},"env":{"type":"string","description":"Function execution environment.","x-example":"python-3.8"},"tag":{"type":"string","description":"Function active tag ID.","x-example":"5e5ea5c16897e"},"vars":{"type":"string","description":"Function environment variables.","x-example":{"key":"value"}},"events":{"type":"array","description":"Function trigger events.","items":{"type":"string"},"x-example":"account.create"},"schedule":{"type":"string","description":"Function execution schedult in CRON format.","x-example":"5 4 * * *"},"scheduleNext":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981292,"format":"int32"},"schedulePrevious":{"type":"integer","description":"Function next scheduled execution date in Unix timestamp.","x-example":1592981237,"format":"int32"},"timeout":{"type":"integer","description":"Function execution timeout in seconds.","x-example":1592981237,"format":"int32"}},"required":["$id","$permissions","name","dateCreated","dateUpdated","status","env","tag","vars","events","schedule","scheduleNext","schedulePrevious","timeout"]},"tag":{"description":"Tag","type":"object","properties":{"$id":{"type":"string","description":"Tag ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The tag creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"command":{"type":"string","description":"The entrypoint command in use to execute the tag code.","x-example":"enabled"},"size":{"type":"string","description":"The code size in bytes.","x-example":"python-3.8"}},"required":["$id","functionId","dateCreated","command","size"]},"execution":{"description":"Execution","type":"object","properties":{"$id":{"type":"string","description":"Execution ID.","x-example":"5e5ea5c16897e"},"functionId":{"type":"string","description":"Function ID.","x-example":"5e5ea6g16897e"},"dateCreated":{"type":"integer","description":"The execution creation date in Unix timestamp.","x-example":1592981250,"format":"int32"},"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"},"exitCode":{"type":"integer","description":"The script exit code.","x-example":0,"format":"int32"},"stdout":{"type":"string","description":"The script stdout output string.","x-example":""},"stderr":{"type":"string","description":"The script stderr output string.","x-example":""},"time":{"type":"number","description":"The script execution time in seconds.","x-example":0.4,"format":"float"}},"required":["$id","functionId","dateCreated","trigger","status","exitCode","stdout","stderr","time"]},"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":"float"},"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"]}},"externalDocs":{"description":"Full API docs, specs and tutorials","url":"https:\/\/appwrite.io\/docs"}} \ No newline at end of file diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index a325bdd66..c3088c5b5 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -386,7 +386,8 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') ->inject('projectDB') ->inject('geodb') ->inject('audits') - ->action(function ($provider, $code, $state, $request, $response, $project, $user, $projectDB, $geodb, $audits) use ($oauthDefaultSuccess) { + ->inject('events') + ->action(function ($provider, $code, $state, $request, $response, $project, $user, $projectDB, $geodb, $audits, $events) use ($oauthDefaultSuccess) { /** @var Utopia\Swoole\Request $request */ /** @var Appwrite\Utopia\Response $response */ /** @var Appwrite\Database\Document $project */ @@ -579,6 +580,8 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') ->setParam('data', ['provider' => $provider]) ; + $events->setParam('eventData', $response->output($session, Response::MODEL_SESSION)); + if (!Config::getParam('domainVerification')) { $response ->addHeader('X-Fallback-Cookies', \json_encode([Auth::$cookieName => Auth::encodeSession($user->getId(), $secret)])) @@ -714,10 +717,16 @@ App::post('/v1/account/sessions/anonymous') $detector->getDevice() )); - $user->setAttribute('sessions', $session, Document::SET_TYPE_APPEND); - Authorization::setRole('user:'.$user->getId()); + $session = $projectDB->createDocument($session->getArrayCopy()); + + if (false === $session) { + throw new Exception('Failed saving session to DB', 500); + } + + $user->setAttribute('sessions', $session, Document::SET_TYPE_APPEND); + $user = $projectDB->updateDocument($user->getArrayCopy()); if (false === $user) { @@ -1266,16 +1275,16 @@ App::delete('/v1/account/sessions/:sessionId') ->setParam('resource', '/user/'.$user->getId()) ; - if (!Config::getParam('domainVerification')) { - $response - ->addHeader('X-Fallback-Cookies', \json_encode([])) - ; - } - $session->setAttribute('current', false); - + if ($session->getAttribute('secret') == Auth::hash(Auth::$secret)) { // If current session delete the cookies too $session->setAttribute('current', true); + + if (!Config::getParam('domainVerification')) { + $response + ->addHeader('X-Fallback-Cookies', \json_encode([])) + ; + } $response ->addCookie(Auth::$cookieName.'_legacy', '', \time() - 3600, '/', Config::getParam('cookieDomain'), ('https' == $protocol), true, null) diff --git a/app/controllers/api/health.php b/app/controllers/api/health.php index 01a9050e0..0885c0c40 100644 --- a/app/controllers/api/health.php +++ b/app/controllers/api/health.php @@ -6,6 +6,7 @@ use Utopia\Storage\Device\Local; use Utopia\Storage\Storage; use Appwrite\ClamAV\Network; use Appwrite\Event\Event; +use RuntimeException; App::get('/v1/health') ->desc('Get HTTP') @@ -262,11 +263,17 @@ App::get('/v1/health/anti-virus') $antiVirus = new Network(App::getEnv('_APP_STORAGE_ANTIVIRUS_HOST', 'clamav'), (int) App::getEnv('_APP_STORAGE_ANTIVIRUS_PORT', 3310)); - - $response->json([ - 'status' => (@$antiVirus->ping()) ? 'online' : 'offline', - 'version' => @$antiVirus->version(), - ]); + try { + $response->json([ + 'status' => (@$antiVirus->ping()) ? 'online' : 'offline', + 'version' => @$antiVirus->version(), + ]); + } catch( RuntimeException $e) { + $response->json([ + 'status' => 'offline', + 'version' => '', + ]); + } }); App::get('/v1/health/stats') // Currently only used internally diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index f0c63ce7b..b3060eaf4 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -22,6 +22,7 @@ use Utopia\Image\Image; use Appwrite\OpenSSL\OpenSSL; use Appwrite\Utopia\Response; use Utopia\Config\Config; +use Utopia\Validator\Numeric; App::post('/v1/storage/files') ->desc('Create File') @@ -245,7 +246,7 @@ App::get('/v1/storage/files/:fileId/preview') ->param('borderWidth', 0, new Range(0, 100), 'Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0.', true) ->param('borderColor', '', new HexColor(), 'Preview image border color. Use a valid HEX color, no # is needed for prefix.', true) ->param('borderRadius', 0, new Range(0, 4000), 'Preview image border radius in pixels. Pass an integer between 0 to 4000.', true) - ->param('opacity', 1, new Range(0,1), 'Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.', true) + ->param('opacity', 1, new Range(0,1, Range::TYPE_FLOAT), 'Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.', true) ->param('rotation', 0, new Range(0,360), 'Preview image rotation in degrees. Pass an integer between 0 and 360.', true) ->param('background', '', new HexColor(), 'Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.', true) ->param('output', '', new WhiteList(\array_keys(Config::getParam('storage-outputs')), true), 'Output format type (jpeg, jpg, png, gif and webp).', true) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index a6c2b4173..1e4f5dede 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -48,7 +48,9 @@ App::init(function ($utopia, $request, $response, $project, $user, $register, $e //TODO make sure we get array here foreach ($request->getParams() as $key => $value) { // Set request params as potential abuse keys - $timeLimit->setParam('{param-'.$key.'}', (\is_array($value)) ? \json_encode($value) : $value); + if(!empty($value)) { + $timeLimit->setParam('{param-'.$key.'}', (\is_array($value)) ? \json_encode($value) : $value); + } } $abuse = new Abuse($timeLimit); diff --git a/app/http.php b/app/http.php index efa47ffbd..89ff646d7 100644 --- a/app/http.php +++ b/app/http.php @@ -35,6 +35,7 @@ $http 'http_compression' => true, 'http_compression_level' => 6, 'package_max_length' => $payloadSize, + 'buffer_output_size' => $payloadSize, ]) ; diff --git a/app/views/console/account/index.phtml b/app/views/console/account/index.phtml index 3f1e7decc..4ad919cc2 100644 --- a/app/views/console/account/index.phtml +++ b/app/views/console/account/index.phtml @@ -193,8 +193,8 @@ -
  • -

    Devices

    +
  • +

    Sessions

    - +
    + + +
    + +
    +
    Unknown on @@ -283,7 +289,7 @@ data-failure-param-alert-text="Logout from All Sessions Failed" data-failure-param-alert-classname="error"> - +
  • diff --git a/app/views/console/storage/index.phtml b/app/views/console/storage/index.phtml index 05ed9453e..2ee5f1f20 100644 --- a/app/views/console/storage/index.phtml +++ b/app/views/console/storage/index.phtml @@ -134,7 +134,7 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0); -
    +
    File Preview
    @@ -145,9 +145,20 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0); New Window
    -
    + + +
    + Type: +
    +
    + Size: + +
    +
    + Created at: +
    diff --git a/app/views/console/users/index.phtml b/app/views/console/users/index.phtml index 8cb4b7e55..0b5641807 100644 --- a/app/views/console/users/index.phtml +++ b/app/views/console/users/index.phtml @@ -78,6 +78,7 @@ $auth = $this->getParam('auth', []); ----- + Anonymous User @@ -479,7 +480,7 @@ $auth = $this->getParam('auth', []); - <?php echo $this->escape(ucfirst($provider)); ?> Logo + <?php echo $this->escape(ucfirst($provider)); ?> Logo escape($name); ?> sandbox beta diff --git a/app/views/console/users/user.phtml b/app/views/console/users/user.phtml index 048d87007..e8b3b04ea 100644 --- a/app/views/console/users/user.phtml +++ b/app/views/console/users/user.phtml @@ -12,7 +12,8 @@
      - Unknown + Unknown + Anonymous User
    @@ -109,7 +110,7 @@ data-analytics-event="submit" data-analytics-category="console" data-analytics-label="Delete User" - data-service="users.deleteUser" + data-service="users.delete" data-event="submit" data-param-user-id="{{router.params.id}}" data-success="alert,trigger,redirect" @@ -180,8 +181,8 @@
  • -
  • -

    Devices

    +
  • +

    Sessions

    - - +
    + + +
    + +
    +
    on @@ -244,7 +250,7 @@ data-failure-param-alert-text="Failed to logout all sessions" data-failure-param-alert-classname="error"> - +
    diff --git a/app/views/home/auth/join.phtml b/app/views/home/auth/join.phtml index 481e8dcc3..af11975aa 100644 --- a/app/views/home/auth/join.phtml +++ b/app/views/home/auth/join.phtml @@ -9,7 +9,7 @@ data-scope="console" data-event="submit" data-param-team-id="{{router.params.teamId}}" - data-param-invite-id="{{router.params.membershipId}}" + data-param-membership-id="{{router.params.membershipId}}" data-param-user-id="{{router.params.userId}}" data-param-secret="{{router.params.secret}}" data-success="redirect,alert,trigger" diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index e35ea60d0..77b19d9a3 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -372,7 +372,7 @@ services: - appwrite-influxdb:/var/lib/influxdb:rw telegraf: - image: appwrite/telegraf:1.0.0 + image: appwrite/telegraf:1.1.0 container_name: appwrite-telegraf restart: unless-stopped networks: diff --git a/composer.json b/composer.json index 9a1536889..72658f838 100644 --- a/composer.json +++ b/composer.json @@ -62,7 +62,7 @@ "slickdeals/statsd": "3.0.2" }, "require-dev": { - "appwrite/sdk-generator": "0.10.3", + "appwrite/sdk-generator": "0.10.6", "swoole/ide-helper": "4.6.6", "phpunit/phpunit": "9.5.4", "vimeo/psalm": "4.7.2" diff --git a/composer.lock b/composer.lock index c86b55c6f..06cd748df 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c569da48f33b0ae0f5cf529f2e00a447", + "content-hash": "e433ce62dd355a107816e8967d5c769d", "packages": [ { "name": "adhocore/jwt", @@ -1693,16 +1693,16 @@ }, { "name": "utopia-php/framework", - "version": "0.14.0", + "version": "0.14.1", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "92d4a36f3b0e22393a31877c5317c96e01760339" + "reference": "632113288bebe41cbef79f0d355bd91609767b8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/92d4a36f3b0e22393a31877c5317c96e01760339", - "reference": "92d4a36f3b0e22393a31877c5317c96e01760339", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/632113288bebe41cbef79f0d355bd91609767b8c", + "reference": "632113288bebe41cbef79f0d355bd91609767b8c", "shasum": "" }, "require": { @@ -1736,9 +1736,9 @@ ], "support": { "issues": "https://github.com/utopia-php/framework/issues", - "source": "https://github.com/utopia-php/framework/tree/0.14.0" + "source": "https://github.com/utopia-php/framework/tree/0.14.1" }, - "time": "2021-04-15T21:01:44+00:00" + "time": "2021-05-21T06:41:45+00:00" }, { "name": "utopia-php/image", @@ -2340,16 +2340,16 @@ }, { "name": "appwrite/sdk-generator", - "version": "0.10.3", + "version": "0.10.6", "source": { "type": "git", "url": "https://github.com/appwrite/sdk-generator.git", - "reference": "3c3cc58fa6949d889158e64a41229b7bfa2d3411" + "reference": "ab4adb0b9126c617e11c8fdf4352c8aa9a715ecc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/3c3cc58fa6949d889158e64a41229b7bfa2d3411", - "reference": "3c3cc58fa6949d889158e64a41229b7bfa2d3411", + "url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/ab4adb0b9126c617e11c8fdf4352c8aa9a715ecc", + "reference": "ab4adb0b9126c617e11c8fdf4352c8aa9a715ecc", "shasum": "" }, "require": { @@ -2383,22 +2383,22 @@ "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.10.3" + "source": "https://github.com/appwrite/sdk-generator/tree/0.10.6" }, - "time": "2021-05-20T08:43:46+00:00" + "time": "2021-05-24T14:32:40+00:00" }, { "name": "composer/package-versions-deprecated", - "version": "1.11.99.1", + "version": "1.11.99.2", "source": { "type": "git", "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6" + "reference": "c6522afe5540d5fc46675043d3ed5a45a740b27c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/7413f0b55a051e89485c5cb9f765fe24bb02a7b6", - "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/c6522afe5540d5fc46675043d3ed5a45a740b27c", + "reference": "c6522afe5540d5fc46675043d3ed5a45a740b27c", "shasum": "" }, "require": { @@ -2442,7 +2442,7 @@ "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", "support": { "issues": "https://github.com/composer/package-versions-deprecated/issues", - "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.1" + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.2" }, "funding": [ { @@ -2458,20 +2458,20 @@ "type": "tidelift" } ], - "time": "2020-11-11T10:22:58+00:00" + "time": "2021-05-24T07:46:03+00:00" }, { "name": "composer/semver", - "version": "3.2.4", + "version": "3.2.5", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464" + "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", - "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", + "url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9", + "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9", "shasum": "" }, "require": { @@ -2523,7 +2523,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.4" + "source": "https://github.com/composer/semver/tree/3.2.5" }, "funding": [ { @@ -2539,7 +2539,7 @@ "type": "tidelift" } ], - "time": "2020-11-13T08:59:24+00:00" + "time": "2021-05-24T12:41:47+00:00" }, { "name": "composer/xdebug-handler", diff --git a/docs/sdks/dart/CHANGELOG.md b/docs/sdks/dart/CHANGELOG.md index 120c7e2e5..a908c233b 100644 --- a/docs/sdks/dart/CHANGELOG.md +++ b/docs/sdks/dart/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.1 + +- Fix for image preview param types + ## 0.6.0 - Upgraded to Null-safety, minimum Dart SDK required 2.12.0 diff --git a/docs/sdks/flutter/CHANGELOG.md b/docs/sdks/flutter/CHANGELOG.md index 38c52cb9b..2d808982a 100644 --- a/docs/sdks/flutter/CHANGELOG.md +++ b/docs/sdks/flutter/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.6.2 + +- Fixed deployment bug + +## 0.6.1 + +- Fix for image preview param types + ## 0.6.0 - Upgraded to Null-safety, minimum Dart SDK required 2.12.0 diff --git a/docs/sdks/web/GETTING_STARTED.md b/docs/sdks/web/GETTING_STARTED.md index f8908ae9d..ba337b178 100644 --- a/docs/sdks/web/GETTING_STARTED.md +++ b/docs/sdks/web/GETTING_STARTED.md @@ -10,12 +10,11 @@ Initialize your SDK code with your project ID which can be found in your project ```js // Init your Web SDK -const appwrite = new Appwrite(); +const sdk = new Appwrite(); -appwrite +sdk .setEndpoint('http://localhost/v1') // Your Appwrite Endpoint .setProject('455x34dfkj') // Your project ID - .setSelfSigned() // Use only on dev mode with a self-signed SSL cert ; ``` @@ -24,35 +23,32 @@ Once your SDK object is set, access any of the Appwrite services and choose any ```js // Register User -appwrite - .account.create('me@example.com', 'password', 'Jane Doe') - .then(function (response) { - console.log(response); - }, function (error) { - console.log(error); - }); +sdk.account.create('me@example.com', 'password', 'Jane Doe') + .then(function (response) { + console.log(response); + }, function (error) { + console.log(error); + }); ``` ### Full Example ```js // Init your Web SDK -const appwrite = new Appwrite(); +const sdk = new Appwrite(); -appwrite +sdk .setEndpoint('http://localhost/v1') // Your Appwrite Endpoint .setProject('455x34dfkj') - .setSelfSigned() // Use only on dev mode with a self-signed SSL cert ; // Register User -appwrite - .account.create('me@example.com', 'password', 'Jane Doe') - .then(function (response) { - console.log(response); - }, function (error) { - console.log(error); - }); +sdk.account.create('me@example.com', 'password', 'Jane Doe') + .then(function (response) { + console.log(response); + }, function (error) { + console.log(error); + }); ``` ### Learn more diff --git a/docs/tutorials/add-oauth2-provider.md b/docs/tutorials/add-oauth2-provider.md index c06d7c087..6f36a6b71 100644 --- a/docs/tutorials/add-oauth2-provider.md +++ b/docs/tutorials/add-oauth2-provider.md @@ -25,7 +25,7 @@ Make sure to fill all data needed and that your provider array key name: ### Add Provider Logo -Add a logo image to your new provider in this path: `./public/images/oauth2`. Your logo should be a png 100×100px file with the name of your provider (all lowercase). Please make sure to leave about 30px padding around the logo to be consistent with other logos. +Add a logo image to your new provider in this path: `./public/images/users`. Your logo should be a png 100×100px file with the name of your provider (all lowercase). Please make sure to leave about 30px padding around the logo to be consistent with other logos. ### Add Provider Class diff --git a/package-lock.json b/package-lock.json index b156a38f5..a74beaedd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1563,6 +1563,7 @@ "yallist" ], "dev": true, + "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -1806,6 +1807,16 @@ "license": "ISC", "optional": true }, + "node_modules/fsevents/node_modules/ini": { + "version": "1.3.5", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "engines": { + "node": "*" + } + }, "node_modules/fsevents/node_modules/is-fullwidth-code-point": { "version": "1.0.0", "dev": true, @@ -7028,6 +7039,12 @@ "dev": true, "optional": true }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, diff --git a/public/dist/scripts/app-all.js b/public/dist/scripts/app-all.js index 604bf2381..723b390dc 100644 --- a/public/dist/scripts/app-all.js +++ b/public/dist/scripts/app-all.js @@ -1,463 +1,461 @@ -(function(window){'use strict';window.Appwrite=function(){let config={endpoint:'https://appwrite.io/v1',project:'',key:'',locale:'',mode:'',};let setEndpoint=function(endpoint){config.endpoint=endpoint;return this;};let setProject=function(value) -{http.addGlobalHeader('X-Appwrite-Project',value);config.project=value;return this;};let setKey=function(value) -{http.addGlobalHeader('X-Appwrite-Key',value);config.key=value;return this;};let setLocale=function(value) -{http.addGlobalHeader('X-Appwrite-Locale',value);config.locale=value;return this;};let setMode=function(value) -{http.addGlobalHeader('X-Appwrite-Mode',value);config.mode=value;return this;};let http=function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&|&)+([^=]+)(?:=([^&]*))*/g;let match,str=[];a.href=url;param=encodeURIComponent(param);while(match=regex.exec(a.search))if(param!==match[1])str.push(match[1]+(match[2]?"="+match[2]:""));str.push(param+(value?"="+encodeURIComponent(value):""));a.search=str.join("&");return a.href;};let buildQuery=function(params){let str=[];for(let p in params){if(Array.isArray(params[p])){for(let index=0;index=request.status){resolve(data);}else{reject(data);}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,false);} -request.onerror=function(){reject(new Error("Network Error"));};request.send(params);})};return{'get':function(path,headers={},params={}){return call('GET',path+((Object.keys(params).length>0)?'?'+buildQuery(params):''),headers,{});},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress);},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress);},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress);},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress);},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');} -if(password===undefined){throw new Error('Missing required parameter: "password"');} -let path='/account';let payload={};if(email){payload['email']=email;} -if(password){payload['password']=password;} -if(name){payload['name']=name;} -return http.post(path,{'content-type':'application/json',},payload);},delete:function(){let path='/account';let payload={};return http.delete(path,{'content-type':'application/json',},payload);},updateEmail:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"');} -if(password===undefined){throw new Error('Missing required parameter: "password"');} -let path='/account/email';let payload={};if(email){payload['email']=email;} -if(password){payload['password']=password;} -return http.patch(path,{'content-type':'application/json',},payload);},getLogs:function(){let path='/account/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateName:function(name){if(name===undefined){throw new Error('Missing required parameter: "name"');} -let path='/account/name';let payload={};if(name){payload['name']=name;} -return http.patch(path,{'content-type':'application/json',},payload);},updatePassword:function(password,oldPassword){if(password===undefined){throw new Error('Missing required parameter: "password"');} -if(oldPassword===undefined){throw new Error('Missing required parameter: "oldPassword"');} -let path='/account/password';let payload={};if(password){payload['password']=password;} -if(oldPassword){payload['oldPassword']=oldPassword;} -return http.patch(path,{'content-type':'application/json',},payload);},getPrefs:function(){let path='/account/prefs';let payload={};return http.get(path,{'content-type':'application/json',},payload);},updatePrefs:function(prefs){if(prefs===undefined){throw new Error('Missing required parameter: "prefs"');} -let path='/account/prefs';let payload={};if(prefs){payload['prefs']=prefs;} -return http.patch(path,{'content-type':'application/json',},payload);},createRecovery:function(email,url){if(email===undefined){throw new Error('Missing required parameter: "email"');} -if(url===undefined){throw new Error('Missing required parameter: "url"');} -let path='/account/recovery';let payload={};if(email){payload['email']=email;} -if(url){payload['url']=url;} -return http.post(path,{'content-type':'application/json',},payload);},updateRecovery:function(userId,secret,password,passwordAgain){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -if(secret===undefined){throw new Error('Missing required parameter: "secret"');} -if(password===undefined){throw new Error('Missing required parameter: "password"');} -if(passwordAgain===undefined){throw new Error('Missing required parameter: "passwordAgain"');} -let path='/account/recovery';let payload={};if(userId){payload['userId']=userId;} -if(secret){payload['secret']=secret;} -if(password){payload['password']=password;} -if(passwordAgain){payload['passwordAgain']=passwordAgain;} -return http.put(path,{'content-type':'application/json',},payload);},getSessions:function(){let path='/account/sessions';let payload={};return http.get(path,{'content-type':'application/json',},payload);},createSession:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"');} -if(password===undefined){throw new Error('Missing required parameter: "password"');} -let path='/account/sessions';let payload={};if(email){payload['email']=email;} -if(password){payload['password']=password;} -return http.post(path,{'content-type':'application/json',},payload);},deleteSessions:function(){let path='/account/sessions';let payload={};return http.delete(path,{'content-type':'application/json',},payload);},createOAuth2Session:function(provider,success='https://appwrite.io/auth/oauth2/success',failure='https://appwrite.io/auth/oauth2/failure',scopes=[]){if(provider===undefined){throw new Error('Missing required parameter: "provider"');} -let path='/account/sessions/oauth2/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload['success']=success;} +var Appwrite=(function(exports,isomorphicFormData,crossFetch){'use strict';function __awaiter(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value);});} +return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value));}catch(e){reject(e);}} +function rejected(value){try{step(generator["throw"](value));}catch(e){reject(e);}} +function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected);} +step((generator=generator.apply(thisArg,_arguments||[])).next());});} +class AppwriteException extends Error{constructor(message,code=0,response=''){super(message);this.name='AppwriteException';this.message=message;this.code=code;this.response=response;}} +class Appwrite{constructor(){this.config={endpoint:'https://appwrite.io/v1',project:'',key:'',jwt:'',locale:'',mode:'',};this.headers={'x-sdk-version':'appwrite:web:2.0.0','X-Appwrite-Response-Format':'0.8.0',};this.account={get:()=>__awaiter(this,void 0,void 0,function*(){let path='/account';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),create:(email,password,name='')=>__awaiter(this,void 0,void 0,function*(){if(email===undefined){throw new AppwriteException('Missing required parameter: "email"');} +if(password===undefined){throw new AppwriteException('Missing required parameter: "password"');} +let path='/account';let payload={};if(typeof email!=='undefined'){payload['email']=email;} +if(typeof password!=='undefined'){payload['password']=password;} +if(typeof name!=='undefined'){payload['name']=name;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),delete:()=>__awaiter(this,void 0,void 0,function*(){let path='/account';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),updateEmail:(email,password)=>__awaiter(this,void 0,void 0,function*(){if(email===undefined){throw new AppwriteException('Missing required parameter: "email"');} +if(password===undefined){throw new AppwriteException('Missing required parameter: "password"');} +let path='/account/email';let payload={};if(typeof email!=='undefined'){payload['email']=email;} +if(typeof password!=='undefined'){payload['password']=password;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),createJWT:()=>__awaiter(this,void 0,void 0,function*(){let path='/account/jwt';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getLogs:()=>__awaiter(this,void 0,void 0,function*(){let path='/account/logs';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateName:(name)=>__awaiter(this,void 0,void 0,function*(){if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +let path='/account/name';let payload={};if(typeof name!=='undefined'){payload['name']=name;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),updatePassword:(password,oldPassword='')=>__awaiter(this,void 0,void 0,function*(){if(password===undefined){throw new AppwriteException('Missing required parameter: "password"');} +let path='/account/password';let payload={};if(typeof password!=='undefined'){payload['password']=password;} +if(typeof oldPassword!=='undefined'){payload['oldPassword']=oldPassword;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),getPrefs:()=>__awaiter(this,void 0,void 0,function*(){let path='/account/prefs';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updatePrefs:(prefs)=>__awaiter(this,void 0,void 0,function*(){if(prefs===undefined){throw new AppwriteException('Missing required parameter: "prefs"');} +let path='/account/prefs';let payload={};if(typeof prefs!=='undefined'){payload['prefs']=prefs;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),createRecovery:(email,url)=>__awaiter(this,void 0,void 0,function*(){if(email===undefined){throw new AppwriteException('Missing required parameter: "email"');} +if(url===undefined){throw new AppwriteException('Missing required parameter: "url"');} +let path='/account/recovery';let payload={};if(typeof email!=='undefined'){payload['email']=email;} +if(typeof url!=='undefined'){payload['url']=url;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),updateRecovery:(userId,secret,password,passwordAgain)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +if(secret===undefined){throw new AppwriteException('Missing required parameter: "secret"');} +if(password===undefined){throw new AppwriteException('Missing required parameter: "password"');} +if(passwordAgain===undefined){throw new AppwriteException('Missing required parameter: "passwordAgain"');} +let path='/account/recovery';let payload={};if(typeof userId!=='undefined'){payload['userId']=userId;} +if(typeof secret!=='undefined'){payload['secret']=secret;} +if(typeof password!=='undefined'){payload['password']=password;} +if(typeof passwordAgain!=='undefined'){payload['passwordAgain']=passwordAgain;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),getSessions:()=>__awaiter(this,void 0,void 0,function*(){let path='/account/sessions';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createSession:(email,password)=>__awaiter(this,void 0,void 0,function*(){if(email===undefined){throw new AppwriteException('Missing required parameter: "email"');} +if(password===undefined){throw new AppwriteException('Missing required parameter: "password"');} +let path='/account/sessions';let payload={};if(typeof email!=='undefined'){payload['email']=email;} +if(typeof password!=='undefined'){payload['password']=password;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),deleteSessions:()=>__awaiter(this,void 0,void 0,function*(){let path='/account/sessions';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),createAnonymousSession:()=>__awaiter(this,void 0,void 0,function*(){let path='/account/sessions/anonymous';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createOAuth2Session:(provider,success='https://appwrite.io/auth/oauth2/success',failure='https://appwrite.io/auth/oauth2/failure',scopes=[])=>{if(provider===undefined){throw new AppwriteException('Missing required parameter: "provider"');} +let path='/account/sessions/oauth2/{provider}'.replace('{provider}',provider);let payload={};if(success){payload['success']=success;} if(failure){payload['failure']=failure;} if(scopes){payload['scopes']=scopes;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index__awaiter(this,void 0,void 0,function*(){if(sessionId===undefined){throw new AppwriteException('Missing required parameter: "sessionId"');} +let path='/account/sessions/{sessionId}'.replace('{sessionId}',sessionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),createVerification:(url)=>__awaiter(this,void 0,void 0,function*(){if(url===undefined){throw new AppwriteException('Missing required parameter: "url"');} +let path='/account/verification';let payload={};if(typeof url!=='undefined'){payload['url']=url;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),updateVerification:(userId,secret)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +if(secret===undefined){throw new AppwriteException('Missing required parameter: "secret"');} +let path='/account/verification';let payload={};if(typeof userId!=='undefined'){payload['userId']=userId;} +if(typeof secret!=='undefined'){payload['secret']=secret;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);})};this.avatars={getBrowser:(code,width=100,height=100,quality=100)=>{if(code===undefined){throw new AppwriteException('Missing required parameter: "code"');} +let path='/avatars/browsers/{code}'.replace('{code}',code);let payload={};if(width){payload['width']=width;} if(height){payload['height']=height;} if(quality){payload['quality']=quality;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index{if(code===undefined){throw new AppwriteException('Missing required parameter: "code"');} +let path='/avatars/credit-cards/{code}'.replace('{code}',code);let payload={};if(width){payload['width']=width;} if(height){payload['height']=height;} if(quality){payload['quality']=quality;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index{if(url===undefined){throw new AppwriteException('Missing required parameter: "url"');} let path='/avatars/favicon';let payload={};if(url){payload['url']=url;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index{if(code===undefined){throw new AppwriteException('Missing required parameter: "code"');} +let path='/avatars/flags/{code}'.replace('{code}',code);let payload={};if(width){payload['width']=width;} if(height){payload['height']=height;} if(quality){payload['quality']=quality;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index{if(url===undefined){throw new AppwriteException('Missing required parameter: "url"');} let path='/avatars/image';let payload={};if(url){payload['url']=url;} if(width){payload['width']=width;} if(height){payload['height']=height;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index{let path='/avatars/initials';let payload={};if(name){payload['name']=name;} if(width){payload['width']=width;} if(height){payload['height']=height;} if(color){payload['color']=color;} if(background){payload['background']=background;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index{if(text===undefined){throw new AppwriteException('Missing required parameter: "text"');} let path='/avatars/qr';let payload={};if(text){payload['text']=text;} if(size){payload['size']=size;} if(margin){payload['margin']=margin;} if(download){payload['download']=download;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index__awaiter(this,void 0,void 0,function*(){let path='/database/collections';let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},createCollection:function(name,read,write,rules){if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(read===undefined){throw new Error('Missing required parameter: "read"');} -if(write===undefined){throw new Error('Missing required parameter: "write"');} -if(rules===undefined){throw new Error('Missing required parameter: "rules"');} -let path='/database/collections';let payload={};if(name){payload['name']=name;} -if(read){payload['read']=read;} -if(write){payload['write']=write;} -if(rules){payload['rules']=rules;} -return http.post(path,{'content-type':'application/json',},payload);},getCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -let path='/database/collections/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateCollection:function(collectionId,name,read,write,rules=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(read===undefined){throw new Error('Missing required parameter: "read"');} -if(write===undefined){throw new Error('Missing required parameter: "write"');} -let path='/database/collections/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(name){payload['name']=name;} -if(read){payload['read']=read;} -if(write){payload['write']=write;} -if(rules){payload['rules']=rules;} -return http.put(path,{'content-type':'application/json',},payload);},deleteCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -let path='/database/collections/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},listDocuments:function(collectionId,filters=[],limit=25,offset=0,orderField='',orderType='ASC',orderCast='string',search=''){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -let path='/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(filters){payload['filters']=filters;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createCollection:(name,read,write,rules)=>__awaiter(this,void 0,void 0,function*(){if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(read===undefined){throw new AppwriteException('Missing required parameter: "read"');} +if(write===undefined){throw new AppwriteException('Missing required parameter: "write"');} +if(rules===undefined){throw new AppwriteException('Missing required parameter: "rules"');} +let path='/database/collections';let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof read!=='undefined'){payload['read']=read;} +if(typeof write!=='undefined'){payload['write']=write;} +if(typeof rules!=='undefined'){payload['rules']=rules;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getCollection:(collectionId)=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +let path='/database/collections/{collectionId}'.replace('{collectionId}',collectionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateCollection:(collectionId,name,read=[],write=[],rules=[])=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +let path='/database/collections/{collectionId}'.replace('{collectionId}',collectionId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof read!=='undefined'){payload['read']=read;} +if(typeof write!=='undefined'){payload['write']=write;} +if(typeof rules!=='undefined'){payload['rules']=rules;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),deleteCollection:(collectionId)=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +let path='/database/collections/{collectionId}'.replace('{collectionId}',collectionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),listDocuments:(collectionId,filters=[],limit=25,offset=0,orderField='',orderType='ASC',orderCast='string',search='')=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +let path='/database/collections/{collectionId}/documents'.replace('{collectionId}',collectionId);let payload={};if(filters){payload['filters']=filters;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderField){payload['orderField']=orderField;} if(orderType){payload['orderType']=orderType;} if(orderCast){payload['orderCast']=orderCast;} if(search){payload['search']=search;} -return http.get(path,{'content-type':'application/json',},payload);},createDocument:function(collectionId,data,read,write,parentDocument='',parentProperty='',parentPropertyType='assign'){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -if(data===undefined){throw new Error('Missing required parameter: "data"');} -if(read===undefined){throw new Error('Missing required parameter: "read"');} -if(write===undefined){throw new Error('Missing required parameter: "write"');} -let path='/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(data){payload['data']=data;} -if(read){payload['read']=read;} -if(write){payload['write']=write;} -if(parentDocument){payload['parentDocument']=parentDocument;} -if(parentProperty){payload['parentProperty']=parentProperty;} -if(parentPropertyType){payload['parentPropertyType']=parentPropertyType;} -return http.post(path,{'content-type':'application/json',},payload);},getDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -if(documentId===undefined){throw new Error('Missing required parameter: "documentId"');} -let path='/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateDocument:function(collectionId,documentId,data,read,write){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -if(documentId===undefined){throw new Error('Missing required parameter: "documentId"');} -if(data===undefined){throw new Error('Missing required parameter: "data"');} -if(read===undefined){throw new Error('Missing required parameter: "read"');} -if(write===undefined){throw new Error('Missing required parameter: "write"');} -let path='/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};if(data){payload['data']=data;} -if(read){payload['read']=read;} -if(write){payload['write']=write;} -return http.patch(path,{'content-type':'application/json',},payload);},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -if(documentId===undefined){throw new Error('Missing required parameter: "documentId"');} -let path='/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);}};let functions={list:function(search='',limit=25,offset=0,orderType='ASC'){let path='/functions';let payload={};if(search){payload['search']=search;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createDocument:(collectionId,data,read=[],write=[],parentDocument='',parentProperty='',parentPropertyType='assign')=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +if(data===undefined){throw new AppwriteException('Missing required parameter: "data"');} +let path='/database/collections/{collectionId}/documents'.replace('{collectionId}',collectionId);let payload={};if(typeof data!=='undefined'){payload['data']=data;} +if(typeof read!=='undefined'){payload['read']=read;} +if(typeof write!=='undefined'){payload['write']=write;} +if(typeof parentDocument!=='undefined'){payload['parentDocument']=parentDocument;} +if(typeof parentProperty!=='undefined'){payload['parentProperty']=parentProperty;} +if(typeof parentPropertyType!=='undefined'){payload['parentPropertyType']=parentPropertyType;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getDocument:(collectionId,documentId)=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +if(documentId===undefined){throw new AppwriteException('Missing required parameter: "documentId"');} +let path='/database/collections/{collectionId}/documents/{documentId}'.replace('{collectionId}',collectionId).replace('{documentId}',documentId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateDocument:(collectionId,documentId,data,read=[],write=[])=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +if(documentId===undefined){throw new AppwriteException('Missing required parameter: "documentId"');} +if(data===undefined){throw new AppwriteException('Missing required parameter: "data"');} +let path='/database/collections/{collectionId}/documents/{documentId}'.replace('{collectionId}',collectionId).replace('{documentId}',documentId);let payload={};if(typeof data!=='undefined'){payload['data']=data;} +if(typeof read!=='undefined'){payload['read']=read;} +if(typeof write!=='undefined'){payload['write']=write;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),deleteDocument:(collectionId,documentId)=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +if(documentId===undefined){throw new AppwriteException('Missing required parameter: "documentId"');} +let path='/database/collections/{collectionId}/documents/{documentId}'.replace('{collectionId}',collectionId).replace('{documentId}',documentId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);})};this.functions={list:(search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){let path='/functions';let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},create:function(name,execute,env,vars={},events=[],schedule='',timeout=15){if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(execute===undefined){throw new Error('Missing required parameter: "execute"');} -if(env===undefined){throw new Error('Missing required parameter: "env"');} -let path='/functions';let payload={};if(name){payload['name']=name;} -if(execute){payload['execute']=execute;} -if(env){payload['env']=env;} -if(vars){payload['vars']=vars;} -if(events){payload['events']=events;} -if(schedule){payload['schedule']=schedule;} -if(timeout){payload['timeout']=timeout;} -return http.post(path,{'content-type':'application/json',},payload);},get:function(functionId){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -let path='/functions/{functionId}'.replace(new RegExp('{functionId}','g'),functionId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},update:function(functionId,name,execute,vars={},events=[],schedule='',timeout=15){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(execute===undefined){throw new Error('Missing required parameter: "execute"');} -let path='/functions/{functionId}'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(name){payload['name']=name;} -if(execute){payload['execute']=execute;} -if(vars){payload['vars']=vars;} -if(events){payload['events']=events;} -if(schedule){payload['schedule']=schedule;} -if(timeout){payload['timeout']=timeout;} -return http.put(path,{'content-type':'application/json',},payload);},delete:function(functionId){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -let path='/functions/{functionId}'.replace(new RegExp('{functionId}','g'),functionId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},listExecutions:function(functionId,search='',limit=25,offset=0,orderType='ASC'){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -let path='/functions/{functionId}/executions'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(search){payload['search']=search;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),create:(name,execute,env,vars={},events=[],schedule='',timeout=15)=>__awaiter(this,void 0,void 0,function*(){if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(execute===undefined){throw new AppwriteException('Missing required parameter: "execute"');} +if(env===undefined){throw new AppwriteException('Missing required parameter: "env"');} +let path='/functions';let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof execute!=='undefined'){payload['execute']=execute;} +if(typeof env!=='undefined'){payload['env']=env;} +if(typeof vars!=='undefined'){payload['vars']=vars;} +if(typeof events!=='undefined'){payload['events']=events;} +if(typeof schedule!=='undefined'){payload['schedule']=schedule;} +if(typeof timeout!=='undefined'){payload['timeout']=timeout;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),get:(functionId)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +let path='/functions/{functionId}'.replace('{functionId}',functionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),update:(functionId,name,execute,vars={},events=[],schedule='',timeout=15)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(execute===undefined){throw new AppwriteException('Missing required parameter: "execute"');} +let path='/functions/{functionId}'.replace('{functionId}',functionId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof execute!=='undefined'){payload['execute']=execute;} +if(typeof vars!=='undefined'){payload['vars']=vars;} +if(typeof events!=='undefined'){payload['events']=events;} +if(typeof schedule!=='undefined'){payload['schedule']=schedule;} +if(typeof timeout!=='undefined'){payload['timeout']=timeout;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),delete:(functionId)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +let path='/functions/{functionId}'.replace('{functionId}',functionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),listExecutions:(functionId,search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +let path='/functions/{functionId}/executions'.replace('{functionId}',functionId);let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},createExecution:function(functionId,data){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -let path='/functions/{functionId}/executions'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(data){payload['data']=data;} -return http.post(path,{'content-type':'application/json',},payload);},getExecution:function(functionId,executionId){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -if(executionId===undefined){throw new Error('Missing required parameter: "executionId"');} -let path='/functions/{functionId}/executions/{executionId}'.replace(new RegExp('{functionId}','g'),functionId).replace(new RegExp('{executionId}','g'),executionId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateTag:function(functionId,tag){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -if(tag===undefined){throw new Error('Missing required parameter: "tag"');} -let path='/functions/{functionId}/tag'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(tag){payload['tag']=tag;} -return http.patch(path,{'content-type':'application/json',},payload);},listTags:function(functionId,search='',limit=25,offset=0,orderType='ASC'){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -let path='/functions/{functionId}/tags'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(search){payload['search']=search;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createExecution:(functionId,data='')=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +let path='/functions/{functionId}/executions'.replace('{functionId}',functionId);let payload={};if(typeof data!=='undefined'){payload['data']=data;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getExecution:(functionId,executionId)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +if(executionId===undefined){throw new AppwriteException('Missing required parameter: "executionId"');} +let path='/functions/{functionId}/executions/{executionId}'.replace('{functionId}',functionId).replace('{executionId}',executionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateTag:(functionId,tag)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +if(tag===undefined){throw new AppwriteException('Missing required parameter: "tag"');} +let path='/functions/{functionId}/tag'.replace('{functionId}',functionId);let payload={};if(typeof tag!=='undefined'){payload['tag']=tag;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),listTags:(functionId,search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +let path='/functions/{functionId}/tags'.replace('{functionId}',functionId);let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},createTag:function(functionId,command,code){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -if(command===undefined){throw new Error('Missing required parameter: "command"');} -if(code===undefined){throw new Error('Missing required parameter: "code"');} -let path='/functions/{functionId}/tags'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(command){payload['command']=command;} -if(code){payload['code']=code;} -return http.post(path,{'content-type':'multipart/form-data',},payload);},getTag:function(functionId,tagId){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -if(tagId===undefined){throw new Error('Missing required parameter: "tagId"');} -let path='/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}','g'),functionId).replace(new RegExp('{tagId}','g'),tagId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},deleteTag:function(functionId,tagId){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -if(tagId===undefined){throw new Error('Missing required parameter: "tagId"');} -let path='/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}','g'),functionId).replace(new RegExp('{tagId}','g'),tagId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getUsage:function(functionId,range='30d'){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -let path='/functions/{functionId}/usage'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(range){payload['range']=range;} -return http.get(path,{'content-type':'application/json',},payload);}};let health={get:function(){let path='/health';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getAntiVirus:function(){let path='/health/anti-virus';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCache:function(){let path='/health/cache';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getDB:function(){let path='/health/db';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueCertificates:function(){let path='/health/queue/certificates';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueFunctions:function(){let path='/health/queue/functions';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueLogs:function(){let path='/health/queue/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueTasks:function(){let path='/health/queue/tasks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueUsage:function(){let path='/health/queue/usage';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueWebhooks:function(){let path='/health/queue/webhooks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getStorageLocal:function(){let path='/health/storage/local';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getTime:function(){let path='/health/time';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getLanguages:function(){let path='/locale/languages';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let projects={list:function(search='',limit=25,offset=0,orderType='ASC'){let path='/projects';let payload={};if(search){payload['search']=search;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createTag:(functionId,command,code)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +if(command===undefined){throw new AppwriteException('Missing required parameter: "command"');} +if(code===undefined){throw new AppwriteException('Missing required parameter: "code"');} +let path='/functions/{functionId}/tags'.replace('{functionId}',functionId);let payload={};if(typeof command!=='undefined'){payload['command']=command;} +if(typeof code!=='undefined'){payload['code']=code;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'multipart/form-data',},payload);}),getTag:(functionId,tagId)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +if(tagId===undefined){throw new AppwriteException('Missing required parameter: "tagId"');} +let path='/functions/{functionId}/tags/{tagId}'.replace('{functionId}',functionId).replace('{tagId}',tagId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),deleteTag:(functionId,tagId)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +if(tagId===undefined){throw new AppwriteException('Missing required parameter: "tagId"');} +let path='/functions/{functionId}/tags/{tagId}'.replace('{functionId}',functionId).replace('{tagId}',tagId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),getUsage:(functionId,range='30d')=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +let path='/functions/{functionId}/usage'.replace('{functionId}',functionId);let payload={};if(range){payload['range']=range;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);})};this.health={get:()=>__awaiter(this,void 0,void 0,function*(){let path='/health';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getAntiVirus:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/anti-virus';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getCache:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/cache';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getDB:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/db';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getQueueCertificates:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/queue/certificates';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getQueueFunctions:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/queue/functions';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getQueueLogs:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/queue/logs';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getQueueTasks:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/queue/tasks';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getQueueUsage:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/queue/usage';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getQueueWebhooks:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/queue/webhooks';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getStorageLocal:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/storage/local';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getTime:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/time';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);})};this.locale={get:()=>__awaiter(this,void 0,void 0,function*(){let path='/locale';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getContinents:()=>__awaiter(this,void 0,void 0,function*(){let path='/locale/continents';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getCountries:()=>__awaiter(this,void 0,void 0,function*(){let path='/locale/countries';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getCountriesEU:()=>__awaiter(this,void 0,void 0,function*(){let path='/locale/countries/eu';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getCountriesPhones:()=>__awaiter(this,void 0,void 0,function*(){let path='/locale/countries/phones';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getCurrencies:()=>__awaiter(this,void 0,void 0,function*(){let path='/locale/currencies';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getLanguages:()=>__awaiter(this,void 0,void 0,function*(){let path='/locale/languages';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);})};this.projects={list:(search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){let path='/projects';let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},create:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -let path='/projects';let payload={};if(name){payload['name']=name;} -if(teamId){payload['teamId']=teamId;} -if(description){payload['description']=description;} -if(logo){payload['logo']=logo;} -if(url){payload['url']=url;} -if(legalName){payload['legalName']=legalName;} -if(legalCountry){payload['legalCountry']=legalCountry;} -if(legalState){payload['legalState']=legalState;} -if(legalCity){payload['legalCity']=legalCity;} -if(legalAddress){payload['legalAddress']=legalAddress;} -if(legalTaxId){payload['legalTaxId']=legalTaxId;} -return http.post(path,{'content-type':'application/json',},payload);},get:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},update:function(projectId,name,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;} -if(description){payload['description']=description;} -if(logo){payload['logo']=logo;} -if(url){payload['url']=url;} -if(legalName){payload['legalName']=legalName;} -if(legalCountry){payload['legalCountry']=legalCountry;} -if(legalState){payload['legalState']=legalState;} -if(legalCity){payload['legalCity']=legalCity;} -if(legalAddress){payload['legalAddress']=legalAddress;} -if(legalTaxId){payload['legalTaxId']=legalTaxId;} -return http.patch(path,{'content-type':'application/json',},payload);},delete:function(projectId,password){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(password===undefined){throw new Error('Missing required parameter: "password"');} -let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(password){payload['password']=password;} -return http.delete(path,{'content-type':'application/json',},payload);},updateAuthLimit:function(projectId,limit){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(limit===undefined){throw new Error('Missing required parameter: "limit"');} -let path='/projects/{projectId}/auth/limit'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(typeof limit!=='undefined'){payload['limit']=limit;} -return http.patch(path,{'content-type':'application/json',},payload);},updateAuthStatus:function(projectId,method,status){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(method===undefined){throw new Error('Missing required parameter: "method"');} -if(status===undefined){throw new Error('Missing required parameter: "status"');} -let path='/projects/{projectId}/auth/{method}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{method}','g'),method);let payload={};if(status){payload['status']=status;} -return http.patch(path,{'content-type':'application/json',},payload);},listDomains:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -let path='/projects/{projectId}/domains'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createDomain:function(projectId,domain){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(domain===undefined){throw new Error('Missing required parameter: "domain"');} -let path='/projects/{projectId}/domains'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(domain){payload['domain']=domain;} -return http.post(path,{'content-type':'application/json',},payload);},getDomain:function(projectId,domainId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(domainId===undefined){throw new Error('Missing required parameter: "domainId"');} -let path='/projects/{projectId}/domains/{domainId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{domainId}','g'),domainId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},deleteDomain:function(projectId,domainId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(domainId===undefined){throw new Error('Missing required parameter: "domainId"');} -let path='/projects/{projectId}/domains/{domainId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{domainId}','g'),domainId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},updateDomainVerification:function(projectId,domainId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(domainId===undefined){throw new Error('Missing required parameter: "domainId"');} -let path='/projects/{projectId}/domains/{domainId}/verification'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{domainId}','g'),domainId);let payload={};return http.patch(path,{'content-type':'application/json',},payload);},listKeys:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createKey:function(projectId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(scopes===undefined){throw new Error('Missing required parameter: "scopes"');} -let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;} -if(scopes){payload['scopes']=scopes;} -return http.post(path,{'content-type':'application/json',},payload);},getKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(keyId===undefined){throw new Error('Missing required parameter: "keyId"');} -let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateKey:function(projectId,keyId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(keyId===undefined){throw new Error('Missing required parameter: "keyId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(scopes===undefined){throw new Error('Missing required parameter: "scopes"');} -let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};if(name){payload['name']=name;} -if(scopes){payload['scopes']=scopes;} -return http.put(path,{'content-type':'application/json',},payload);},deleteKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(keyId===undefined){throw new Error('Missing required parameter: "keyId"');} -let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},updateOAuth2:function(projectId,provider,appId='',secret=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(provider===undefined){throw new Error('Missing required parameter: "provider"');} -let path='/projects/{projectId}/oauth2'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(provider){payload['provider']=provider;} -if(appId){payload['appId']=appId;} -if(secret){payload['secret']=secret;} -return http.patch(path,{'content-type':'application/json',},payload);},listPlatforms:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createPlatform:function(projectId,type,name,key='',store='',hostname=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(type===undefined){throw new Error('Missing required parameter: "type"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(type){payload['type']=type;} -if(name){payload['name']=name;} -if(key){payload['key']=key;} -if(store){payload['store']=store;} -if(hostname){payload['hostname']=hostname;} -return http.post(path,{'content-type':'application/json',},payload);},getPlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(platformId===undefined){throw new Error('Missing required parameter: "platformId"');} -let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updatePlatform:function(projectId,platformId,name,key='',store='',hostname=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(platformId===undefined){throw new Error('Missing required parameter: "platformId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};if(name){payload['name']=name;} -if(key){payload['key']=key;} -if(store){payload['store']=store;} -if(hostname){payload['hostname']=hostname;} -return http.put(path,{'content-type':'application/json',},payload);},deletePlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(platformId===undefined){throw new Error('Missing required parameter: "platformId"');} -let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},listTasks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createTask:function(projectId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(status===undefined){throw new Error('Missing required parameter: "status"');} -if(schedule===undefined){throw new Error('Missing required parameter: "schedule"');} -if(security===undefined){throw new Error('Missing required parameter: "security"');} -if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"');} -if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"');} -let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;} -if(status){payload['status']=status;} -if(schedule){payload['schedule']=schedule;} -if(security){payload['security']=security;} -if(httpMethod){payload['httpMethod']=httpMethod;} -if(httpUrl){payload['httpUrl']=httpUrl;} -if(httpHeaders){payload['httpHeaders']=httpHeaders;} -if(httpUser){payload['httpUser']=httpUser;} -if(httpPass){payload['httpPass']=httpPass;} -return http.post(path,{'content-type':'application/json',},payload);},getTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(taskId===undefined){throw new Error('Missing required parameter: "taskId"');} -let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateTask:function(projectId,taskId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(taskId===undefined){throw new Error('Missing required parameter: "taskId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(status===undefined){throw new Error('Missing required parameter: "status"');} -if(schedule===undefined){throw new Error('Missing required parameter: "schedule"');} -if(security===undefined){throw new Error('Missing required parameter: "security"');} -if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"');} -if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"');} -let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};if(name){payload['name']=name;} -if(status){payload['status']=status;} -if(schedule){payload['schedule']=schedule;} -if(security){payload['security']=security;} -if(httpMethod){payload['httpMethod']=httpMethod;} -if(httpUrl){payload['httpUrl']=httpUrl;} -if(httpHeaders){payload['httpHeaders']=httpHeaders;} -if(httpUser){payload['httpUser']=httpUser;} -if(httpPass){payload['httpPass']=httpPass;} -return http.put(path,{'content-type':'application/json',},payload);},deleteTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(taskId===undefined){throw new Error('Missing required parameter: "taskId"');} -let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getUsage:function(projectId,range='30d'){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(range){payload['range']=range;} -return http.get(path,{'content-type':'application/json',},payload);},listWebhooks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createWebhook:function(projectId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(events===undefined){throw new Error('Missing required parameter: "events"');} -if(url===undefined){throw new Error('Missing required parameter: "url"');} -if(security===undefined){throw new Error('Missing required parameter: "security"');} -let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;} -if(events){payload['events']=events;} -if(url){payload['url']=url;} -if(security){payload['security']=security;} -if(httpUser){payload['httpUser']=httpUser;} -if(httpPass){payload['httpPass']=httpPass;} -return http.post(path,{'content-type':'application/json',},payload);},getWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"');} -let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateWebhook:function(projectId,webhookId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(events===undefined){throw new Error('Missing required parameter: "events"');} -if(url===undefined){throw new Error('Missing required parameter: "url"');} -if(security===undefined){throw new Error('Missing required parameter: "security"');} -let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};if(name){payload['name']=name;} -if(events){payload['events']=events;} -if(url){payload['url']=url;} -if(security){payload['security']=security;} -if(httpUser){payload['httpUser']=httpUser;} -if(httpPass){payload['httpPass']=httpPass;} -return http.put(path,{'content-type':'application/json',},payload);},deleteWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"');} -let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';let payload={};if(search){payload['search']=search;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),create:(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId='')=>__awaiter(this,void 0,void 0,function*(){if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +let path='/projects';let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof teamId!=='undefined'){payload['teamId']=teamId;} +if(typeof description!=='undefined'){payload['description']=description;} +if(typeof logo!=='undefined'){payload['logo']=logo;} +if(typeof url!=='undefined'){payload['url']=url;} +if(typeof legalName!=='undefined'){payload['legalName']=legalName;} +if(typeof legalCountry!=='undefined'){payload['legalCountry']=legalCountry;} +if(typeof legalState!=='undefined'){payload['legalState']=legalState;} +if(typeof legalCity!=='undefined'){payload['legalCity']=legalCity;} +if(typeof legalAddress!=='undefined'){payload['legalAddress']=legalAddress;} +if(typeof legalTaxId!=='undefined'){payload['legalTaxId']=legalTaxId;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),get:(projectId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +let path='/projects/{projectId}'.replace('{projectId}',projectId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),update:(projectId,name,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +let path='/projects/{projectId}'.replace('{projectId}',projectId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof description!=='undefined'){payload['description']=description;} +if(typeof logo!=='undefined'){payload['logo']=logo;} +if(typeof url!=='undefined'){payload['url']=url;} +if(typeof legalName!=='undefined'){payload['legalName']=legalName;} +if(typeof legalCountry!=='undefined'){payload['legalCountry']=legalCountry;} +if(typeof legalState!=='undefined'){payload['legalState']=legalState;} +if(typeof legalCity!=='undefined'){payload['legalCity']=legalCity;} +if(typeof legalAddress!=='undefined'){payload['legalAddress']=legalAddress;} +if(typeof legalTaxId!=='undefined'){payload['legalTaxId']=legalTaxId;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),delete:(projectId,password)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(password===undefined){throw new AppwriteException('Missing required parameter: "password"');} +let path='/projects/{projectId}'.replace('{projectId}',projectId);let payload={};if(typeof password!=='undefined'){payload['password']=password;} +const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),updateAuthLimit:(projectId,limit)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(limit===undefined){throw new AppwriteException('Missing required parameter: "limit"');} +let path='/projects/{projectId}/auth/limit'.replace('{projectId}',projectId);let payload={};if(typeof limit!=='undefined'){payload['limit']=limit;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),updateAuthStatus:(projectId,method,status)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(method===undefined){throw new AppwriteException('Missing required parameter: "method"');} +if(status===undefined){throw new AppwriteException('Missing required parameter: "status"');} +let path='/projects/{projectId}/auth/{method}'.replace('{projectId}',projectId).replace('{method}',method);let payload={};if(typeof status!=='undefined'){payload['status']=status;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),listDomains:(projectId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +let path='/projects/{projectId}/domains'.replace('{projectId}',projectId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createDomain:(projectId,domain)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(domain===undefined){throw new AppwriteException('Missing required parameter: "domain"');} +let path='/projects/{projectId}/domains'.replace('{projectId}',projectId);let payload={};if(typeof domain!=='undefined'){payload['domain']=domain;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getDomain:(projectId,domainId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(domainId===undefined){throw new AppwriteException('Missing required parameter: "domainId"');} +let path='/projects/{projectId}/domains/{domainId}'.replace('{projectId}',projectId).replace('{domainId}',domainId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),deleteDomain:(projectId,domainId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(domainId===undefined){throw new AppwriteException('Missing required parameter: "domainId"');} +let path='/projects/{projectId}/domains/{domainId}'.replace('{projectId}',projectId).replace('{domainId}',domainId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),updateDomainVerification:(projectId,domainId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(domainId===undefined){throw new AppwriteException('Missing required parameter: "domainId"');} +let path='/projects/{projectId}/domains/{domainId}/verification'.replace('{projectId}',projectId).replace('{domainId}',domainId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),listKeys:(projectId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +let path='/projects/{projectId}/keys'.replace('{projectId}',projectId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createKey:(projectId,name,scopes)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(scopes===undefined){throw new AppwriteException('Missing required parameter: "scopes"');} +let path='/projects/{projectId}/keys'.replace('{projectId}',projectId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof scopes!=='undefined'){payload['scopes']=scopes;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getKey:(projectId,keyId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(keyId===undefined){throw new AppwriteException('Missing required parameter: "keyId"');} +let path='/projects/{projectId}/keys/{keyId}'.replace('{projectId}',projectId).replace('{keyId}',keyId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateKey:(projectId,keyId,name,scopes)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(keyId===undefined){throw new AppwriteException('Missing required parameter: "keyId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(scopes===undefined){throw new AppwriteException('Missing required parameter: "scopes"');} +let path='/projects/{projectId}/keys/{keyId}'.replace('{projectId}',projectId).replace('{keyId}',keyId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof scopes!=='undefined'){payload['scopes']=scopes;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),deleteKey:(projectId,keyId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(keyId===undefined){throw new AppwriteException('Missing required parameter: "keyId"');} +let path='/projects/{projectId}/keys/{keyId}'.replace('{projectId}',projectId).replace('{keyId}',keyId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),updateOAuth2:(projectId,provider,appId='',secret='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(provider===undefined){throw new AppwriteException('Missing required parameter: "provider"');} +let path='/projects/{projectId}/oauth2'.replace('{projectId}',projectId);let payload={};if(typeof provider!=='undefined'){payload['provider']=provider;} +if(typeof appId!=='undefined'){payload['appId']=appId;} +if(typeof secret!=='undefined'){payload['secret']=secret;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),listPlatforms:(projectId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +let path='/projects/{projectId}/platforms'.replace('{projectId}',projectId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createPlatform:(projectId,type,name,key='',store='',hostname='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(type===undefined){throw new AppwriteException('Missing required parameter: "type"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +let path='/projects/{projectId}/platforms'.replace('{projectId}',projectId);let payload={};if(typeof type!=='undefined'){payload['type']=type;} +if(typeof name!=='undefined'){payload['name']=name;} +if(typeof key!=='undefined'){payload['key']=key;} +if(typeof store!=='undefined'){payload['store']=store;} +if(typeof hostname!=='undefined'){payload['hostname']=hostname;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getPlatform:(projectId,platformId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(platformId===undefined){throw new AppwriteException('Missing required parameter: "platformId"');} +let path='/projects/{projectId}/platforms/{platformId}'.replace('{projectId}',projectId).replace('{platformId}',platformId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updatePlatform:(projectId,platformId,name,key='',store='',hostname='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(platformId===undefined){throw new AppwriteException('Missing required parameter: "platformId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +let path='/projects/{projectId}/platforms/{platformId}'.replace('{projectId}',projectId).replace('{platformId}',platformId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof key!=='undefined'){payload['key']=key;} +if(typeof store!=='undefined'){payload['store']=store;} +if(typeof hostname!=='undefined'){payload['hostname']=hostname;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),deletePlatform:(projectId,platformId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(platformId===undefined){throw new AppwriteException('Missing required parameter: "platformId"');} +let path='/projects/{projectId}/platforms/{platformId}'.replace('{projectId}',projectId).replace('{platformId}',platformId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),listTasks:(projectId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +let path='/projects/{projectId}/tasks'.replace('{projectId}',projectId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createTask:(projectId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(status===undefined){throw new AppwriteException('Missing required parameter: "status"');} +if(schedule===undefined){throw new AppwriteException('Missing required parameter: "schedule"');} +if(security===undefined){throw new AppwriteException('Missing required parameter: "security"');} +if(httpMethod===undefined){throw new AppwriteException('Missing required parameter: "httpMethod"');} +if(httpUrl===undefined){throw new AppwriteException('Missing required parameter: "httpUrl"');} +let path='/projects/{projectId}/tasks'.replace('{projectId}',projectId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof status!=='undefined'){payload['status']=status;} +if(typeof schedule!=='undefined'){payload['schedule']=schedule;} +if(typeof security!=='undefined'){payload['security']=security;} +if(typeof httpMethod!=='undefined'){payload['httpMethod']=httpMethod;} +if(typeof httpUrl!=='undefined'){payload['httpUrl']=httpUrl;} +if(typeof httpHeaders!=='undefined'){payload['httpHeaders']=httpHeaders;} +if(typeof httpUser!=='undefined'){payload['httpUser']=httpUser;} +if(typeof httpPass!=='undefined'){payload['httpPass']=httpPass;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getTask:(projectId,taskId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(taskId===undefined){throw new AppwriteException('Missing required parameter: "taskId"');} +let path='/projects/{projectId}/tasks/{taskId}'.replace('{projectId}',projectId).replace('{taskId}',taskId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateTask:(projectId,taskId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(taskId===undefined){throw new AppwriteException('Missing required parameter: "taskId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(status===undefined){throw new AppwriteException('Missing required parameter: "status"');} +if(schedule===undefined){throw new AppwriteException('Missing required parameter: "schedule"');} +if(security===undefined){throw new AppwriteException('Missing required parameter: "security"');} +if(httpMethod===undefined){throw new AppwriteException('Missing required parameter: "httpMethod"');} +if(httpUrl===undefined){throw new AppwriteException('Missing required parameter: "httpUrl"');} +let path='/projects/{projectId}/tasks/{taskId}'.replace('{projectId}',projectId).replace('{taskId}',taskId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof status!=='undefined'){payload['status']=status;} +if(typeof schedule!=='undefined'){payload['schedule']=schedule;} +if(typeof security!=='undefined'){payload['security']=security;} +if(typeof httpMethod!=='undefined'){payload['httpMethod']=httpMethod;} +if(typeof httpUrl!=='undefined'){payload['httpUrl']=httpUrl;} +if(typeof httpHeaders!=='undefined'){payload['httpHeaders']=httpHeaders;} +if(typeof httpUser!=='undefined'){payload['httpUser']=httpUser;} +if(typeof httpPass!=='undefined'){payload['httpPass']=httpPass;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),deleteTask:(projectId,taskId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(taskId===undefined){throw new AppwriteException('Missing required parameter: "taskId"');} +let path='/projects/{projectId}/tasks/{taskId}'.replace('{projectId}',projectId).replace('{taskId}',taskId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),getUsage:(projectId,range='30d')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +let path='/projects/{projectId}/usage'.replace('{projectId}',projectId);let payload={};if(range){payload['range']=range;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),listWebhooks:(projectId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +let path='/projects/{projectId}/webhooks'.replace('{projectId}',projectId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createWebhook:(projectId,name,events,url,security,httpUser='',httpPass='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(events===undefined){throw new AppwriteException('Missing required parameter: "events"');} +if(url===undefined){throw new AppwriteException('Missing required parameter: "url"');} +if(security===undefined){throw new AppwriteException('Missing required parameter: "security"');} +let path='/projects/{projectId}/webhooks'.replace('{projectId}',projectId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof events!=='undefined'){payload['events']=events;} +if(typeof url!=='undefined'){payload['url']=url;} +if(typeof security!=='undefined'){payload['security']=security;} +if(typeof httpUser!=='undefined'){payload['httpUser']=httpUser;} +if(typeof httpPass!=='undefined'){payload['httpPass']=httpPass;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getWebhook:(projectId,webhookId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(webhookId===undefined){throw new AppwriteException('Missing required parameter: "webhookId"');} +let path='/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}',projectId).replace('{webhookId}',webhookId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateWebhook:(projectId,webhookId,name,events,url,security,httpUser='',httpPass='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(webhookId===undefined){throw new AppwriteException('Missing required parameter: "webhookId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(events===undefined){throw new AppwriteException('Missing required parameter: "events"');} +if(url===undefined){throw new AppwriteException('Missing required parameter: "url"');} +if(security===undefined){throw new AppwriteException('Missing required parameter: "security"');} +let path='/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}',projectId).replace('{webhookId}',webhookId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof events!=='undefined'){payload['events']=events;} +if(typeof url!=='undefined'){payload['url']=url;} +if(typeof security!=='undefined'){payload['security']=security;} +if(typeof httpUser!=='undefined'){payload['httpUser']=httpUser;} +if(typeof httpPass!=='undefined'){payload['httpPass']=httpPass;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),deleteWebhook:(projectId,webhookId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(webhookId===undefined){throw new AppwriteException('Missing required parameter: "webhookId"');} +let path='/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}',projectId).replace('{webhookId}',webhookId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);})};this.storage={listFiles:(search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){let path='/storage/files';let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},createFile:function(file,read,write){if(file===undefined){throw new Error('Missing required parameter: "file"');} -if(read===undefined){throw new Error('Missing required parameter: "read"');} -if(write===undefined){throw new Error('Missing required parameter: "write"');} -let path='/storage/files';let payload={};if(file){payload['file']=file;} -if(read){payload['read']=read;} -if(write){payload['write']=write;} -return http.post(path,{'content-type':'multipart/form-data',},payload);},getFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');} -let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateFile:function(fileId,read,write){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');} -if(read===undefined){throw new Error('Missing required parameter: "read"');} -if(write===undefined){throw new Error('Missing required parameter: "write"');} -let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(read){payload['read']=read;} -if(write){payload['write']=write;} -return http.put(path,{'content-type':'application/json',},payload);},deleteFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');} -let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getFileDownload:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');} -let path='/storage/files/{fileId}/download'.replace(new RegExp('{fileId}','g'),fileId);let payload={};payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index__awaiter(this,void 0,void 0,function*(){if(file===undefined){throw new AppwriteException('Missing required parameter: "file"');} +let path='/storage/files';let payload={};if(typeof file!=='undefined'){payload['file']=file;} +if(typeof read!=='undefined'){payload['read']=read;} +if(typeof write!=='undefined'){payload['write']=write;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'multipart/form-data',},payload);}),getFile:(fileId)=>__awaiter(this,void 0,void 0,function*(){if(fileId===undefined){throw new AppwriteException('Missing required parameter: "fileId"');} +let path='/storage/files/{fileId}'.replace('{fileId}',fileId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateFile:(fileId,read,write)=>__awaiter(this,void 0,void 0,function*(){if(fileId===undefined){throw new AppwriteException('Missing required parameter: "fileId"');} +if(read===undefined){throw new AppwriteException('Missing required parameter: "read"');} +if(write===undefined){throw new AppwriteException('Missing required parameter: "write"');} +let path='/storage/files/{fileId}'.replace('{fileId}',fileId);let payload={};if(typeof read!=='undefined'){payload['read']=read;} +if(typeof write!=='undefined'){payload['write']=write;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),deleteFile:(fileId)=>__awaiter(this,void 0,void 0,function*(){if(fileId===undefined){throw new AppwriteException('Missing required parameter: "fileId"');} +let path='/storage/files/{fileId}'.replace('{fileId}',fileId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),getFileDownload:(fileId)=>{if(fileId===undefined){throw new AppwriteException('Missing required parameter: "fileId"');} +let path='/storage/files/{fileId}/download'.replace('{fileId}',fileId);let payload={};const uri=new URL(this.config.endpoint+path);payload['project']=this.config.project;for(const[key,value]of Object.entries(this.flatten(payload))){uri.searchParams.append(key,value);} +return uri;},getFilePreview:(fileId,width=0,height=0,quality=100,borderWidth=0,borderColor='',borderRadius=0,opacity=1,rotation=0,background='',output='')=>{if(fileId===undefined){throw new AppwriteException('Missing required parameter: "fileId"');} +let path='/storage/files/{fileId}/preview'.replace('{fileId}',fileId);let payload={};if(width){payload['width']=width;} if(height){payload['height']=height;} if(quality){payload['quality']=quality;} +if(borderWidth){payload['borderWidth']=borderWidth;} +if(borderColor){payload['borderColor']=borderColor;} +if(borderRadius){payload['borderRadius']=borderRadius;} +if(opacity){payload['opacity']=opacity;} +if(rotation){payload['rotation']=rotation;} if(background){payload['background']=background;} if(output){payload['output']=output;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index{if(fileId===undefined){throw new AppwriteException('Missing required parameter: "fileId"');} +let path='/storage/files/{fileId}/view'.replace('{fileId}',fileId);let payload={};const uri=new URL(this.config.endpoint+path);payload['project']=this.config.project;for(const[key,value]of Object.entries(this.flatten(payload))){uri.searchParams.append(key,value);} +return uri;}};this.teams={list:(search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){let path='/teams';let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},create:function(name,roles=["owner"]){if(name===undefined){throw new Error('Missing required parameter: "name"');} -let path='/teams';let payload={};if(name){payload['name']=name;} -if(roles){payload['roles']=roles;} -return http.post(path,{'content-type':'application/json',},payload);},get:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},update:function(teamId,name){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(name){payload['name']=name;} -return http.put(path,{'content-type':'application/json',},payload);},delete:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getMemberships:function(teamId,search='',limit=25,offset=0,orderType='ASC'){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(search){payload['search']=search;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),create:(name,roles=["owner"])=>__awaiter(this,void 0,void 0,function*(){if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +let path='/teams';let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof roles!=='undefined'){payload['roles']=roles;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),get:(teamId)=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +let path='/teams/{teamId}'.replace('{teamId}',teamId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),update:(teamId,name)=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +let path='/teams/{teamId}'.replace('{teamId}',teamId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),delete:(teamId)=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +let path='/teams/{teamId}'.replace('{teamId}',teamId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),getMemberships:(teamId,search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +let path='/teams/{teamId}/memberships'.replace('{teamId}',teamId);let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -if(email===undefined){throw new Error('Missing required parameter: "email"');} -if(roles===undefined){throw new Error('Missing required parameter: "roles"');} -if(url===undefined){throw new Error('Missing required parameter: "url"');} -let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(email){payload['email']=email;} -if(name){payload['name']=name;} -if(roles){payload['roles']=roles;} -if(url){payload['url']=url;} -return http.post(path,{'content-type':'application/json',},payload);},deleteMembership:function(teamId,inviteId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"');} -let path='/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},updateMembershipStatus:function(teamId,inviteId,userId,secret){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"');} -if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -if(secret===undefined){throw new Error('Missing required parameter: "secret"');} -let path='/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};if(userId){payload['userId']=userId;} -if(secret){payload['secret']=secret;} -return http.patch(path,{'content-type':'application/json',},payload);}};let users={list:function(search='',limit=25,offset=0,orderType='ASC'){let path='/users';let payload={};if(search){payload['search']=search;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createMembership:(teamId,email,roles,url,name='')=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +if(email===undefined){throw new AppwriteException('Missing required parameter: "email"');} +if(roles===undefined){throw new AppwriteException('Missing required parameter: "roles"');} +if(url===undefined){throw new AppwriteException('Missing required parameter: "url"');} +let path='/teams/{teamId}/memberships'.replace('{teamId}',teamId);let payload={};if(typeof email!=='undefined'){payload['email']=email;} +if(typeof name!=='undefined'){payload['name']=name;} +if(typeof roles!=='undefined'){payload['roles']=roles;} +if(typeof url!=='undefined'){payload['url']=url;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),updateMembershipRoles:(teamId,membershipId,roles)=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +if(membershipId===undefined){throw new AppwriteException('Missing required parameter: "membershipId"');} +if(roles===undefined){throw new AppwriteException('Missing required parameter: "roles"');} +let path='/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}',teamId).replace('{membershipId}',membershipId);let payload={};if(typeof roles!=='undefined'){payload['roles']=roles;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),deleteMembership:(teamId,membershipId)=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +if(membershipId===undefined){throw new AppwriteException('Missing required parameter: "membershipId"');} +let path='/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}',teamId).replace('{membershipId}',membershipId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),updateMembershipStatus:(teamId,membershipId,userId,secret)=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +if(membershipId===undefined){throw new AppwriteException('Missing required parameter: "membershipId"');} +if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +if(secret===undefined){throw new AppwriteException('Missing required parameter: "secret"');} +let path='/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}',teamId).replace('{membershipId}',membershipId);let payload={};if(typeof userId!=='undefined'){payload['userId']=userId;} +if(typeof secret!=='undefined'){payload['secret']=secret;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);})};this.users={list:(search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){let path='/users';let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},create:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');} -if(password===undefined){throw new Error('Missing required parameter: "password"');} -let path='/users';let payload={};if(email){payload['email']=email;} -if(password){payload['password']=password;} -if(name){payload['name']=name;} -return http.post(path,{'content-type':'application/json',},payload);},get:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},deleteUser:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -let path='/users/{userId}/logs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},getPrefs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updatePrefs:function(userId,prefs){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -if(prefs===undefined){throw new Error('Missing required parameter: "prefs"');} -let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};if(prefs){payload['prefs']=prefs;} -return http.patch(path,{'content-type':'application/json',},payload);},getSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},deleteSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},deleteSession:function(userId,sessionId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"');} -let path='/users/{userId}/sessions/{sessionId}'.replace(new RegExp('{userId}','g'),userId).replace(new RegExp('{sessionId}','g'),sessionId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},updateStatus:function(userId,status){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -if(status===undefined){throw new Error('Missing required parameter: "status"');} -let path='/users/{userId}/status'.replace(new RegExp('{userId}','g'),userId);let payload={};if(status){payload['status']=status;} -return http.patch(path,{'content-type':'application/json',},payload);}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,avatars:avatars,database:database,functions:functions,health:health,locale:locale,projects:projects,storage:storage,teams:teams,users:users};};if(typeof module!=="undefined"){module.exports=window.Appwrite;}})((typeof window!=="undefined")?window:{});(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(function(){try{return require('moment');}catch(e){}}()):typeof define==='function'&&define.amd?define(['require'],function(require){return factory(function(){try{return require('moment');}catch(e){}}());}):(global=global||self,global.Chart=factory(global.moment));}(this,(function(moment){'use strict';moment=moment&&moment.hasOwnProperty('default')?moment['default']:moment;function createCommonjsModule(fn,module){return module={exports:{}},fn(module,module.exports),module.exports;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),create:(email,password,name='')=>__awaiter(this,void 0,void 0,function*(){if(email===undefined){throw new AppwriteException('Missing required parameter: "email"');} +if(password===undefined){throw new AppwriteException('Missing required parameter: "password"');} +let path='/users';let payload={};if(typeof email!=='undefined'){payload['email']=email;} +if(typeof password!=='undefined'){payload['password']=password;} +if(typeof name!=='undefined'){payload['name']=name;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),get:(userId)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +let path='/users/{userId}'.replace('{userId}',userId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),delete:(userId)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +let path='/users/{userId}'.replace('{userId}',userId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),getLogs:(userId)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +let path='/users/{userId}/logs'.replace('{userId}',userId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getPrefs:(userId)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +let path='/users/{userId}/prefs'.replace('{userId}',userId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updatePrefs:(userId,prefs)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +if(prefs===undefined){throw new AppwriteException('Missing required parameter: "prefs"');} +let path='/users/{userId}/prefs'.replace('{userId}',userId);let payload={};if(typeof prefs!=='undefined'){payload['prefs']=prefs;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),getSessions:(userId)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +let path='/users/{userId}/sessions'.replace('{userId}',userId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),deleteSessions:(userId)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +let path='/users/{userId}/sessions'.replace('{userId}',userId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),deleteSession:(userId,sessionId)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +if(sessionId===undefined){throw new AppwriteException('Missing required parameter: "sessionId"');} +let path='/users/{userId}/sessions/{sessionId}'.replace('{userId}',userId).replace('{sessionId}',sessionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),updateStatus:(userId,status)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +if(status===undefined){throw new AppwriteException('Missing required parameter: "status"');} +let path='/users/{userId}/status'.replace('{userId}',userId);let payload={};if(typeof status!=='undefined'){payload['status']=status;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);})};} +setEndpoint(endpoint){this.config.endpoint=endpoint;return this;} +setProject(value){this.headers['X-Appwrite-Project']=value;this.config.project=value;return this;} +setKey(value){this.headers['X-Appwrite-Key']=value;this.config.key=value;return this;} +setJWT(value){this.headers['X-Appwrite-JWT']=value;this.config.jwt=value;return this;} +setLocale(value){this.headers['X-Appwrite-Locale']=value;this.config.locale=value;return this;} +setMode(value){this.headers['X-Appwrite-Mode']=value;this.config.mode=value;return this;} +call(method,url,headers={},params={}){var _a,_b;return __awaiter(this,void 0,void 0,function*(){method=method.toUpperCase();headers=Object.assign(Object.assign({},headers),this.headers);let options={method,headers,credentials:'include'};if(typeof window!=='undefined'&&window.localStorage){headers['X-Fallback-Cookies']=(_a=window.localStorage.getItem('cookieFallback'))!==null&&_a!==void 0?_a:"";} +if(method==='GET'){for(const[key,value]of Object.entries(this.flatten(params))){url.searchParams.append(key,value);}} +else{switch(headers['content-type']){case'application/json':options.body=JSON.stringify(params);break;case'multipart/form-data':let formData=new FormData();for(const key in params){if(Array.isArray(params[key])){formData.append(key+'[]',params[key].join(','));} +else{formData.append(key,params[key]);}} +options.body=formData;delete headers['content-type'];break;}} +try{let data=null;const response=yield crossFetch.fetch(url.toString(),options);if((_b=response.headers.get("content-type"))===null||_b===void 0?void 0:_b.includes("application/json")){data=yield response.json();} +else{data={message:yield response.text()};} +if(400<=response.status){throw new AppwriteException(data===null||data===void 0?void 0:data.message,response.status,data);} +const cookieFallback=response.headers.get('X-Fallback-Cookies');if(typeof window!=='undefined'&&window.localStorage&&cookieFallback){window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.');window.localStorage.setItem('cookieFallback',cookieFallback);} +return data;} +catch(e){throw new AppwriteException(e.message);}});} +flatten(data,prefix=''){let output={};for(const key in data){let value=data[key];let finalKey=prefix?`${prefix}[${key}]`:key;if(Array.isArray(value)){output=Object.assign(output,this.flatten(value,finalKey));} +else{output[finalKey]=value;}} +return output;}} +exports.Appwrite=Appwrite;return exports;}({},null,window));(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(function(){try{return require('moment');}catch(e){}}()):typeof define==='function'&&define.amd?define(['require'],function(require){return factory(function(){try{return require('moment');}catch(e){}}());}):(global=global||self,global.Chart=factory(global.moment));}(this,(function(moment){'use strict';moment=moment&&moment.hasOwnProperty('default')?moment['default']:moment;function createCommonjsModule(fn,module){return module={exports:{}},fn(module,module.exports),module.exports;} function getCjsExportFromNamespace(n){return n&&n['default']||n;} var colorName={"aliceblue":[240,248,255],"antiquewhite":[250,235,215],"aqua":[0,255,255],"aquamarine":[127,255,212],"azure":[240,255,255],"beige":[245,245,220],"bisque":[255,228,196],"black":[0,0,0],"blanchedalmond":[255,235,205],"blue":[0,0,255],"blueviolet":[138,43,226],"brown":[165,42,42],"burlywood":[222,184,135],"cadetblue":[95,158,160],"chartreuse":[127,255,0],"chocolate":[210,105,30],"coral":[255,127,80],"cornflowerblue":[100,149,237],"cornsilk":[255,248,220],"crimson":[220,20,60],"cyan":[0,255,255],"darkblue":[0,0,139],"darkcyan":[0,139,139],"darkgoldenrod":[184,134,11],"darkgray":[169,169,169],"darkgreen":[0,100,0],"darkgrey":[169,169,169],"darkkhaki":[189,183,107],"darkmagenta":[139,0,139],"darkolivegreen":[85,107,47],"darkorange":[255,140,0],"darkorchid":[153,50,204],"darkred":[139,0,0],"darksalmon":[233,150,122],"darkseagreen":[143,188,143],"darkslateblue":[72,61,139],"darkslategray":[47,79,79],"darkslategrey":[47,79,79],"darkturquoise":[0,206,209],"darkviolet":[148,0,211],"deeppink":[255,20,147],"deepskyblue":[0,191,255],"dimgray":[105,105,105],"dimgrey":[105,105,105],"dodgerblue":[30,144,255],"firebrick":[178,34,34],"floralwhite":[255,250,240],"forestgreen":[34,139,34],"fuchsia":[255,0,255],"gainsboro":[220,220,220],"ghostwhite":[248,248,255],"gold":[255,215,0],"goldenrod":[218,165,32],"gray":[128,128,128],"green":[0,128,0],"greenyellow":[173,255,47],"grey":[128,128,128],"honeydew":[240,255,240],"hotpink":[255,105,180],"indianred":[205,92,92],"indigo":[75,0,130],"ivory":[255,255,240],"khaki":[240,230,140],"lavender":[230,230,250],"lavenderblush":[255,240,245],"lawngreen":[124,252,0],"lemonchiffon":[255,250,205],"lightblue":[173,216,230],"lightcoral":[240,128,128],"lightcyan":[224,255,255],"lightgoldenrodyellow":[250,250,210],"lightgray":[211,211,211],"lightgreen":[144,238,144],"lightgrey":[211,211,211],"lightpink":[255,182,193],"lightsalmon":[255,160,122],"lightseagreen":[32,178,170],"lightskyblue":[135,206,250],"lightslategray":[119,136,153],"lightslategrey":[119,136,153],"lightsteelblue":[176,196,222],"lightyellow":[255,255,224],"lime":[0,255,0],"limegreen":[50,205,50],"linen":[250,240,230],"magenta":[255,0,255],"maroon":[128,0,0],"mediumaquamarine":[102,205,170],"mediumblue":[0,0,205],"mediumorchid":[186,85,211],"mediumpurple":[147,112,219],"mediumseagreen":[60,179,113],"mediumslateblue":[123,104,238],"mediumspringgreen":[0,250,154],"mediumturquoise":[72,209,204],"mediumvioletred":[199,21,133],"midnightblue":[25,25,112],"mintcream":[245,255,250],"mistyrose":[255,228,225],"moccasin":[255,228,181],"navajowhite":[255,222,173],"navy":[0,0,128],"oldlace":[253,245,230],"olive":[128,128,0],"olivedrab":[107,142,35],"orange":[255,165,0],"orangered":[255,69,0],"orchid":[218,112,214],"palegoldenrod":[238,232,170],"palegreen":[152,251,152],"paleturquoise":[175,238,238],"palevioletred":[219,112,147],"papayawhip":[255,239,213],"peachpuff":[255,218,185],"peru":[205,133,63],"pink":[255,192,203],"plum":[221,160,221],"powderblue":[176,224,230],"purple":[128,0,128],"rebeccapurple":[102,51,153],"red":[255,0,0],"rosybrown":[188,143,143],"royalblue":[65,105,225],"saddlebrown":[139,69,19],"salmon":[250,128,114],"sandybrown":[244,164,96],"seagreen":[46,139,87],"seashell":[255,245,238],"sienna":[160,82,45],"silver":[192,192,192],"skyblue":[135,206,235],"slateblue":[106,90,205],"slategray":[112,128,144],"slategrey":[112,128,144],"snow":[255,250,250],"springgreen":[0,255,127],"steelblue":[70,130,180],"tan":[210,180,140],"teal":[0,128,128],"thistle":[216,191,216],"tomato":[255,99,71],"turquoise":[64,224,208],"violet":[238,130,238],"wheat":[245,222,179],"white":[255,255,255],"whitesmoke":[245,245,245],"yellow":[255,255,0],"yellowgreen":[154,205,50]};var conversions=createCommonjsModule(function(module){var reverseKeywords={};for(var key in colorName){if(colorName.hasOwnProperty(key)){reverseKeywords[colorName[key]]=key;}} var convert=module.exports={rgb:{channels:3,labels:'rgb'},hsl:{channels:3,labels:'hsl'},hsv:{channels:3,labels:'hsv'},hwb:{channels:3,labels:'hwb'},cmyk:{channels:4,labels:'cmyk'},xyz:{channels:3,labels:'xyz'},lab:{channels:3,labels:'lab'},lch:{channels:3,labels:'lch'},hex:{channels:1,labels:['hex']},keyword:{channels:1,labels:['keyword']},ansi16:{channels:1,labels:['ansi16']},ansi256:{channels:1,labels:['ansi256']},hcg:{channels:3,labels:['h','c','g']},apple:{channels:3,labels:['r16','g16','b16']},gray:{channels:1,labels:['gray']}};for(var model in convert){if(convert.hasOwnProperty(model)){if(!('channels'in convert[model])){throw new Error('missing channels property: '+model);} @@ -2115,7 +2113,7 @@ params=formData;break;} return new Promise(function(resolve,reject){let request=new XMLHttpRequest(),key;request.withCredentials=true;request.open(method,path,true);for(key in headers){if(headers.hasOwnProperty(key)){request.setRequestHeader(key,headers[key]);}} request.onload=function(){if(4===request.readyState&&399>=request.status){let data=request.response;let contentType=this.getResponseHeader('content-type');contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case'application/json':data=JSON.parse(data);break;} resolve(data);}else{reject(new Error(request.statusText));}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,false);} -request.onerror=function(){reject(new Error("Network Error"));};request.send(params);})};return{'get':function(path,headers={},params={}){return call('GET',path+((params.length>0)?'?'+buildQuery(params):''),headers,{});},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress);},'put':function(path,headers={},params={},progress=null){return call('PUT',headers,params,progress);},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress);},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress);},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let analytics={create:function(id,source,activity,url){return http.post('/analytics',{'content-type':'application/json'},{id:id,source:source,activity:activity,url:url,version:env.VERSION,setup:env.SETUP});},};return{analytics:analytics,};},true);})(window);(function(window){"use strict";window.ls.container.set('console',function(window){var sdk=new window.Appwrite();sdk.setEndpoint(APP_ENV.API).setProject('console').setLocale(APP_ENV.LOCALE);return sdk;},true);})(window);(function(window){"use strict";window.ls.container.set('date',function(){function format(format,timestamp){var jsdate,f +request.onerror=function(){reject(new Error("Network Error"));};request.send(params);})};return{'get':function(path,headers={},params={}){return call('GET',path+((params.length>0)?'?'+buildQuery(params):''),headers,{});},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress);},'put':function(path,headers={},params={},progress=null){return call('PUT',headers,params,progress);},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress);},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress);},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let analytics={create:function(id,source,activity,url){return http.post('/analytics',{'content-type':'application/json'},{id:id,source:source,activity:activity,url:url,version:env.VERSION,setup:env.SETUP});},};return{analytics:analytics,};},true);})(window);(function(window){"use strict";window.ls.container.set('console',function(window){var sdk=new window.Appwrite.Appwrite();sdk.setEndpoint(APP_ENV.ENDPOINT+APP_ENV.API).setProject('console').setLocale(APP_ENV.LOCALE);return sdk;},true);})(window);(function(window){"use strict";window.ls.container.set('date',function(){function format(format,timestamp){var jsdate,f var txtWords=['Sun','Mon','Tues','Wednes','Thurs','Fri','Satur','January','February','March','April','May','June','July','August','September','October','November','December'] var formatChr=/\\?(.?)/gi var formatChrCb=function(t,s){return f[t]?f[t]():s} @@ -2244,7 +2242,7 @@ return slf.renderToken(tokens,idx,opts);} md.renderer.rules.strong_open=renderEm;md.renderer.rules.strong_close=renderEm;return md;},true);})(window);(function(window){"use strict";window.ls.container.set('rtl',function(){var rtlStock="^ا^ب^ت^ث^ج^ح^خ^د^ذ^ر^ز^س^ش^ص^ض^ط^ظ^ع^غ^ف^ق^ك^ل^م^ن^ه^و^ي^א^ב^ג^ד^ה^ו^ז^ח^ט^י^כ^ך^ל^מ^ם^נ^ן^ס^ע^פ^ף^צ^ץ^ק^ר^ש^ת^";var special=["\n"," "," ","״",'"',"_","'","!","@","#","$","^","&","%","*","(",")","+","=","-","[","]","\\","/","{","}","|",":","<",">","?",",",".","0","1","2","3","4","5","6","7","8","9"];var isRTL=function(value){for(var i=0;i=request.status){resolve(data);}else{reject(data);}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,false);} -request.onerror=function(){reject(new Error("Network Error"));};request.send(params);})};return{'get':function(path,headers={},params={}){return call('GET',path+((Object.keys(params).length>0)?'?'+buildQuery(params):''),headers,{});},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress);},'put':function(path,headers={},params={},progress=null){return call('PUT',path,headers,params,progress);},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress);},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress);},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let account={get:function(){let path='/account';let payload={};return http.get(path,{'content-type':'application/json',},payload);},create:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');} -if(password===undefined){throw new Error('Missing required parameter: "password"');} -let path='/account';let payload={};if(email){payload['email']=email;} -if(password){payload['password']=password;} -if(name){payload['name']=name;} -return http.post(path,{'content-type':'application/json',},payload);},delete:function(){let path='/account';let payload={};return http.delete(path,{'content-type':'application/json',},payload);},updateEmail:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"');} -if(password===undefined){throw new Error('Missing required parameter: "password"');} -let path='/account/email';let payload={};if(email){payload['email']=email;} -if(password){payload['password']=password;} -return http.patch(path,{'content-type':'application/json',},payload);},getLogs:function(){let path='/account/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateName:function(name){if(name===undefined){throw new Error('Missing required parameter: "name"');} -let path='/account/name';let payload={};if(name){payload['name']=name;} -return http.patch(path,{'content-type':'application/json',},payload);},updatePassword:function(password,oldPassword){if(password===undefined){throw new Error('Missing required parameter: "password"');} -if(oldPassword===undefined){throw new Error('Missing required parameter: "oldPassword"');} -let path='/account/password';let payload={};if(password){payload['password']=password;} -if(oldPassword){payload['oldPassword']=oldPassword;} -return http.patch(path,{'content-type':'application/json',},payload);},getPrefs:function(){let path='/account/prefs';let payload={};return http.get(path,{'content-type':'application/json',},payload);},updatePrefs:function(prefs){if(prefs===undefined){throw new Error('Missing required parameter: "prefs"');} -let path='/account/prefs';let payload={};if(prefs){payload['prefs']=prefs;} -return http.patch(path,{'content-type':'application/json',},payload);},createRecovery:function(email,url){if(email===undefined){throw new Error('Missing required parameter: "email"');} -if(url===undefined){throw new Error('Missing required parameter: "url"');} -let path='/account/recovery';let payload={};if(email){payload['email']=email;} -if(url){payload['url']=url;} -return http.post(path,{'content-type':'application/json',},payload);},updateRecovery:function(userId,secret,password,passwordAgain){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -if(secret===undefined){throw new Error('Missing required parameter: "secret"');} -if(password===undefined){throw new Error('Missing required parameter: "password"');} -if(passwordAgain===undefined){throw new Error('Missing required parameter: "passwordAgain"');} -let path='/account/recovery';let payload={};if(userId){payload['userId']=userId;} -if(secret){payload['secret']=secret;} -if(password){payload['password']=password;} -if(passwordAgain){payload['passwordAgain']=passwordAgain;} -return http.put(path,{'content-type':'application/json',},payload);},getSessions:function(){let path='/account/sessions';let payload={};return http.get(path,{'content-type':'application/json',},payload);},createSession:function(email,password){if(email===undefined){throw new Error('Missing required parameter: "email"');} -if(password===undefined){throw new Error('Missing required parameter: "password"');} -let path='/account/sessions';let payload={};if(email){payload['email']=email;} -if(password){payload['password']=password;} -return http.post(path,{'content-type':'application/json',},payload);},deleteSessions:function(){let path='/account/sessions';let payload={};return http.delete(path,{'content-type':'application/json',},payload);},createOAuth2Session:function(provider,success='https://appwrite.io/auth/oauth2/success',failure='https://appwrite.io/auth/oauth2/failure',scopes=[]){if(provider===undefined){throw new Error('Missing required parameter: "provider"');} -let path='/account/sessions/oauth2/{provider}'.replace(new RegExp('{provider}','g'),provider);let payload={};if(success){payload['success']=success;} +var Appwrite=(function(exports,isomorphicFormData,crossFetch){'use strict';function __awaiter(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value);});} +return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value));}catch(e){reject(e);}} +function rejected(value){try{step(generator["throw"](value));}catch(e){reject(e);}} +function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected);} +step((generator=generator.apply(thisArg,_arguments||[])).next());});} +class AppwriteException extends Error{constructor(message,code=0,response=''){super(message);this.name='AppwriteException';this.message=message;this.code=code;this.response=response;}} +class Appwrite{constructor(){this.config={endpoint:'https://appwrite.io/v1',project:'',key:'',jwt:'',locale:'',mode:'',};this.headers={'x-sdk-version':'appwrite:web:2.0.0','X-Appwrite-Response-Format':'0.8.0',};this.account={get:()=>__awaiter(this,void 0,void 0,function*(){let path='/account';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),create:(email,password,name='')=>__awaiter(this,void 0,void 0,function*(){if(email===undefined){throw new AppwriteException('Missing required parameter: "email"');} +if(password===undefined){throw new AppwriteException('Missing required parameter: "password"');} +let path='/account';let payload={};if(typeof email!=='undefined'){payload['email']=email;} +if(typeof password!=='undefined'){payload['password']=password;} +if(typeof name!=='undefined'){payload['name']=name;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),delete:()=>__awaiter(this,void 0,void 0,function*(){let path='/account';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),updateEmail:(email,password)=>__awaiter(this,void 0,void 0,function*(){if(email===undefined){throw new AppwriteException('Missing required parameter: "email"');} +if(password===undefined){throw new AppwriteException('Missing required parameter: "password"');} +let path='/account/email';let payload={};if(typeof email!=='undefined'){payload['email']=email;} +if(typeof password!=='undefined'){payload['password']=password;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),createJWT:()=>__awaiter(this,void 0,void 0,function*(){let path='/account/jwt';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getLogs:()=>__awaiter(this,void 0,void 0,function*(){let path='/account/logs';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateName:(name)=>__awaiter(this,void 0,void 0,function*(){if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +let path='/account/name';let payload={};if(typeof name!=='undefined'){payload['name']=name;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),updatePassword:(password,oldPassword='')=>__awaiter(this,void 0,void 0,function*(){if(password===undefined){throw new AppwriteException('Missing required parameter: "password"');} +let path='/account/password';let payload={};if(typeof password!=='undefined'){payload['password']=password;} +if(typeof oldPassword!=='undefined'){payload['oldPassword']=oldPassword;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),getPrefs:()=>__awaiter(this,void 0,void 0,function*(){let path='/account/prefs';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updatePrefs:(prefs)=>__awaiter(this,void 0,void 0,function*(){if(prefs===undefined){throw new AppwriteException('Missing required parameter: "prefs"');} +let path='/account/prefs';let payload={};if(typeof prefs!=='undefined'){payload['prefs']=prefs;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),createRecovery:(email,url)=>__awaiter(this,void 0,void 0,function*(){if(email===undefined){throw new AppwriteException('Missing required parameter: "email"');} +if(url===undefined){throw new AppwriteException('Missing required parameter: "url"');} +let path='/account/recovery';let payload={};if(typeof email!=='undefined'){payload['email']=email;} +if(typeof url!=='undefined'){payload['url']=url;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),updateRecovery:(userId,secret,password,passwordAgain)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +if(secret===undefined){throw new AppwriteException('Missing required parameter: "secret"');} +if(password===undefined){throw new AppwriteException('Missing required parameter: "password"');} +if(passwordAgain===undefined){throw new AppwriteException('Missing required parameter: "passwordAgain"');} +let path='/account/recovery';let payload={};if(typeof userId!=='undefined'){payload['userId']=userId;} +if(typeof secret!=='undefined'){payload['secret']=secret;} +if(typeof password!=='undefined'){payload['password']=password;} +if(typeof passwordAgain!=='undefined'){payload['passwordAgain']=passwordAgain;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),getSessions:()=>__awaiter(this,void 0,void 0,function*(){let path='/account/sessions';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createSession:(email,password)=>__awaiter(this,void 0,void 0,function*(){if(email===undefined){throw new AppwriteException('Missing required parameter: "email"');} +if(password===undefined){throw new AppwriteException('Missing required parameter: "password"');} +let path='/account/sessions';let payload={};if(typeof email!=='undefined'){payload['email']=email;} +if(typeof password!=='undefined'){payload['password']=password;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),deleteSessions:()=>__awaiter(this,void 0,void 0,function*(){let path='/account/sessions';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),createAnonymousSession:()=>__awaiter(this,void 0,void 0,function*(){let path='/account/sessions/anonymous';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),createOAuth2Session:(provider,success='https://appwrite.io/auth/oauth2/success',failure='https://appwrite.io/auth/oauth2/failure',scopes=[])=>{if(provider===undefined){throw new AppwriteException('Missing required parameter: "provider"');} +let path='/account/sessions/oauth2/{provider}'.replace('{provider}',provider);let payload={};if(success){payload['success']=success;} if(failure){payload['failure']=failure;} if(scopes){payload['scopes']=scopes;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index__awaiter(this,void 0,void 0,function*(){if(sessionId===undefined){throw new AppwriteException('Missing required parameter: "sessionId"');} +let path='/account/sessions/{sessionId}'.replace('{sessionId}',sessionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),createVerification:(url)=>__awaiter(this,void 0,void 0,function*(){if(url===undefined){throw new AppwriteException('Missing required parameter: "url"');} +let path='/account/verification';let payload={};if(typeof url!=='undefined'){payload['url']=url;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),updateVerification:(userId,secret)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +if(secret===undefined){throw new AppwriteException('Missing required parameter: "secret"');} +let path='/account/verification';let payload={};if(typeof userId!=='undefined'){payload['userId']=userId;} +if(typeof secret!=='undefined'){payload['secret']=secret;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);})};this.avatars={getBrowser:(code,width=100,height=100,quality=100)=>{if(code===undefined){throw new AppwriteException('Missing required parameter: "code"');} +let path='/avatars/browsers/{code}'.replace('{code}',code);let payload={};if(width){payload['width']=width;} if(height){payload['height']=height;} if(quality){payload['quality']=quality;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index{if(code===undefined){throw new AppwriteException('Missing required parameter: "code"');} +let path='/avatars/credit-cards/{code}'.replace('{code}',code);let payload={};if(width){payload['width']=width;} if(height){payload['height']=height;} if(quality){payload['quality']=quality;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index{if(url===undefined){throw new AppwriteException('Missing required parameter: "url"');} let path='/avatars/favicon';let payload={};if(url){payload['url']=url;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index{if(code===undefined){throw new AppwriteException('Missing required parameter: "code"');} +let path='/avatars/flags/{code}'.replace('{code}',code);let payload={};if(width){payload['width']=width;} if(height){payload['height']=height;} if(quality){payload['quality']=quality;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index{if(url===undefined){throw new AppwriteException('Missing required parameter: "url"');} let path='/avatars/image';let payload={};if(url){payload['url']=url;} if(width){payload['width']=width;} if(height){payload['height']=height;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index{let path='/avatars/initials';let payload={};if(name){payload['name']=name;} if(width){payload['width']=width;} if(height){payload['height']=height;} if(color){payload['color']=color;} if(background){payload['background']=background;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index{if(text===undefined){throw new AppwriteException('Missing required parameter: "text"');} let path='/avatars/qr';let payload={};if(text){payload['text']=text;} if(size){payload['size']=size;} if(margin){payload['margin']=margin;} if(download){payload['download']=download;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index__awaiter(this,void 0,void 0,function*(){let path='/database/collections';let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},createCollection:function(name,read,write,rules){if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(read===undefined){throw new Error('Missing required parameter: "read"');} -if(write===undefined){throw new Error('Missing required parameter: "write"');} -if(rules===undefined){throw new Error('Missing required parameter: "rules"');} -let path='/database/collections';let payload={};if(name){payload['name']=name;} -if(read){payload['read']=read;} -if(write){payload['write']=write;} -if(rules){payload['rules']=rules;} -return http.post(path,{'content-type':'application/json',},payload);},getCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -let path='/database/collections/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateCollection:function(collectionId,name,read,write,rules=[]){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(read===undefined){throw new Error('Missing required parameter: "read"');} -if(write===undefined){throw new Error('Missing required parameter: "write"');} -let path='/database/collections/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(name){payload['name']=name;} -if(read){payload['read']=read;} -if(write){payload['write']=write;} -if(rules){payload['rules']=rules;} -return http.put(path,{'content-type':'application/json',},payload);},deleteCollection:function(collectionId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -let path='/database/collections/{collectionId}'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},listDocuments:function(collectionId,filters=[],limit=25,offset=0,orderField='',orderType='ASC',orderCast='string',search=''){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -let path='/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(filters){payload['filters']=filters;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createCollection:(name,read,write,rules)=>__awaiter(this,void 0,void 0,function*(){if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(read===undefined){throw new AppwriteException('Missing required parameter: "read"');} +if(write===undefined){throw new AppwriteException('Missing required parameter: "write"');} +if(rules===undefined){throw new AppwriteException('Missing required parameter: "rules"');} +let path='/database/collections';let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof read!=='undefined'){payload['read']=read;} +if(typeof write!=='undefined'){payload['write']=write;} +if(typeof rules!=='undefined'){payload['rules']=rules;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getCollection:(collectionId)=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +let path='/database/collections/{collectionId}'.replace('{collectionId}',collectionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateCollection:(collectionId,name,read=[],write=[],rules=[])=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +let path='/database/collections/{collectionId}'.replace('{collectionId}',collectionId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof read!=='undefined'){payload['read']=read;} +if(typeof write!=='undefined'){payload['write']=write;} +if(typeof rules!=='undefined'){payload['rules']=rules;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),deleteCollection:(collectionId)=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +let path='/database/collections/{collectionId}'.replace('{collectionId}',collectionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),listDocuments:(collectionId,filters=[],limit=25,offset=0,orderField='',orderType='ASC',orderCast='string',search='')=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +let path='/database/collections/{collectionId}/documents'.replace('{collectionId}',collectionId);let payload={};if(filters){payload['filters']=filters;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderField){payload['orderField']=orderField;} if(orderType){payload['orderType']=orderType;} if(orderCast){payload['orderCast']=orderCast;} if(search){payload['search']=search;} -return http.get(path,{'content-type':'application/json',},payload);},createDocument:function(collectionId,data,read,write,parentDocument='',parentProperty='',parentPropertyType='assign'){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -if(data===undefined){throw new Error('Missing required parameter: "data"');} -if(read===undefined){throw new Error('Missing required parameter: "read"');} -if(write===undefined){throw new Error('Missing required parameter: "write"');} -let path='/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}','g'),collectionId);let payload={};if(data){payload['data']=data;} -if(read){payload['read']=read;} -if(write){payload['write']=write;} -if(parentDocument){payload['parentDocument']=parentDocument;} -if(parentProperty){payload['parentProperty']=parentProperty;} -if(parentPropertyType){payload['parentPropertyType']=parentPropertyType;} -return http.post(path,{'content-type':'application/json',},payload);},getDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -if(documentId===undefined){throw new Error('Missing required parameter: "documentId"');} -let path='/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateDocument:function(collectionId,documentId,data,read,write){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -if(documentId===undefined){throw new Error('Missing required parameter: "documentId"');} -if(data===undefined){throw new Error('Missing required parameter: "data"');} -if(read===undefined){throw new Error('Missing required parameter: "read"');} -if(write===undefined){throw new Error('Missing required parameter: "write"');} -let path='/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};if(data){payload['data']=data;} -if(read){payload['read']=read;} -if(write){payload['write']=write;} -return http.patch(path,{'content-type':'application/json',},payload);},deleteDocument:function(collectionId,documentId){if(collectionId===undefined){throw new Error('Missing required parameter: "collectionId"');} -if(documentId===undefined){throw new Error('Missing required parameter: "documentId"');} -let path='/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}','g'),collectionId).replace(new RegExp('{documentId}','g'),documentId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);}};let functions={list:function(search='',limit=25,offset=0,orderType='ASC'){let path='/functions';let payload={};if(search){payload['search']=search;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createDocument:(collectionId,data,read=[],write=[],parentDocument='',parentProperty='',parentPropertyType='assign')=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +if(data===undefined){throw new AppwriteException('Missing required parameter: "data"');} +let path='/database/collections/{collectionId}/documents'.replace('{collectionId}',collectionId);let payload={};if(typeof data!=='undefined'){payload['data']=data;} +if(typeof read!=='undefined'){payload['read']=read;} +if(typeof write!=='undefined'){payload['write']=write;} +if(typeof parentDocument!=='undefined'){payload['parentDocument']=parentDocument;} +if(typeof parentProperty!=='undefined'){payload['parentProperty']=parentProperty;} +if(typeof parentPropertyType!=='undefined'){payload['parentPropertyType']=parentPropertyType;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getDocument:(collectionId,documentId)=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +if(documentId===undefined){throw new AppwriteException('Missing required parameter: "documentId"');} +let path='/database/collections/{collectionId}/documents/{documentId}'.replace('{collectionId}',collectionId).replace('{documentId}',documentId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateDocument:(collectionId,documentId,data,read=[],write=[])=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +if(documentId===undefined){throw new AppwriteException('Missing required parameter: "documentId"');} +if(data===undefined){throw new AppwriteException('Missing required parameter: "data"');} +let path='/database/collections/{collectionId}/documents/{documentId}'.replace('{collectionId}',collectionId).replace('{documentId}',documentId);let payload={};if(typeof data!=='undefined'){payload['data']=data;} +if(typeof read!=='undefined'){payload['read']=read;} +if(typeof write!=='undefined'){payload['write']=write;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),deleteDocument:(collectionId,documentId)=>__awaiter(this,void 0,void 0,function*(){if(collectionId===undefined){throw new AppwriteException('Missing required parameter: "collectionId"');} +if(documentId===undefined){throw new AppwriteException('Missing required parameter: "documentId"');} +let path='/database/collections/{collectionId}/documents/{documentId}'.replace('{collectionId}',collectionId).replace('{documentId}',documentId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);})};this.functions={list:(search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){let path='/functions';let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},create:function(name,execute,env,vars={},events=[],schedule='',timeout=15){if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(execute===undefined){throw new Error('Missing required parameter: "execute"');} -if(env===undefined){throw new Error('Missing required parameter: "env"');} -let path='/functions';let payload={};if(name){payload['name']=name;} -if(execute){payload['execute']=execute;} -if(env){payload['env']=env;} -if(vars){payload['vars']=vars;} -if(events){payload['events']=events;} -if(schedule){payload['schedule']=schedule;} -if(timeout){payload['timeout']=timeout;} -return http.post(path,{'content-type':'application/json',},payload);},get:function(functionId){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -let path='/functions/{functionId}'.replace(new RegExp('{functionId}','g'),functionId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},update:function(functionId,name,execute,vars={},events=[],schedule='',timeout=15){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(execute===undefined){throw new Error('Missing required parameter: "execute"');} -let path='/functions/{functionId}'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(name){payload['name']=name;} -if(execute){payload['execute']=execute;} -if(vars){payload['vars']=vars;} -if(events){payload['events']=events;} -if(schedule){payload['schedule']=schedule;} -if(timeout){payload['timeout']=timeout;} -return http.put(path,{'content-type':'application/json',},payload);},delete:function(functionId){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -let path='/functions/{functionId}'.replace(new RegExp('{functionId}','g'),functionId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},listExecutions:function(functionId,search='',limit=25,offset=0,orderType='ASC'){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -let path='/functions/{functionId}/executions'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(search){payload['search']=search;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),create:(name,execute,env,vars={},events=[],schedule='',timeout=15)=>__awaiter(this,void 0,void 0,function*(){if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(execute===undefined){throw new AppwriteException('Missing required parameter: "execute"');} +if(env===undefined){throw new AppwriteException('Missing required parameter: "env"');} +let path='/functions';let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof execute!=='undefined'){payload['execute']=execute;} +if(typeof env!=='undefined'){payload['env']=env;} +if(typeof vars!=='undefined'){payload['vars']=vars;} +if(typeof events!=='undefined'){payload['events']=events;} +if(typeof schedule!=='undefined'){payload['schedule']=schedule;} +if(typeof timeout!=='undefined'){payload['timeout']=timeout;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),get:(functionId)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +let path='/functions/{functionId}'.replace('{functionId}',functionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),update:(functionId,name,execute,vars={},events=[],schedule='',timeout=15)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(execute===undefined){throw new AppwriteException('Missing required parameter: "execute"');} +let path='/functions/{functionId}'.replace('{functionId}',functionId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof execute!=='undefined'){payload['execute']=execute;} +if(typeof vars!=='undefined'){payload['vars']=vars;} +if(typeof events!=='undefined'){payload['events']=events;} +if(typeof schedule!=='undefined'){payload['schedule']=schedule;} +if(typeof timeout!=='undefined'){payload['timeout']=timeout;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),delete:(functionId)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +let path='/functions/{functionId}'.replace('{functionId}',functionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),listExecutions:(functionId,search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +let path='/functions/{functionId}/executions'.replace('{functionId}',functionId);let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},createExecution:function(functionId,data){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -let path='/functions/{functionId}/executions'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(data){payload['data']=data;} -return http.post(path,{'content-type':'application/json',},payload);},getExecution:function(functionId,executionId){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -if(executionId===undefined){throw new Error('Missing required parameter: "executionId"');} -let path='/functions/{functionId}/executions/{executionId}'.replace(new RegExp('{functionId}','g'),functionId).replace(new RegExp('{executionId}','g'),executionId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateTag:function(functionId,tag){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -if(tag===undefined){throw new Error('Missing required parameter: "tag"');} -let path='/functions/{functionId}/tag'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(tag){payload['tag']=tag;} -return http.patch(path,{'content-type':'application/json',},payload);},listTags:function(functionId,search='',limit=25,offset=0,orderType='ASC'){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -let path='/functions/{functionId}/tags'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(search){payload['search']=search;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createExecution:(functionId,data='')=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +let path='/functions/{functionId}/executions'.replace('{functionId}',functionId);let payload={};if(typeof data!=='undefined'){payload['data']=data;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getExecution:(functionId,executionId)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +if(executionId===undefined){throw new AppwriteException('Missing required parameter: "executionId"');} +let path='/functions/{functionId}/executions/{executionId}'.replace('{functionId}',functionId).replace('{executionId}',executionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateTag:(functionId,tag)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +if(tag===undefined){throw new AppwriteException('Missing required parameter: "tag"');} +let path='/functions/{functionId}/tag'.replace('{functionId}',functionId);let payload={};if(typeof tag!=='undefined'){payload['tag']=tag;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),listTags:(functionId,search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +let path='/functions/{functionId}/tags'.replace('{functionId}',functionId);let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},createTag:function(functionId,command,code){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -if(command===undefined){throw new Error('Missing required parameter: "command"');} -if(code===undefined){throw new Error('Missing required parameter: "code"');} -let path='/functions/{functionId}/tags'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(command){payload['command']=command;} -if(code){payload['code']=code;} -return http.post(path,{'content-type':'multipart/form-data',},payload);},getTag:function(functionId,tagId){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -if(tagId===undefined){throw new Error('Missing required parameter: "tagId"');} -let path='/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}','g'),functionId).replace(new RegExp('{tagId}','g'),tagId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},deleteTag:function(functionId,tagId){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -if(tagId===undefined){throw new Error('Missing required parameter: "tagId"');} -let path='/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}','g'),functionId).replace(new RegExp('{tagId}','g'),tagId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getUsage:function(functionId,range='30d'){if(functionId===undefined){throw new Error('Missing required parameter: "functionId"');} -let path='/functions/{functionId}/usage'.replace(new RegExp('{functionId}','g'),functionId);let payload={};if(range){payload['range']=range;} -return http.get(path,{'content-type':'application/json',},payload);}};let health={get:function(){let path='/health';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getAntiVirus:function(){let path='/health/anti-virus';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCache:function(){let path='/health/cache';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getDB:function(){let path='/health/db';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueCertificates:function(){let path='/health/queue/certificates';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueFunctions:function(){let path='/health/queue/functions';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueLogs:function(){let path='/health/queue/logs';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueTasks:function(){let path='/health/queue/tasks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueUsage:function(){let path='/health/queue/usage';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getQueueWebhooks:function(){let path='/health/queue/webhooks';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getStorageLocal:function(){let path='/health/storage/local';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getTime:function(){let path='/health/time';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let locale={get:function(){let path='/locale';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getContinents:function(){let path='/locale/continents';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountries:function(){let path='/locale/countries';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesEU:function(){let path='/locale/countries/eu';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCountriesPhones:function(){let path='/locale/countries/phones';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getCurrencies:function(){let path='/locale/currencies';let payload={};return http.get(path,{'content-type':'application/json',},payload);},getLanguages:function(){let path='/locale/languages';let payload={};return http.get(path,{'content-type':'application/json',},payload);}};let projects={list:function(search='',limit=25,offset=0,orderType='ASC'){let path='/projects';let payload={};if(search){payload['search']=search;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createTag:(functionId,command,code)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +if(command===undefined){throw new AppwriteException('Missing required parameter: "command"');} +if(code===undefined){throw new AppwriteException('Missing required parameter: "code"');} +let path='/functions/{functionId}/tags'.replace('{functionId}',functionId);let payload={};if(typeof command!=='undefined'){payload['command']=command;} +if(typeof code!=='undefined'){payload['code']=code;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'multipart/form-data',},payload);}),getTag:(functionId,tagId)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +if(tagId===undefined){throw new AppwriteException('Missing required parameter: "tagId"');} +let path='/functions/{functionId}/tags/{tagId}'.replace('{functionId}',functionId).replace('{tagId}',tagId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),deleteTag:(functionId,tagId)=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +if(tagId===undefined){throw new AppwriteException('Missing required parameter: "tagId"');} +let path='/functions/{functionId}/tags/{tagId}'.replace('{functionId}',functionId).replace('{tagId}',tagId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),getUsage:(functionId,range='30d')=>__awaiter(this,void 0,void 0,function*(){if(functionId===undefined){throw new AppwriteException('Missing required parameter: "functionId"');} +let path='/functions/{functionId}/usage'.replace('{functionId}',functionId);let payload={};if(range){payload['range']=range;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);})};this.health={get:()=>__awaiter(this,void 0,void 0,function*(){let path='/health';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getAntiVirus:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/anti-virus';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getCache:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/cache';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getDB:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/db';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getQueueCertificates:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/queue/certificates';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getQueueFunctions:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/queue/functions';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getQueueLogs:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/queue/logs';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getQueueTasks:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/queue/tasks';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getQueueUsage:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/queue/usage';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getQueueWebhooks:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/queue/webhooks';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getStorageLocal:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/storage/local';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getTime:()=>__awaiter(this,void 0,void 0,function*(){let path='/health/time';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);})};this.locale={get:()=>__awaiter(this,void 0,void 0,function*(){let path='/locale';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getContinents:()=>__awaiter(this,void 0,void 0,function*(){let path='/locale/continents';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getCountries:()=>__awaiter(this,void 0,void 0,function*(){let path='/locale/countries';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getCountriesEU:()=>__awaiter(this,void 0,void 0,function*(){let path='/locale/countries/eu';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getCountriesPhones:()=>__awaiter(this,void 0,void 0,function*(){let path='/locale/countries/phones';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getCurrencies:()=>__awaiter(this,void 0,void 0,function*(){let path='/locale/currencies';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getLanguages:()=>__awaiter(this,void 0,void 0,function*(){let path='/locale/languages';let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);})};this.projects={list:(search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){let path='/projects';let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},create:function(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -let path='/projects';let payload={};if(name){payload['name']=name;} -if(teamId){payload['teamId']=teamId;} -if(description){payload['description']=description;} -if(logo){payload['logo']=logo;} -if(url){payload['url']=url;} -if(legalName){payload['legalName']=legalName;} -if(legalCountry){payload['legalCountry']=legalCountry;} -if(legalState){payload['legalState']=legalState;} -if(legalCity){payload['legalCity']=legalCity;} -if(legalAddress){payload['legalAddress']=legalAddress;} -if(legalTaxId){payload['legalTaxId']=legalTaxId;} -return http.post(path,{'content-type':'application/json',},payload);},get:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},update:function(projectId,name,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;} -if(description){payload['description']=description;} -if(logo){payload['logo']=logo;} -if(url){payload['url']=url;} -if(legalName){payload['legalName']=legalName;} -if(legalCountry){payload['legalCountry']=legalCountry;} -if(legalState){payload['legalState']=legalState;} -if(legalCity){payload['legalCity']=legalCity;} -if(legalAddress){payload['legalAddress']=legalAddress;} -if(legalTaxId){payload['legalTaxId']=legalTaxId;} -return http.patch(path,{'content-type':'application/json',},payload);},delete:function(projectId,password){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(password===undefined){throw new Error('Missing required parameter: "password"');} -let path='/projects/{projectId}'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(password){payload['password']=password;} -return http.delete(path,{'content-type':'application/json',},payload);},updateAuthLimit:function(projectId,limit){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(limit===undefined){throw new Error('Missing required parameter: "limit"');} -let path='/projects/{projectId}/auth/limit'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(typeof limit!=='undefined'){payload['limit']=limit;} -return http.patch(path,{'content-type':'application/json',},payload);},updateAuthStatus:function(projectId,method,status){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(method===undefined){throw new Error('Missing required parameter: "method"');} -if(status===undefined){throw new Error('Missing required parameter: "status"');} -let path='/projects/{projectId}/auth/{method}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{method}','g'),method);let payload={};if(status){payload['status']=status;} -return http.patch(path,{'content-type':'application/json',},payload);},listDomains:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -let path='/projects/{projectId}/domains'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createDomain:function(projectId,domain){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(domain===undefined){throw new Error('Missing required parameter: "domain"');} -let path='/projects/{projectId}/domains'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(domain){payload['domain']=domain;} -return http.post(path,{'content-type':'application/json',},payload);},getDomain:function(projectId,domainId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(domainId===undefined){throw new Error('Missing required parameter: "domainId"');} -let path='/projects/{projectId}/domains/{domainId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{domainId}','g'),domainId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},deleteDomain:function(projectId,domainId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(domainId===undefined){throw new Error('Missing required parameter: "domainId"');} -let path='/projects/{projectId}/domains/{domainId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{domainId}','g'),domainId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},updateDomainVerification:function(projectId,domainId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(domainId===undefined){throw new Error('Missing required parameter: "domainId"');} -let path='/projects/{projectId}/domains/{domainId}/verification'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{domainId}','g'),domainId);let payload={};return http.patch(path,{'content-type':'application/json',},payload);},listKeys:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createKey:function(projectId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(scopes===undefined){throw new Error('Missing required parameter: "scopes"');} -let path='/projects/{projectId}/keys'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;} -if(scopes){payload['scopes']=scopes;} -return http.post(path,{'content-type':'application/json',},payload);},getKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(keyId===undefined){throw new Error('Missing required parameter: "keyId"');} -let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateKey:function(projectId,keyId,name,scopes){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(keyId===undefined){throw new Error('Missing required parameter: "keyId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(scopes===undefined){throw new Error('Missing required parameter: "scopes"');} -let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};if(name){payload['name']=name;} -if(scopes){payload['scopes']=scopes;} -return http.put(path,{'content-type':'application/json',},payload);},deleteKey:function(projectId,keyId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(keyId===undefined){throw new Error('Missing required parameter: "keyId"');} -let path='/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{keyId}','g'),keyId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},updateOAuth2:function(projectId,provider,appId='',secret=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(provider===undefined){throw new Error('Missing required parameter: "provider"');} -let path='/projects/{projectId}/oauth2'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(provider){payload['provider']=provider;} -if(appId){payload['appId']=appId;} -if(secret){payload['secret']=secret;} -return http.patch(path,{'content-type':'application/json',},payload);},listPlatforms:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createPlatform:function(projectId,type,name,key='',store='',hostname=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(type===undefined){throw new Error('Missing required parameter: "type"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -let path='/projects/{projectId}/platforms'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(type){payload['type']=type;} -if(name){payload['name']=name;} -if(key){payload['key']=key;} -if(store){payload['store']=store;} -if(hostname){payload['hostname']=hostname;} -return http.post(path,{'content-type':'application/json',},payload);},getPlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(platformId===undefined){throw new Error('Missing required parameter: "platformId"');} -let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updatePlatform:function(projectId,platformId,name,key='',store='',hostname=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(platformId===undefined){throw new Error('Missing required parameter: "platformId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};if(name){payload['name']=name;} -if(key){payload['key']=key;} -if(store){payload['store']=store;} -if(hostname){payload['hostname']=hostname;} -return http.put(path,{'content-type':'application/json',},payload);},deletePlatform:function(projectId,platformId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(platformId===undefined){throw new Error('Missing required parameter: "platformId"');} -let path='/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{platformId}','g'),platformId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},listTasks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createTask:function(projectId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(status===undefined){throw new Error('Missing required parameter: "status"');} -if(schedule===undefined){throw new Error('Missing required parameter: "schedule"');} -if(security===undefined){throw new Error('Missing required parameter: "security"');} -if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"');} -if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"');} -let path='/projects/{projectId}/tasks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;} -if(status){payload['status']=status;} -if(schedule){payload['schedule']=schedule;} -if(security){payload['security']=security;} -if(httpMethod){payload['httpMethod']=httpMethod;} -if(httpUrl){payload['httpUrl']=httpUrl;} -if(httpHeaders){payload['httpHeaders']=httpHeaders;} -if(httpUser){payload['httpUser']=httpUser;} -if(httpPass){payload['httpPass']=httpPass;} -return http.post(path,{'content-type':'application/json',},payload);},getTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(taskId===undefined){throw new Error('Missing required parameter: "taskId"');} -let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateTask:function(projectId,taskId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(taskId===undefined){throw new Error('Missing required parameter: "taskId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(status===undefined){throw new Error('Missing required parameter: "status"');} -if(schedule===undefined){throw new Error('Missing required parameter: "schedule"');} -if(security===undefined){throw new Error('Missing required parameter: "security"');} -if(httpMethod===undefined){throw new Error('Missing required parameter: "httpMethod"');} -if(httpUrl===undefined){throw new Error('Missing required parameter: "httpUrl"');} -let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};if(name){payload['name']=name;} -if(status){payload['status']=status;} -if(schedule){payload['schedule']=schedule;} -if(security){payload['security']=security;} -if(httpMethod){payload['httpMethod']=httpMethod;} -if(httpUrl){payload['httpUrl']=httpUrl;} -if(httpHeaders){payload['httpHeaders']=httpHeaders;} -if(httpUser){payload['httpUser']=httpUser;} -if(httpPass){payload['httpPass']=httpPass;} -return http.put(path,{'content-type':'application/json',},payload);},deleteTask:function(projectId,taskId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(taskId===undefined){throw new Error('Missing required parameter: "taskId"');} -let path='/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{taskId}','g'),taskId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getUsage:function(projectId,range='30d'){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -let path='/projects/{projectId}/usage'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(range){payload['range']=range;} -return http.get(path,{'content-type':'application/json',},payload);},listWebhooks:function(projectId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},createWebhook:function(projectId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(events===undefined){throw new Error('Missing required parameter: "events"');} -if(url===undefined){throw new Error('Missing required parameter: "url"');} -if(security===undefined){throw new Error('Missing required parameter: "security"');} -let path='/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}','g'),projectId);let payload={};if(name){payload['name']=name;} -if(events){payload['events']=events;} -if(url){payload['url']=url;} -if(security){payload['security']=security;} -if(httpUser){payload['httpUser']=httpUser;} -if(httpPass){payload['httpPass']=httpPass;} -return http.post(path,{'content-type':'application/json',},payload);},getWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"');} -let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateWebhook:function(projectId,webhookId,name,events,url,security,httpUser='',httpPass=''){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -if(events===undefined){throw new Error('Missing required parameter: "events"');} -if(url===undefined){throw new Error('Missing required parameter: "url"');} -if(security===undefined){throw new Error('Missing required parameter: "security"');} -let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};if(name){payload['name']=name;} -if(events){payload['events']=events;} -if(url){payload['url']=url;} -if(security){payload['security']=security;} -if(httpUser){payload['httpUser']=httpUser;} -if(httpPass){payload['httpPass']=httpPass;} -return http.put(path,{'content-type':'application/json',},payload);},deleteWebhook:function(projectId,webhookId){if(projectId===undefined){throw new Error('Missing required parameter: "projectId"');} -if(webhookId===undefined){throw new Error('Missing required parameter: "webhookId"');} -let path='/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}','g'),projectId).replace(new RegExp('{webhookId}','g'),webhookId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);}};let storage={listFiles:function(search='',limit=25,offset=0,orderType='ASC'){let path='/storage/files';let payload={};if(search){payload['search']=search;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),create:(name,teamId,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId='')=>__awaiter(this,void 0,void 0,function*(){if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +let path='/projects';let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof teamId!=='undefined'){payload['teamId']=teamId;} +if(typeof description!=='undefined'){payload['description']=description;} +if(typeof logo!=='undefined'){payload['logo']=logo;} +if(typeof url!=='undefined'){payload['url']=url;} +if(typeof legalName!=='undefined'){payload['legalName']=legalName;} +if(typeof legalCountry!=='undefined'){payload['legalCountry']=legalCountry;} +if(typeof legalState!=='undefined'){payload['legalState']=legalState;} +if(typeof legalCity!=='undefined'){payload['legalCity']=legalCity;} +if(typeof legalAddress!=='undefined'){payload['legalAddress']=legalAddress;} +if(typeof legalTaxId!=='undefined'){payload['legalTaxId']=legalTaxId;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),get:(projectId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +let path='/projects/{projectId}'.replace('{projectId}',projectId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),update:(projectId,name,description='',logo='',url='',legalName='',legalCountry='',legalState='',legalCity='',legalAddress='',legalTaxId='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +let path='/projects/{projectId}'.replace('{projectId}',projectId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof description!=='undefined'){payload['description']=description;} +if(typeof logo!=='undefined'){payload['logo']=logo;} +if(typeof url!=='undefined'){payload['url']=url;} +if(typeof legalName!=='undefined'){payload['legalName']=legalName;} +if(typeof legalCountry!=='undefined'){payload['legalCountry']=legalCountry;} +if(typeof legalState!=='undefined'){payload['legalState']=legalState;} +if(typeof legalCity!=='undefined'){payload['legalCity']=legalCity;} +if(typeof legalAddress!=='undefined'){payload['legalAddress']=legalAddress;} +if(typeof legalTaxId!=='undefined'){payload['legalTaxId']=legalTaxId;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),delete:(projectId,password)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(password===undefined){throw new AppwriteException('Missing required parameter: "password"');} +let path='/projects/{projectId}'.replace('{projectId}',projectId);let payload={};if(typeof password!=='undefined'){payload['password']=password;} +const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),updateAuthLimit:(projectId,limit)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(limit===undefined){throw new AppwriteException('Missing required parameter: "limit"');} +let path='/projects/{projectId}/auth/limit'.replace('{projectId}',projectId);let payload={};if(typeof limit!=='undefined'){payload['limit']=limit;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),updateAuthStatus:(projectId,method,status)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(method===undefined){throw new AppwriteException('Missing required parameter: "method"');} +if(status===undefined){throw new AppwriteException('Missing required parameter: "status"');} +let path='/projects/{projectId}/auth/{method}'.replace('{projectId}',projectId).replace('{method}',method);let payload={};if(typeof status!=='undefined'){payload['status']=status;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),listDomains:(projectId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +let path='/projects/{projectId}/domains'.replace('{projectId}',projectId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createDomain:(projectId,domain)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(domain===undefined){throw new AppwriteException('Missing required parameter: "domain"');} +let path='/projects/{projectId}/domains'.replace('{projectId}',projectId);let payload={};if(typeof domain!=='undefined'){payload['domain']=domain;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getDomain:(projectId,domainId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(domainId===undefined){throw new AppwriteException('Missing required parameter: "domainId"');} +let path='/projects/{projectId}/domains/{domainId}'.replace('{projectId}',projectId).replace('{domainId}',domainId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),deleteDomain:(projectId,domainId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(domainId===undefined){throw new AppwriteException('Missing required parameter: "domainId"');} +let path='/projects/{projectId}/domains/{domainId}'.replace('{projectId}',projectId).replace('{domainId}',domainId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),updateDomainVerification:(projectId,domainId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(domainId===undefined){throw new AppwriteException('Missing required parameter: "domainId"');} +let path='/projects/{projectId}/domains/{domainId}/verification'.replace('{projectId}',projectId).replace('{domainId}',domainId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),listKeys:(projectId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +let path='/projects/{projectId}/keys'.replace('{projectId}',projectId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createKey:(projectId,name,scopes)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(scopes===undefined){throw new AppwriteException('Missing required parameter: "scopes"');} +let path='/projects/{projectId}/keys'.replace('{projectId}',projectId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof scopes!=='undefined'){payload['scopes']=scopes;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getKey:(projectId,keyId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(keyId===undefined){throw new AppwriteException('Missing required parameter: "keyId"');} +let path='/projects/{projectId}/keys/{keyId}'.replace('{projectId}',projectId).replace('{keyId}',keyId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateKey:(projectId,keyId,name,scopes)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(keyId===undefined){throw new AppwriteException('Missing required parameter: "keyId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(scopes===undefined){throw new AppwriteException('Missing required parameter: "scopes"');} +let path='/projects/{projectId}/keys/{keyId}'.replace('{projectId}',projectId).replace('{keyId}',keyId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof scopes!=='undefined'){payload['scopes']=scopes;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),deleteKey:(projectId,keyId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(keyId===undefined){throw new AppwriteException('Missing required parameter: "keyId"');} +let path='/projects/{projectId}/keys/{keyId}'.replace('{projectId}',projectId).replace('{keyId}',keyId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),updateOAuth2:(projectId,provider,appId='',secret='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(provider===undefined){throw new AppwriteException('Missing required parameter: "provider"');} +let path='/projects/{projectId}/oauth2'.replace('{projectId}',projectId);let payload={};if(typeof provider!=='undefined'){payload['provider']=provider;} +if(typeof appId!=='undefined'){payload['appId']=appId;} +if(typeof secret!=='undefined'){payload['secret']=secret;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),listPlatforms:(projectId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +let path='/projects/{projectId}/platforms'.replace('{projectId}',projectId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createPlatform:(projectId,type,name,key='',store='',hostname='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(type===undefined){throw new AppwriteException('Missing required parameter: "type"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +let path='/projects/{projectId}/platforms'.replace('{projectId}',projectId);let payload={};if(typeof type!=='undefined'){payload['type']=type;} +if(typeof name!=='undefined'){payload['name']=name;} +if(typeof key!=='undefined'){payload['key']=key;} +if(typeof store!=='undefined'){payload['store']=store;} +if(typeof hostname!=='undefined'){payload['hostname']=hostname;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getPlatform:(projectId,platformId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(platformId===undefined){throw new AppwriteException('Missing required parameter: "platformId"');} +let path='/projects/{projectId}/platforms/{platformId}'.replace('{projectId}',projectId).replace('{platformId}',platformId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updatePlatform:(projectId,platformId,name,key='',store='',hostname='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(platformId===undefined){throw new AppwriteException('Missing required parameter: "platformId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +let path='/projects/{projectId}/platforms/{platformId}'.replace('{projectId}',projectId).replace('{platformId}',platformId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof key!=='undefined'){payload['key']=key;} +if(typeof store!=='undefined'){payload['store']=store;} +if(typeof hostname!=='undefined'){payload['hostname']=hostname;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),deletePlatform:(projectId,platformId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(platformId===undefined){throw new AppwriteException('Missing required parameter: "platformId"');} +let path='/projects/{projectId}/platforms/{platformId}'.replace('{projectId}',projectId).replace('{platformId}',platformId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),listTasks:(projectId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +let path='/projects/{projectId}/tasks'.replace('{projectId}',projectId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createTask:(projectId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(status===undefined){throw new AppwriteException('Missing required parameter: "status"');} +if(schedule===undefined){throw new AppwriteException('Missing required parameter: "schedule"');} +if(security===undefined){throw new AppwriteException('Missing required parameter: "security"');} +if(httpMethod===undefined){throw new AppwriteException('Missing required parameter: "httpMethod"');} +if(httpUrl===undefined){throw new AppwriteException('Missing required parameter: "httpUrl"');} +let path='/projects/{projectId}/tasks'.replace('{projectId}',projectId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof status!=='undefined'){payload['status']=status;} +if(typeof schedule!=='undefined'){payload['schedule']=schedule;} +if(typeof security!=='undefined'){payload['security']=security;} +if(typeof httpMethod!=='undefined'){payload['httpMethod']=httpMethod;} +if(typeof httpUrl!=='undefined'){payload['httpUrl']=httpUrl;} +if(typeof httpHeaders!=='undefined'){payload['httpHeaders']=httpHeaders;} +if(typeof httpUser!=='undefined'){payload['httpUser']=httpUser;} +if(typeof httpPass!=='undefined'){payload['httpPass']=httpPass;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getTask:(projectId,taskId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(taskId===undefined){throw new AppwriteException('Missing required parameter: "taskId"');} +let path='/projects/{projectId}/tasks/{taskId}'.replace('{projectId}',projectId).replace('{taskId}',taskId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateTask:(projectId,taskId,name,status,schedule,security,httpMethod,httpUrl,httpHeaders=[],httpUser='',httpPass='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(taskId===undefined){throw new AppwriteException('Missing required parameter: "taskId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(status===undefined){throw new AppwriteException('Missing required parameter: "status"');} +if(schedule===undefined){throw new AppwriteException('Missing required parameter: "schedule"');} +if(security===undefined){throw new AppwriteException('Missing required parameter: "security"');} +if(httpMethod===undefined){throw new AppwriteException('Missing required parameter: "httpMethod"');} +if(httpUrl===undefined){throw new AppwriteException('Missing required parameter: "httpUrl"');} +let path='/projects/{projectId}/tasks/{taskId}'.replace('{projectId}',projectId).replace('{taskId}',taskId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof status!=='undefined'){payload['status']=status;} +if(typeof schedule!=='undefined'){payload['schedule']=schedule;} +if(typeof security!=='undefined'){payload['security']=security;} +if(typeof httpMethod!=='undefined'){payload['httpMethod']=httpMethod;} +if(typeof httpUrl!=='undefined'){payload['httpUrl']=httpUrl;} +if(typeof httpHeaders!=='undefined'){payload['httpHeaders']=httpHeaders;} +if(typeof httpUser!=='undefined'){payload['httpUser']=httpUser;} +if(typeof httpPass!=='undefined'){payload['httpPass']=httpPass;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),deleteTask:(projectId,taskId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(taskId===undefined){throw new AppwriteException('Missing required parameter: "taskId"');} +let path='/projects/{projectId}/tasks/{taskId}'.replace('{projectId}',projectId).replace('{taskId}',taskId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),getUsage:(projectId,range='30d')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +let path='/projects/{projectId}/usage'.replace('{projectId}',projectId);let payload={};if(range){payload['range']=range;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),listWebhooks:(projectId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +let path='/projects/{projectId}/webhooks'.replace('{projectId}',projectId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createWebhook:(projectId,name,events,url,security,httpUser='',httpPass='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(events===undefined){throw new AppwriteException('Missing required parameter: "events"');} +if(url===undefined){throw new AppwriteException('Missing required parameter: "url"');} +if(security===undefined){throw new AppwriteException('Missing required parameter: "security"');} +let path='/projects/{projectId}/webhooks'.replace('{projectId}',projectId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof events!=='undefined'){payload['events']=events;} +if(typeof url!=='undefined'){payload['url']=url;} +if(typeof security!=='undefined'){payload['security']=security;} +if(typeof httpUser!=='undefined'){payload['httpUser']=httpUser;} +if(typeof httpPass!=='undefined'){payload['httpPass']=httpPass;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),getWebhook:(projectId,webhookId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(webhookId===undefined){throw new AppwriteException('Missing required parameter: "webhookId"');} +let path='/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}',projectId).replace('{webhookId}',webhookId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateWebhook:(projectId,webhookId,name,events,url,security,httpUser='',httpPass='')=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(webhookId===undefined){throw new AppwriteException('Missing required parameter: "webhookId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +if(events===undefined){throw new AppwriteException('Missing required parameter: "events"');} +if(url===undefined){throw new AppwriteException('Missing required parameter: "url"');} +if(security===undefined){throw new AppwriteException('Missing required parameter: "security"');} +let path='/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}',projectId).replace('{webhookId}',webhookId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof events!=='undefined'){payload['events']=events;} +if(typeof url!=='undefined'){payload['url']=url;} +if(typeof security!=='undefined'){payload['security']=security;} +if(typeof httpUser!=='undefined'){payload['httpUser']=httpUser;} +if(typeof httpPass!=='undefined'){payload['httpPass']=httpPass;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),deleteWebhook:(projectId,webhookId)=>__awaiter(this,void 0,void 0,function*(){if(projectId===undefined){throw new AppwriteException('Missing required parameter: "projectId"');} +if(webhookId===undefined){throw new AppwriteException('Missing required parameter: "webhookId"');} +let path='/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}',projectId).replace('{webhookId}',webhookId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);})};this.storage={listFiles:(search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){let path='/storage/files';let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},createFile:function(file,read,write){if(file===undefined){throw new Error('Missing required parameter: "file"');} -if(read===undefined){throw new Error('Missing required parameter: "read"');} -if(write===undefined){throw new Error('Missing required parameter: "write"');} -let path='/storage/files';let payload={};if(file){payload['file']=file;} -if(read){payload['read']=read;} -if(write){payload['write']=write;} -return http.post(path,{'content-type':'multipart/form-data',},payload);},getFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');} -let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updateFile:function(fileId,read,write){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');} -if(read===undefined){throw new Error('Missing required parameter: "read"');} -if(write===undefined){throw new Error('Missing required parameter: "write"');} -let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};if(read){payload['read']=read;} -if(write){payload['write']=write;} -return http.put(path,{'content-type':'application/json',},payload);},deleteFile:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');} -let path='/storage/files/{fileId}'.replace(new RegExp('{fileId}','g'),fileId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getFileDownload:function(fileId){if(fileId===undefined){throw new Error('Missing required parameter: "fileId"');} -let path='/storage/files/{fileId}/download'.replace(new RegExp('{fileId}','g'),fileId);let payload={};payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index__awaiter(this,void 0,void 0,function*(){if(file===undefined){throw new AppwriteException('Missing required parameter: "file"');} +let path='/storage/files';let payload={};if(typeof file!=='undefined'){payload['file']=file;} +if(typeof read!=='undefined'){payload['read']=read;} +if(typeof write!=='undefined'){payload['write']=write;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'multipart/form-data',},payload);}),getFile:(fileId)=>__awaiter(this,void 0,void 0,function*(){if(fileId===undefined){throw new AppwriteException('Missing required parameter: "fileId"');} +let path='/storage/files/{fileId}'.replace('{fileId}',fileId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updateFile:(fileId,read,write)=>__awaiter(this,void 0,void 0,function*(){if(fileId===undefined){throw new AppwriteException('Missing required parameter: "fileId"');} +if(read===undefined){throw new AppwriteException('Missing required parameter: "read"');} +if(write===undefined){throw new AppwriteException('Missing required parameter: "write"');} +let path='/storage/files/{fileId}'.replace('{fileId}',fileId);let payload={};if(typeof read!=='undefined'){payload['read']=read;} +if(typeof write!=='undefined'){payload['write']=write;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),deleteFile:(fileId)=>__awaiter(this,void 0,void 0,function*(){if(fileId===undefined){throw new AppwriteException('Missing required parameter: "fileId"');} +let path='/storage/files/{fileId}'.replace('{fileId}',fileId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),getFileDownload:(fileId)=>{if(fileId===undefined){throw new AppwriteException('Missing required parameter: "fileId"');} +let path='/storage/files/{fileId}/download'.replace('{fileId}',fileId);let payload={};const uri=new URL(this.config.endpoint+path);payload['project']=this.config.project;for(const[key,value]of Object.entries(this.flatten(payload))){uri.searchParams.append(key,value);} +return uri;},getFilePreview:(fileId,width=0,height=0,quality=100,borderWidth=0,borderColor='',borderRadius=0,opacity=1,rotation=0,background='',output='')=>{if(fileId===undefined){throw new AppwriteException('Missing required parameter: "fileId"');} +let path='/storage/files/{fileId}/preview'.replace('{fileId}',fileId);let payload={};if(width){payload['width']=width;} if(height){payload['height']=height;} if(quality){payload['quality']=quality;} +if(borderWidth){payload['borderWidth']=borderWidth;} +if(borderColor){payload['borderColor']=borderColor;} +if(borderRadius){payload['borderRadius']=borderRadius;} +if(opacity){payload['opacity']=opacity;} +if(rotation){payload['rotation']=rotation;} if(background){payload['background']=background;} if(output){payload['output']=output;} -payload['project']=config.project;payload['key']=config.key;let query=[];for(let p in payload){if(Array.isArray(payload[p])){for(let index=0;index{if(fileId===undefined){throw new AppwriteException('Missing required parameter: "fileId"');} +let path='/storage/files/{fileId}/view'.replace('{fileId}',fileId);let payload={};const uri=new URL(this.config.endpoint+path);payload['project']=this.config.project;for(const[key,value]of Object.entries(this.flatten(payload))){uri.searchParams.append(key,value);} +return uri;}};this.teams={list:(search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){let path='/teams';let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},create:function(name,roles=["owner"]){if(name===undefined){throw new Error('Missing required parameter: "name"');} -let path='/teams';let payload={};if(name){payload['name']=name;} -if(roles){payload['roles']=roles;} -return http.post(path,{'content-type':'application/json',},payload);},get:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},update:function(teamId,name){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -if(name===undefined){throw new Error('Missing required parameter: "name"');} -let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(name){payload['name']=name;} -return http.put(path,{'content-type':'application/json',},payload);},delete:function(teamId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -let path='/teams/{teamId}'.replace(new RegExp('{teamId}','g'),teamId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getMemberships:function(teamId,search='',limit=25,offset=0,orderType='ASC'){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(search){payload['search']=search;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),create:(name,roles=["owner"])=>__awaiter(this,void 0,void 0,function*(){if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +let path='/teams';let payload={};if(typeof name!=='undefined'){payload['name']=name;} +if(typeof roles!=='undefined'){payload['roles']=roles;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),get:(teamId)=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +let path='/teams/{teamId}'.replace('{teamId}',teamId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),update:(teamId,name)=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +if(name===undefined){throw new AppwriteException('Missing required parameter: "name"');} +let path='/teams/{teamId}'.replace('{teamId}',teamId);let payload={};if(typeof name!=='undefined'){payload['name']=name;} +const uri=new URL(this.config.endpoint+path);return yield this.call('put',uri,{'content-type':'application/json',},payload);}),delete:(teamId)=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +let path='/teams/{teamId}'.replace('{teamId}',teamId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),getMemberships:(teamId,search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +let path='/teams/{teamId}/memberships'.replace('{teamId}',teamId);let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},createMembership:function(teamId,email,roles,url,name=''){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -if(email===undefined){throw new Error('Missing required parameter: "email"');} -if(roles===undefined){throw new Error('Missing required parameter: "roles"');} -if(url===undefined){throw new Error('Missing required parameter: "url"');} -let path='/teams/{teamId}/memberships'.replace(new RegExp('{teamId}','g'),teamId);let payload={};if(email){payload['email']=email;} -if(name){payload['name']=name;} -if(roles){payload['roles']=roles;} -if(url){payload['url']=url;} -return http.post(path,{'content-type':'application/json',},payload);},deleteMembership:function(teamId,inviteId){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"');} -let path='/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},updateMembershipStatus:function(teamId,inviteId,userId,secret){if(teamId===undefined){throw new Error('Missing required parameter: "teamId"');} -if(inviteId===undefined){throw new Error('Missing required parameter: "inviteId"');} -if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -if(secret===undefined){throw new Error('Missing required parameter: "secret"');} -let path='/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}','g'),teamId).replace(new RegExp('{inviteId}','g'),inviteId);let payload={};if(userId){payload['userId']=userId;} -if(secret){payload['secret']=secret;} -return http.patch(path,{'content-type':'application/json',},payload);}};let users={list:function(search='',limit=25,offset=0,orderType='ASC'){let path='/users';let payload={};if(search){payload['search']=search;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),createMembership:(teamId,email,roles,url,name='')=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +if(email===undefined){throw new AppwriteException('Missing required parameter: "email"');} +if(roles===undefined){throw new AppwriteException('Missing required parameter: "roles"');} +if(url===undefined){throw new AppwriteException('Missing required parameter: "url"');} +let path='/teams/{teamId}/memberships'.replace('{teamId}',teamId);let payload={};if(typeof email!=='undefined'){payload['email']=email;} +if(typeof name!=='undefined'){payload['name']=name;} +if(typeof roles!=='undefined'){payload['roles']=roles;} +if(typeof url!=='undefined'){payload['url']=url;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),updateMembershipRoles:(teamId,membershipId,roles)=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +if(membershipId===undefined){throw new AppwriteException('Missing required parameter: "membershipId"');} +if(roles===undefined){throw new AppwriteException('Missing required parameter: "roles"');} +let path='/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}',teamId).replace('{membershipId}',membershipId);let payload={};if(typeof roles!=='undefined'){payload['roles']=roles;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),deleteMembership:(teamId,membershipId)=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +if(membershipId===undefined){throw new AppwriteException('Missing required parameter: "membershipId"');} +let path='/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}',teamId).replace('{membershipId}',membershipId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),updateMembershipStatus:(teamId,membershipId,userId,secret)=>__awaiter(this,void 0,void 0,function*(){if(teamId===undefined){throw new AppwriteException('Missing required parameter: "teamId"');} +if(membershipId===undefined){throw new AppwriteException('Missing required parameter: "membershipId"');} +if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +if(secret===undefined){throw new AppwriteException('Missing required parameter: "secret"');} +let path='/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}',teamId).replace('{membershipId}',membershipId);let payload={};if(typeof userId!=='undefined'){payload['userId']=userId;} +if(typeof secret!=='undefined'){payload['secret']=secret;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);})};this.users={list:(search='',limit=25,offset=0,orderType='ASC')=>__awaiter(this,void 0,void 0,function*(){let path='/users';let payload={};if(search){payload['search']=search;} if(limit){payload['limit']=limit;} if(offset){payload['offset']=offset;} if(orderType){payload['orderType']=orderType;} -return http.get(path,{'content-type':'application/json',},payload);},create:function(email,password,name=''){if(email===undefined){throw new Error('Missing required parameter: "email"');} -if(password===undefined){throw new Error('Missing required parameter: "password"');} -let path='/users';let payload={};if(email){payload['email']=email;} -if(password){payload['password']=password;} -if(name){payload['name']=name;} -return http.post(path,{'content-type':'application/json',},payload);},get:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},deleteUser:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -let path='/users/{userId}'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},getLogs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -let path='/users/{userId}/logs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},getPrefs:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},updatePrefs:function(userId,prefs){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -if(prefs===undefined){throw new Error('Missing required parameter: "prefs"');} -let path='/users/{userId}/prefs'.replace(new RegExp('{userId}','g'),userId);let payload={};if(prefs){payload['prefs']=prefs;} -return http.patch(path,{'content-type':'application/json',},payload);},getSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.get(path,{'content-type':'application/json',},payload);},deleteSessions:function(userId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -let path='/users/{userId}/sessions'.replace(new RegExp('{userId}','g'),userId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},deleteSession:function(userId,sessionId){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -if(sessionId===undefined){throw new Error('Missing required parameter: "sessionId"');} -let path='/users/{userId}/sessions/{sessionId}'.replace(new RegExp('{userId}','g'),userId).replace(new RegExp('{sessionId}','g'),sessionId);let payload={};return http.delete(path,{'content-type':'application/json',},payload);},updateStatus:function(userId,status){if(userId===undefined){throw new Error('Missing required parameter: "userId"');} -if(status===undefined){throw new Error('Missing required parameter: "status"');} -let path='/users/{userId}/status'.replace(new RegExp('{userId}','g'),userId);let payload={};if(status){payload['status']=status;} -return http.patch(path,{'content-type':'application/json',},payload);}};return{setEndpoint:setEndpoint,setProject:setProject,setKey:setKey,setLocale:setLocale,setMode:setMode,account:account,avatars:avatars,database:database,functions:functions,health:health,locale:locale,projects:projects,storage:storage,teams:teams,users:users};};if(typeof module!=="undefined"){module.exports=window.Appwrite;}})((typeof window!=="undefined")?window:{});(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(function(){try{return require('moment');}catch(e){}}()):typeof define==='function'&&define.amd?define(['require'],function(require){return factory(function(){try{return require('moment');}catch(e){}}());}):(global=global||self,global.Chart=factory(global.moment));}(this,(function(moment){'use strict';moment=moment&&moment.hasOwnProperty('default')?moment['default']:moment;function createCommonjsModule(fn,module){return module={exports:{}},fn(module,module.exports),module.exports;} +const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),create:(email,password,name='')=>__awaiter(this,void 0,void 0,function*(){if(email===undefined){throw new AppwriteException('Missing required parameter: "email"');} +if(password===undefined){throw new AppwriteException('Missing required parameter: "password"');} +let path='/users';let payload={};if(typeof email!=='undefined'){payload['email']=email;} +if(typeof password!=='undefined'){payload['password']=password;} +if(typeof name!=='undefined'){payload['name']=name;} +const uri=new URL(this.config.endpoint+path);return yield this.call('post',uri,{'content-type':'application/json',},payload);}),get:(userId)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +let path='/users/{userId}'.replace('{userId}',userId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),delete:(userId)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +let path='/users/{userId}'.replace('{userId}',userId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),getLogs:(userId)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +let path='/users/{userId}/logs'.replace('{userId}',userId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),getPrefs:(userId)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +let path='/users/{userId}/prefs'.replace('{userId}',userId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),updatePrefs:(userId,prefs)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +if(prefs===undefined){throw new AppwriteException('Missing required parameter: "prefs"');} +let path='/users/{userId}/prefs'.replace('{userId}',userId);let payload={};if(typeof prefs!=='undefined'){payload['prefs']=prefs;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);}),getSessions:(userId)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +let path='/users/{userId}/sessions'.replace('{userId}',userId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('get',uri,{'content-type':'application/json',},payload);}),deleteSessions:(userId)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +let path='/users/{userId}/sessions'.replace('{userId}',userId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),deleteSession:(userId,sessionId)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +if(sessionId===undefined){throw new AppwriteException('Missing required parameter: "sessionId"');} +let path='/users/{userId}/sessions/{sessionId}'.replace('{userId}',userId).replace('{sessionId}',sessionId);let payload={};const uri=new URL(this.config.endpoint+path);return yield this.call('delete',uri,{'content-type':'application/json',},payload);}),updateStatus:(userId,status)=>__awaiter(this,void 0,void 0,function*(){if(userId===undefined){throw new AppwriteException('Missing required parameter: "userId"');} +if(status===undefined){throw new AppwriteException('Missing required parameter: "status"');} +let path='/users/{userId}/status'.replace('{userId}',userId);let payload={};if(typeof status!=='undefined'){payload['status']=status;} +const uri=new URL(this.config.endpoint+path);return yield this.call('patch',uri,{'content-type':'application/json',},payload);})};} +setEndpoint(endpoint){this.config.endpoint=endpoint;return this;} +setProject(value){this.headers['X-Appwrite-Project']=value;this.config.project=value;return this;} +setKey(value){this.headers['X-Appwrite-Key']=value;this.config.key=value;return this;} +setJWT(value){this.headers['X-Appwrite-JWT']=value;this.config.jwt=value;return this;} +setLocale(value){this.headers['X-Appwrite-Locale']=value;this.config.locale=value;return this;} +setMode(value){this.headers['X-Appwrite-Mode']=value;this.config.mode=value;return this;} +call(method,url,headers={},params={}){var _a,_b;return __awaiter(this,void 0,void 0,function*(){method=method.toUpperCase();headers=Object.assign(Object.assign({},headers),this.headers);let options={method,headers,credentials:'include'};if(typeof window!=='undefined'&&window.localStorage){headers['X-Fallback-Cookies']=(_a=window.localStorage.getItem('cookieFallback'))!==null&&_a!==void 0?_a:"";} +if(method==='GET'){for(const[key,value]of Object.entries(this.flatten(params))){url.searchParams.append(key,value);}} +else{switch(headers['content-type']){case'application/json':options.body=JSON.stringify(params);break;case'multipart/form-data':let formData=new FormData();for(const key in params){if(Array.isArray(params[key])){formData.append(key+'[]',params[key].join(','));} +else{formData.append(key,params[key]);}} +options.body=formData;delete headers['content-type'];break;}} +try{let data=null;const response=yield crossFetch.fetch(url.toString(),options);if((_b=response.headers.get("content-type"))===null||_b===void 0?void 0:_b.includes("application/json")){data=yield response.json();} +else{data={message:yield response.text()};} +if(400<=response.status){throw new AppwriteException(data===null||data===void 0?void 0:data.message,response.status,data);} +const cookieFallback=response.headers.get('X-Fallback-Cookies');if(typeof window!=='undefined'&&window.localStorage&&cookieFallback){window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.');window.localStorage.setItem('cookieFallback',cookieFallback);} +return data;} +catch(e){throw new AppwriteException(e.message);}});} +flatten(data,prefix=''){let output={};for(const key in data){let value=data[key];let finalKey=prefix?`${prefix}[${key}]`:key;if(Array.isArray(value)){output=Object.assign(output,this.flatten(value,finalKey));} +else{output[finalKey]=value;}} +return output;}} +exports.Appwrite=Appwrite;return exports;}({},null,window));(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory(function(){try{return require('moment');}catch(e){}}()):typeof define==='function'&&define.amd?define(['require'],function(require){return factory(function(){try{return require('moment');}catch(e){}}());}):(global=global||self,global.Chart=factory(global.moment));}(this,(function(moment){'use strict';moment=moment&&moment.hasOwnProperty('default')?moment['default']:moment;function createCommonjsModule(fn,module){return module={exports:{}},fn(module,module.exports),module.exports;} function getCjsExportFromNamespace(n){return n&&n['default']||n;} var colorName={"aliceblue":[240,248,255],"antiquewhite":[250,235,215],"aqua":[0,255,255],"aquamarine":[127,255,212],"azure":[240,255,255],"beige":[245,245,220],"bisque":[255,228,196],"black":[0,0,0],"blanchedalmond":[255,235,205],"blue":[0,0,255],"blueviolet":[138,43,226],"brown":[165,42,42],"burlywood":[222,184,135],"cadetblue":[95,158,160],"chartreuse":[127,255,0],"chocolate":[210,105,30],"coral":[255,127,80],"cornflowerblue":[100,149,237],"cornsilk":[255,248,220],"crimson":[220,20,60],"cyan":[0,255,255],"darkblue":[0,0,139],"darkcyan":[0,139,139],"darkgoldenrod":[184,134,11],"darkgray":[169,169,169],"darkgreen":[0,100,0],"darkgrey":[169,169,169],"darkkhaki":[189,183,107],"darkmagenta":[139,0,139],"darkolivegreen":[85,107,47],"darkorange":[255,140,0],"darkorchid":[153,50,204],"darkred":[139,0,0],"darksalmon":[233,150,122],"darkseagreen":[143,188,143],"darkslateblue":[72,61,139],"darkslategray":[47,79,79],"darkslategrey":[47,79,79],"darkturquoise":[0,206,209],"darkviolet":[148,0,211],"deeppink":[255,20,147],"deepskyblue":[0,191,255],"dimgray":[105,105,105],"dimgrey":[105,105,105],"dodgerblue":[30,144,255],"firebrick":[178,34,34],"floralwhite":[255,250,240],"forestgreen":[34,139,34],"fuchsia":[255,0,255],"gainsboro":[220,220,220],"ghostwhite":[248,248,255],"gold":[255,215,0],"goldenrod":[218,165,32],"gray":[128,128,128],"green":[0,128,0],"greenyellow":[173,255,47],"grey":[128,128,128],"honeydew":[240,255,240],"hotpink":[255,105,180],"indianred":[205,92,92],"indigo":[75,0,130],"ivory":[255,255,240],"khaki":[240,230,140],"lavender":[230,230,250],"lavenderblush":[255,240,245],"lawngreen":[124,252,0],"lemonchiffon":[255,250,205],"lightblue":[173,216,230],"lightcoral":[240,128,128],"lightcyan":[224,255,255],"lightgoldenrodyellow":[250,250,210],"lightgray":[211,211,211],"lightgreen":[144,238,144],"lightgrey":[211,211,211],"lightpink":[255,182,193],"lightsalmon":[255,160,122],"lightseagreen":[32,178,170],"lightskyblue":[135,206,250],"lightslategray":[119,136,153],"lightslategrey":[119,136,153],"lightsteelblue":[176,196,222],"lightyellow":[255,255,224],"lime":[0,255,0],"limegreen":[50,205,50],"linen":[250,240,230],"magenta":[255,0,255],"maroon":[128,0,0],"mediumaquamarine":[102,205,170],"mediumblue":[0,0,205],"mediumorchid":[186,85,211],"mediumpurple":[147,112,219],"mediumseagreen":[60,179,113],"mediumslateblue":[123,104,238],"mediumspringgreen":[0,250,154],"mediumturquoise":[72,209,204],"mediumvioletred":[199,21,133],"midnightblue":[25,25,112],"mintcream":[245,255,250],"mistyrose":[255,228,225],"moccasin":[255,228,181],"navajowhite":[255,222,173],"navy":[0,0,128],"oldlace":[253,245,230],"olive":[128,128,0],"olivedrab":[107,142,35],"orange":[255,165,0],"orangered":[255,69,0],"orchid":[218,112,214],"palegoldenrod":[238,232,170],"palegreen":[152,251,152],"paleturquoise":[175,238,238],"palevioletred":[219,112,147],"papayawhip":[255,239,213],"peachpuff":[255,218,185],"peru":[205,133,63],"pink":[255,192,203],"plum":[221,160,221],"powderblue":[176,224,230],"purple":[128,0,128],"rebeccapurple":[102,51,153],"red":[255,0,0],"rosybrown":[188,143,143],"royalblue":[65,105,225],"saddlebrown":[139,69,19],"salmon":[250,128,114],"sandybrown":[244,164,96],"seagreen":[46,139,87],"seashell":[255,245,238],"sienna":[160,82,45],"silver":[192,192,192],"skyblue":[135,206,235],"slateblue":[106,90,205],"slategray":[112,128,144],"slategrey":[112,128,144],"snow":[255,250,250],"springgreen":[0,255,127],"steelblue":[70,130,180],"tan":[210,180,140],"teal":[0,128,128],"thistle":[216,191,216],"tomato":[255,99,71],"turquoise":[64,224,208],"violet":[238,130,238],"wheat":[245,222,179],"white":[255,255,255],"whitesmoke":[245,245,245],"yellow":[255,255,0],"yellowgreen":[154,205,50]};var conversions=createCommonjsModule(function(module){var reverseKeywords={};for(var key in colorName){if(colorName.hasOwnProperty(key)){reverseKeywords[colorName[key]]=key;}} var convert=module.exports={rgb:{channels:3,labels:'rgb'},hsl:{channels:3,labels:'hsl'},hsv:{channels:3,labels:'hsv'},hwb:{channels:3,labels:'hwb'},cmyk:{channels:4,labels:'cmyk'},xyz:{channels:3,labels:'xyz'},lab:{channels:3,labels:'lab'},lch:{channels:3,labels:'lch'},hex:{channels:1,labels:['hex']},keyword:{channels:1,labels:['keyword']},ansi16:{channels:1,labels:['ansi16']},ansi256:{channels:1,labels:['ansi256']},hcg:{channels:3,labels:['h','c','g']},apple:{channels:3,labels:['r16','g16','b16']},gray:{channels:1,labels:['gray']}};for(var model in convert){if(convert.hasOwnProperty(model)){if(!('channels'in convert[model])){throw new Error('missing channels property: '+model);} diff --git a/public/dist/scripts/app.js b/public/dist/scripts/app.js index 079dc0868..b3ac95c23 100644 --- a/public/dist/scripts/app.js +++ b/public/dist/scripts/app.js @@ -152,7 +152,7 @@ params=formData;break;} return new Promise(function(resolve,reject){let request=new XMLHttpRequest(),key;request.withCredentials=true;request.open(method,path,true);for(key in headers){if(headers.hasOwnProperty(key)){request.setRequestHeader(key,headers[key]);}} request.onload=function(){if(4===request.readyState&&399>=request.status){let data=request.response;let contentType=this.getResponseHeader('content-type');contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case'application/json':data=JSON.parse(data);break;} resolve(data);}else{reject(new Error(request.statusText));}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,false);} -request.onerror=function(){reject(new Error("Network Error"));};request.send(params);})};return{'get':function(path,headers={},params={}){return call('GET',path+((params.length>0)?'?'+buildQuery(params):''),headers,{});},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress);},'put':function(path,headers={},params={},progress=null){return call('PUT',headers,params,progress);},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress);},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress);},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let analytics={create:function(id,source,activity,url){return http.post('/analytics',{'content-type':'application/json'},{id:id,source:source,activity:activity,url:url,version:env.VERSION,setup:env.SETUP});},};return{analytics:analytics,};},true);})(window);(function(window){"use strict";window.ls.container.set('console',function(window){var sdk=new window.Appwrite();sdk.setEndpoint(APP_ENV.API).setProject('console').setLocale(APP_ENV.LOCALE);return sdk;},true);})(window);(function(window){"use strict";window.ls.container.set('date',function(){function format(format,timestamp){var jsdate,f +request.onerror=function(){reject(new Error("Network Error"));};request.send(params);})};return{'get':function(path,headers={},params={}){return call('GET',path+((params.length>0)?'?'+buildQuery(params):''),headers,{});},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress);},'put':function(path,headers={},params={},progress=null){return call('PUT',headers,params,progress);},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress);},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress);},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let analytics={create:function(id,source,activity,url){return http.post('/analytics',{'content-type':'application/json'},{id:id,source:source,activity:activity,url:url,version:env.VERSION,setup:env.SETUP});},};return{analytics:analytics,};},true);})(window);(function(window){"use strict";window.ls.container.set('console',function(window){var sdk=new window.Appwrite.Appwrite();sdk.setEndpoint(APP_ENV.ENDPOINT+APP_ENV.API).setProject('console').setLocale(APP_ENV.LOCALE);return sdk;},true);})(window);(function(window){"use strict";window.ls.container.set('date',function(){function format(format,timestamp){var jsdate,f var txtWords=['Sun','Mon','Tues','Wednes','Thurs','Fri','Satur','January','February','March','April','May','June','July','August','September','October','November','December'] var formatChr=/\\?(.?)/gi var formatChrCb=function(t,s){return f[t]?f[t]():s} @@ -281,7 +281,7 @@ return slf.renderToken(tokens,idx,opts);} md.renderer.rules.strong_open=renderEm;md.renderer.rules.strong_close=renderEm;return md;},true);})(window);(function(window){"use strict";window.ls.container.set('rtl',function(){var rtlStock="^ا^ب^ت^ث^ج^ح^خ^د^ذ^ر^ز^س^ش^ص^ض^ط^ظ^ع^غ^ف^ق^ك^ل^م^ن^ه^و^ي^א^ב^ג^ד^ה^ו^ז^ח^ט^י^כ^ך^ל^מ^ם^נ^ן^ס^ע^פ^ף^צ^ץ^ק^ר^ש^ת^";var special=["\n"," "," ","״",'"',"_","'","!","@","#","$","^","&","%","*","(",")","+","=","-","[","]","\\","/","{","}","|",":","<",">","?",",",".","0","1","2","3","4","5","6","7","8","9"];var isRTL=function(value){for(var i=0;i __awaiter(this, void 0, void 0, function* () { + let path = '/account'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Account + * + * Use this endpoint to allow a new user to register a new account in your + * project. After the user registration completes successfully, you can use + * the [/account/verfication](/docs/client/account#accountCreateVerification) + * 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](/docs/client/account#accountCreateSession). + * + * @param {string} email + * @param {string} password + * @param {string} name + * @throws {AppwriteException} + * @returns {Promise} + */ + create: (email, password, name = '') => __awaiter(this, void 0, void 0, function* () { + if (email === undefined) { + throw new AppwriteException('Missing required parameter: "email"'); + } + if (password === undefined) { + throw new AppwriteException('Missing required parameter: "password"'); + } + let path = '/account'; + let payload = {}; + if (typeof email !== 'undefined') { + payload['email'] = email; + } + if (typeof password !== 'undefined') { + payload['password'] = password; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete Account + * + * Delete a currently logged in user account. Behind the scene, the user + * record is not deleted but permanently blocked from any access. This is done + * to avoid deleted accounts being overtaken by new users with the same email + * address. Any user-related resources like documents or storage files should + * be deleted separately. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + delete: () => __awaiter(this, void 0, void 0, function* () { + let path = '/account'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Account Email + * + * Update currently logged in user account email address. After changing user + * address, user confirmation status is being reset and a new confirmation + * mail is sent. For security measures, user password is required to complete + * this request. + * This endpoint can also be used to convert an anonymous account to a normal + * one, by passing an email address and a new password. + * + * @param {string} email + * @param {string} password + * @throws {AppwriteException} + * @returns {Promise} + */ + updateEmail: (email, password) => __awaiter(this, void 0, void 0, function* () { + if (email === undefined) { + throw new AppwriteException('Missing required parameter: "email"'); + } + if (password === undefined) { + throw new AppwriteException('Missing required parameter: "password"'); + } + let path = '/account/email'; + let payload = {}; + if (typeof email !== 'undefined') { + payload['email'] = email; + } + if (typeof password !== 'undefined') { + payload['password'] = password; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Account JWT + * + * 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. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + createJWT: () => __awaiter(this, void 0, void 0, function* () { + let path = '/account/jwt'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Account Logs + * + * Get currently logged in user list of latest security activity logs. Each + * log returns user IP address, location and date and time of log. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getLogs: () => __awaiter(this, void 0, void 0, function* () { + let path = '/account/logs'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Account Name + * + * Update currently logged in user account name. + * + * @param {string} name + * @throws {AppwriteException} + * @returns {Promise} + */ + updateName: (name) => __awaiter(this, void 0, void 0, function* () { + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + let path = '/account/name'; + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Account Password + * + * 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 and Team Invites, oldPassword is optional. + * + * @param {string} password + * @param {string} oldPassword + * @throws {AppwriteException} + * @returns {Promise} + */ + updatePassword: (password, oldPassword = '') => __awaiter(this, void 0, void 0, function* () { + if (password === undefined) { + throw new AppwriteException('Missing required parameter: "password"'); + } + let path = '/account/password'; + let payload = {}; + if (typeof password !== 'undefined') { + payload['password'] = password; + } + if (typeof oldPassword !== 'undefined') { + payload['oldPassword'] = oldPassword; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Account Preferences + * + * Get currently logged in user preferences as a key-value object. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getPrefs: () => __awaiter(this, void 0, void 0, function* () { + let path = '/account/prefs'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Account Preferences + * + * Update currently logged in user account preferences. You can pass only the + * specific settings you wish to update. + * + * @param {object} prefs + * @throws {AppwriteException} + * @returns {Promise} + */ + updatePrefs: (prefs) => __awaiter(this, void 0, void 0, function* () { + if (prefs === undefined) { + throw new AppwriteException('Missing required parameter: "prefs"'); + } + let path = '/account/prefs'; + let payload = {}; + if (typeof prefs !== 'undefined') { + payload['prefs'] = prefs; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Password Recovery + * + * Sends the user an email with a temporary secret key for password reset. + * When the user clicks the confirmation link he is redirected back to your + * app password reset URL with the secret key and email address values + * attached to the URL query string. Use the query string params to submit a + * request to the [PUT + * /account/recovery](/docs/client/account#accountUpdateRecovery) endpoint to + * complete the process. The verification link sent to the user's email + * address is valid for 1 hour. + * + * @param {string} email + * @param {string} url + * @throws {AppwriteException} + * @returns {Promise} + */ + createRecovery: (email, url) => __awaiter(this, void 0, void 0, function* () { + if (email === undefined) { + throw new AppwriteException('Missing required parameter: "email"'); + } + if (url === undefined) { + throw new AppwriteException('Missing required parameter: "url"'); + } + let path = '/account/recovery'; + let payload = {}; + if (typeof email !== 'undefined') { + payload['email'] = email; + } + if (typeof url !== 'undefined') { + payload['url'] = url; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Complete Password Recovery + * + * Use this endpoint to complete the user account password reset. Both the + * **userId** and **secret** arguments will be passed as query parameters to + * the redirect URL you have provided when sending your request to the [POST + * /account/recovery](/docs/client/account#accountCreateRecovery) endpoint. + * + * Please note that in order to avoid a [Redirect + * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) + * the only valid redirect URLs are the ones from domains you have set when + * adding your platforms in the console interface. + * + * @param {string} userId + * @param {string} secret + * @param {string} password + * @param {string} passwordAgain + * @throws {AppwriteException} + * @returns {Promise} + */ + updateRecovery: (userId, secret, password, passwordAgain) => __awaiter(this, void 0, void 0, function* () { + if (userId === undefined) { + throw new AppwriteException('Missing required parameter: "userId"'); + } + if (secret === undefined) { + throw new AppwriteException('Missing required parameter: "secret"'); + } + if (password === undefined) { + throw new AppwriteException('Missing required parameter: "password"'); + } + if (passwordAgain === undefined) { + throw new AppwriteException('Missing required parameter: "passwordAgain"'); + } + let path = '/account/recovery'; + let payload = {}; + if (typeof userId !== 'undefined') { + payload['userId'] = userId; + } + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } + if (typeof password !== 'undefined') { + payload['password'] = password; + } + if (typeof passwordAgain !== 'undefined') { + payload['passwordAgain'] = passwordAgain; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('put', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Account Sessions + * + * Get currently logged in user list of active sessions across different + * devices. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getSessions: () => __awaiter(this, void 0, void 0, function* () { + let path = '/account/sessions'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Account Session + * + * 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. + * + * @param {string} email + * @param {string} password + * @throws {AppwriteException} + * @returns {Promise} + */ + createSession: (email, password) => __awaiter(this, void 0, void 0, function* () { + if (email === undefined) { + throw new AppwriteException('Missing required parameter: "email"'); + } + if (password === undefined) { + throw new AppwriteException('Missing required parameter: "password"'); + } + let path = '/account/sessions'; + let payload = {}; + if (typeof email !== 'undefined') { + payload['email'] = email; + } + if (typeof password !== 'undefined') { + payload['password'] = password; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete All Account Sessions + * + * Delete all sessions from the user account and remove any sessions cookies + * from the end client. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteSessions: () => __awaiter(this, void 0, void 0, function* () { + let path = '/account/sessions'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Anonymous Session + * + * 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 + * account, you need to update its [email and + * password](/docs/client/account#accountUpdateEmail). + * + * @throws {AppwriteException} + * @returns {Promise} + */ + createAnonymousSession: () => __awaiter(this, void 0, void 0, function* () { + let path = '/account/sessions/anonymous'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Account Session with OAuth2 + * + * 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. + * + * @param {string} provider + * @param {string} success + * @param {string} failure + * @param {string[]} scopes + * @throws {AppwriteException} + * @returns {void|string} + */ + createOAuth2Session: (provider, success = 'https://appwrite.io/auth/oauth2/success', failure = 'https://appwrite.io/auth/oauth2/failure', scopes = []) => { + if (provider === undefined) { + throw new AppwriteException('Missing required parameter: "provider"'); + } + let path = '/account/sessions/oauth2/{provider}'.replace('{provider}', provider); + let payload = {}; + if (success) { + payload['success'] = success; + } + if (failure) { + payload['failure'] = failure; + } + if (scopes) { + payload['scopes'] = scopes; + } + const uri = new URL(this.config.endpoint + path); + payload['project'] = this.config.project; + for (const [key, value] of Object.entries(this.flatten(payload))) { + uri.searchParams.append(key, value); + } + if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) { + window.location.href = uri.toString(); + } + else { + return uri; + } + }, + /** + * Delete Account Session + * + * Use this endpoint to log out the currently logged in user from all their + * account sessions across all of their different devices. When using the + * option id argument, only the session unique ID provider will be deleted. + * + * @param {string} sessionId + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteSession: (sessionId) => __awaiter(this, void 0, void 0, function* () { + if (sessionId === undefined) { + throw new AppwriteException('Missing required parameter: "sessionId"'); + } + let path = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Email Verification + * + * Use this endpoint to send a verification message to your user email address + * to confirm they are the valid owners of that address. Both the **userId** + * and **secret** arguments will be passed as query parameters to the URL you + * have provided to be attached to the verification email. The provided URL + * should redirect the user back to your app and allow you to complete the + * verification process by verifying both the **userId** and **secret** + * parameters. Learn more about how to [complete the verification + * process](/docs/client/account#accountUpdateVerification). The verification + * link sent to the user's email address is valid for 7 days. + * + * Please note that in order to avoid a [Redirect + * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), + * the only valid redirect URLs are the ones from domains you have set when + * adding your platforms in the console interface. + * + * + * @param {string} url + * @throws {AppwriteException} + * @returns {Promise} + */ + createVerification: (url) => __awaiter(this, void 0, void 0, function* () { + if (url === undefined) { + throw new AppwriteException('Missing required parameter: "url"'); + } + let path = '/account/verification'; + let payload = {}; + if (typeof url !== 'undefined') { + payload['url'] = url; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Complete Email Verification + * + * Use this endpoint to complete the user email verification process. Use both + * the **userId** and **secret** parameters that were attached to your app URL + * to verify the user email ownership. If confirmed this route will return a + * 200 status code. + * + * @param {string} userId + * @param {string} secret + * @throws {AppwriteException} + * @returns {Promise} + */ + updateVerification: (userId, secret) => __awaiter(this, void 0, void 0, function* () { + if (userId === undefined) { + throw new AppwriteException('Missing required parameter: "userId"'); + } + if (secret === undefined) { + throw new AppwriteException('Missing required parameter: "secret"'); + } + let path = '/account/verification'; + let payload = {}; + if (typeof userId !== 'undefined') { + payload['userId'] = userId; + } + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('put', uri, { + 'content-type': 'application/json', + }, payload); + }) + }; + this.avatars = { + /** + * Get Browser Icon + * + * You can use this endpoint to show different browser icons to your users. + * The code argument receives the browser code as it appears in your user + * /account/sessions endpoint. Use width, height and quality arguments to + * change the output settings. + * + * @param {string} code + * @param {number} width + * @param {number} height + * @param {number} quality + * @throws {AppwriteException} + * @returns {URL} + */ + getBrowser: (code, width = 100, height = 100, quality = 100) => { + if (code === undefined) { + throw new AppwriteException('Missing required parameter: "code"'); + } + let path = '/avatars/browsers/{code}'.replace('{code}', code); + let payload = {}; + if (width) { + payload['width'] = width; + } + if (height) { + payload['height'] = height; + } + if (quality) { + payload['quality'] = quality; + } + const uri = new URL(this.config.endpoint + path); + payload['project'] = this.config.project; + for (const [key, value] of Object.entries(this.flatten(payload))) { + uri.searchParams.append(key, value); + } + return uri; + }, + /** + * Get Credit Card Icon + * + * The credit card endpoint will return you the icon of the credit card + * provider you need. Use width, height and quality arguments to change the + * output settings. + * + * @param {string} code + * @param {number} width + * @param {number} height + * @param {number} quality + * @throws {AppwriteException} + * @returns {URL} + */ + getCreditCard: (code, width = 100, height = 100, quality = 100) => { + if (code === undefined) { + throw new AppwriteException('Missing required parameter: "code"'); + } + let path = '/avatars/credit-cards/{code}'.replace('{code}', code); + let payload = {}; + if (width) { + payload['width'] = width; + } + if (height) { + payload['height'] = height; + } + if (quality) { + payload['quality'] = quality; + } + const uri = new URL(this.config.endpoint + path); + payload['project'] = this.config.project; + for (const [key, value] of Object.entries(this.flatten(payload))) { + uri.searchParams.append(key, value); + } + return uri; + }, + /** + * Get Favicon + * + * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote + * website URL. + * + * + * @param {string} url + * @throws {AppwriteException} + * @returns {URL} + */ + getFavicon: (url) => { + if (url === undefined) { + throw new AppwriteException('Missing required parameter: "url"'); + } + let path = '/avatars/favicon'; + let payload = {}; + if (url) { + payload['url'] = url; + } + const uri = new URL(this.config.endpoint + path); + payload['project'] = this.config.project; + for (const [key, value] of Object.entries(this.flatten(payload))) { + uri.searchParams.append(key, value); + } + return uri; + }, + /** + * Get Country Flag + * + * You can use this endpoint to show different country flags icons to your + * users. The code argument receives the 2 letter country code. Use width, + * height and quality arguments to change the output settings. + * + * @param {string} code + * @param {number} width + * @param {number} height + * @param {number} quality + * @throws {AppwriteException} + * @returns {URL} + */ + getFlag: (code, width = 100, height = 100, quality = 100) => { + if (code === undefined) { + throw new AppwriteException('Missing required parameter: "code"'); + } + let path = '/avatars/flags/{code}'.replace('{code}', code); + let payload = {}; + if (width) { + payload['width'] = width; + } + if (height) { + payload['height'] = height; + } + if (quality) { + payload['quality'] = quality; + } + const uri = new URL(this.config.endpoint + path); + payload['project'] = this.config.project; + for (const [key, value] of Object.entries(this.flatten(payload))) { + uri.searchParams.append(key, value); + } + return uri; + }, + /** + * Get Image from URL + * + * Use this endpoint to fetch a remote image URL and crop it to any image size + * you want. This endpoint is very useful if you need to crop and display + * remote images in your app or in case you want to make sure a 3rd party + * image is properly served using a TLS protocol. + * + * @param {string} url + * @param {number} width + * @param {number} height + * @throws {AppwriteException} + * @returns {URL} + */ + getImage: (url, width = 400, height = 400) => { + if (url === undefined) { + throw new AppwriteException('Missing required parameter: "url"'); + } + let path = '/avatars/image'; + let payload = {}; + if (url) { + payload['url'] = url; + } + if (width) { + payload['width'] = width; + } + if (height) { + payload['height'] = height; + } + const uri = new URL(this.config.endpoint + path); + payload['project'] = this.config.project; + for (const [key, value] of Object.entries(this.flatten(payload))) { + uri.searchParams.append(key, value); + } + return uri; + }, + /** + * Get User Initials + * + * Use this endpoint to show your user initials avatar icon on your website or + * app. By default, this route will try to print your logged-in user name or + * email initials. You can also overwrite the user name if you pass the 'name' + * parameter. If no name is given and no user is logged, an empty avatar will + * be returned. + * + * You can use the color and background params to change the avatar colors. By + * default, a random theme will be selected. The random theme will persist for + * the user's initials when reloading the same theme will always return for + * the same initials. + * + * @param {string} name + * @param {number} width + * @param {number} height + * @param {string} color + * @param {string} background + * @throws {AppwriteException} + * @returns {URL} + */ + getInitials: (name = '', width = 500, height = 500, color = '', background = '') => { + let path = '/avatars/initials'; + let payload = {}; + if (name) { + payload['name'] = name; + } + if (width) { + payload['width'] = width; + } + if (height) { + payload['height'] = height; + } + if (color) { + payload['color'] = color; + } + if (background) { + payload['background'] = background; + } + const uri = new URL(this.config.endpoint + path); + payload['project'] = this.config.project; + for (const [key, value] of Object.entries(this.flatten(payload))) { + uri.searchParams.append(key, value); + } + return uri; + }, + /** + * Get QR Code + * + * Converts a given plain text to a QR code image. You can use the query + * parameters to change the size and style of the resulting image. + * + * @param {string} text + * @param {number} size + * @param {number} margin + * @param {boolean} download + * @throws {AppwriteException} + * @returns {URL} + */ + getQR: (text, size = 400, margin = 1, download = false) => { + if (text === undefined) { + throw new AppwriteException('Missing required parameter: "text"'); + } + let path = '/avatars/qr'; + let payload = {}; + if (text) { + payload['text'] = text; + } + if (size) { + payload['size'] = size; + } + if (margin) { + payload['margin'] = margin; + } + if (download) { + payload['download'] = download; + } + const uri = new URL(this.config.endpoint + path); + payload['project'] = this.config.project; + for (const [key, value] of Object.entries(this.flatten(payload))) { + uri.searchParams.append(key, value); + } + return uri; + } + }; + this.database = { + /** + * List Collections + * + * Get a list of all the user collections. You can use the query params to + * filter your results. On admin mode, this endpoint will return a list of all + * of the project's collections. [Learn more about different API + * modes](/docs/admin). + * + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType + * @throws {AppwriteException} + * @returns {Promise} + */ + listCollections: (search = '', limit = 25, offset = 0, orderType = 'ASC') => __awaiter(this, void 0, void 0, function* () { + let path = '/database/collections'; + let payload = {}; + if (search) { + payload['search'] = search; + } + if (limit) { + payload['limit'] = limit; + } + if (offset) { + payload['offset'] = offset; + } + if (orderType) { + payload['orderType'] = orderType; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Collection + * + * Create a new Collection. + * + * @param {string} name + * @param {string[]} read + * @param {string[]} write + * @param {string[]} rules + * @throws {AppwriteException} + * @returns {Promise} + */ + createCollection: (name, read, write, rules) => __awaiter(this, void 0, void 0, function* () { + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (read === undefined) { + throw new AppwriteException('Missing required parameter: "read"'); + } + if (write === undefined) { + throw new AppwriteException('Missing required parameter: "write"'); + } + if (rules === undefined) { + throw new AppwriteException('Missing required parameter: "rules"'); + } + let path = '/database/collections'; + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof read !== 'undefined') { + payload['read'] = read; + } + if (typeof write !== 'undefined') { + payload['write'] = write; + } + if (typeof rules !== 'undefined') { + payload['rules'] = rules; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Collection + * + * Get a collection by its unique ID. This endpoint response returns a JSON + * object with the collection metadata. + * + * @param {string} collectionId + * @throws {AppwriteException} + * @returns {Promise} + */ + getCollection: (collectionId) => __awaiter(this, void 0, void 0, function* () { + if (collectionId === undefined) { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + let path = '/database/collections/{collectionId}'.replace('{collectionId}', collectionId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Collection + * + * Update a collection by its unique ID. + * + * @param {string} collectionId + * @param {string} name + * @param {string[]} read + * @param {string[]} write + * @param {string[]} rules + * @throws {AppwriteException} + * @returns {Promise} + */ + updateCollection: (collectionId, name, read = [], write = [], rules = []) => __awaiter(this, void 0, void 0, function* () { + if (collectionId === undefined) { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + let path = '/database/collections/{collectionId}'.replace('{collectionId}', collectionId); + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof read !== 'undefined') { + payload['read'] = read; + } + if (typeof write !== 'undefined') { + payload['write'] = write; + } + if (typeof rules !== 'undefined') { + payload['rules'] = rules; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('put', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete Collection + * + * Delete a collection by its unique ID. Only users with write permissions + * have access to delete this resource. + * + * @param {string} collectionId + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteCollection: (collectionId) => __awaiter(this, void 0, void 0, function* () { + if (collectionId === undefined) { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + let path = '/database/collections/{collectionId}'.replace('{collectionId}', collectionId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * List Documents + * + * Get a list of all the user documents. You can use the query params to + * filter your results. On admin mode, this endpoint will return a list of all + * of the project's documents. [Learn more about different API + * modes](/docs/admin). + * + * @param {string} collectionId + * @param {string[]} filters + * @param {number} limit + * @param {number} offset + * @param {string} orderField + * @param {string} orderType + * @param {string} orderCast + * @param {string} search + * @throws {AppwriteException} + * @returns {Promise} + */ + listDocuments: (collectionId, filters = [], limit = 25, offset = 0, orderField = '', orderType = 'ASC', orderCast = 'string', search = '') => __awaiter(this, void 0, void 0, function* () { + if (collectionId === undefined) { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + let path = '/database/collections/{collectionId}/documents'.replace('{collectionId}', collectionId); + let payload = {}; + if (filters) { + payload['filters'] = filters; + } + if (limit) { + payload['limit'] = limit; + } + if (offset) { + payload['offset'] = offset; + } + if (orderField) { + payload['orderField'] = orderField; + } + if (orderType) { + payload['orderType'] = orderType; + } + if (orderCast) { + payload['orderCast'] = orderCast; + } + if (search) { + payload['search'] = search; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Document + * + * Create a new Document. Before using this route, you should create a new + * collection resource using either a [server + * integration](/docs/server/database#databaseCreateCollection) API or + * directly from your database console. + * + * @param {string} collectionId + * @param {object} data + * @param {string[]} read + * @param {string[]} write + * @param {string} parentDocument + * @param {string} parentProperty + * @param {string} parentPropertyType + * @throws {AppwriteException} + * @returns {Promise} + */ + createDocument: (collectionId, data, read = [], write = [], parentDocument = '', parentProperty = '', parentPropertyType = 'assign') => __awaiter(this, void 0, void 0, function* () { + if (collectionId === undefined) { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (data === undefined) { + throw new AppwriteException('Missing required parameter: "data"'); + } + let path = '/database/collections/{collectionId}/documents'.replace('{collectionId}', collectionId); + let payload = {}; + if (typeof data !== 'undefined') { + payload['data'] = data; + } + if (typeof read !== 'undefined') { + payload['read'] = read; + } + if (typeof write !== 'undefined') { + payload['write'] = write; + } + if (typeof parentDocument !== 'undefined') { + payload['parentDocument'] = parentDocument; + } + if (typeof parentProperty !== 'undefined') { + payload['parentProperty'] = parentProperty; + } + if (typeof parentPropertyType !== 'undefined') { + payload['parentPropertyType'] = parentPropertyType; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Document + * + * Get a document by its unique ID. This endpoint response returns a JSON + * object with the document data. + * + * @param {string} collectionId + * @param {string} documentId + * @throws {AppwriteException} + * @returns {Promise} + */ + getDocument: (collectionId, documentId) => __awaiter(this, void 0, void 0, function* () { + if (collectionId === undefined) { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (documentId === undefined) { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + let path = '/database/collections/{collectionId}/documents/{documentId}'.replace('{collectionId}', collectionId).replace('{documentId}', documentId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Document + * + * Update a document by its unique ID. Using the patch method you can pass + * only specific fields that will get updated. + * + * @param {string} collectionId + * @param {string} documentId + * @param {object} data + * @param {string[]} read + * @param {string[]} write + * @throws {AppwriteException} + * @returns {Promise} + */ + updateDocument: (collectionId, documentId, data, read = [], write = []) => __awaiter(this, void 0, void 0, function* () { + if (collectionId === undefined) { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (documentId === undefined) { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + if (data === undefined) { + throw new AppwriteException('Missing required parameter: "data"'); + } + let path = '/database/collections/{collectionId}/documents/{documentId}'.replace('{collectionId}', collectionId).replace('{documentId}', documentId); + let payload = {}; + if (typeof data !== 'undefined') { + payload['data'] = data; + } + if (typeof read !== 'undefined') { + payload['read'] = read; + } + if (typeof write !== 'undefined') { + payload['write'] = write; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete Document + * + * Delete a document by its unique ID. This endpoint deletes only the parent + * documents, its attributes and relations to other documents. Child documents + * **will not** be deleted. + * + * @param {string} collectionId + * @param {string} documentId + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteDocument: (collectionId, documentId) => __awaiter(this, void 0, void 0, function* () { + if (collectionId === undefined) { + throw new AppwriteException('Missing required parameter: "collectionId"'); + } + if (documentId === undefined) { + throw new AppwriteException('Missing required parameter: "documentId"'); + } + let path = '/database/collections/{collectionId}/documents/{documentId}'.replace('{collectionId}', collectionId).replace('{documentId}', documentId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }) + }; + this.functions = { + /** + * List Functions + * + * Get a list of all the project's functions. You can use the query params to + * filter your results. + * + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType + * @throws {AppwriteException} + * @returns {Promise} + */ + list: (search = '', limit = 25, offset = 0, orderType = 'ASC') => __awaiter(this, void 0, void 0, function* () { + let path = '/functions'; + let payload = {}; + if (search) { + payload['search'] = search; + } + if (limit) { + payload['limit'] = limit; + } + if (offset) { + payload['offset'] = offset; + } + if (orderType) { + payload['orderType'] = orderType; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Function + * + * Create a new function. You can pass a list of + * [permissions](/docs/permissions) to allow different project users or team + * with access to execute the function using the client API. + * + * @param {string} name + * @param {string[]} execute + * @param {string} env + * @param {object} vars + * @param {string[]} events + * @param {string} schedule + * @param {number} timeout + * @throws {AppwriteException} + * @returns {Promise} + */ + create: (name, execute, env, vars = {}, events = [], schedule = '', timeout = 15) => __awaiter(this, void 0, void 0, function* () { + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (execute === undefined) { + throw new AppwriteException('Missing required parameter: "execute"'); + } + if (env === undefined) { + throw new AppwriteException('Missing required parameter: "env"'); + } + let path = '/functions'; + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof execute !== 'undefined') { + payload['execute'] = execute; + } + if (typeof env !== 'undefined') { + payload['env'] = env; + } + if (typeof vars !== 'undefined') { + payload['vars'] = vars; + } + if (typeof events !== 'undefined') { + payload['events'] = events; + } + if (typeof schedule !== 'undefined') { + payload['schedule'] = schedule; + } + if (typeof timeout !== 'undefined') { + payload['timeout'] = timeout; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Function + * + * Get a function by its unique ID. + * + * @param {string} functionId + * @throws {AppwriteException} + * @returns {Promise} + */ + get: (functionId) => __awaiter(this, void 0, void 0, function* () { + if (functionId === undefined) { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + let path = '/functions/{functionId}'.replace('{functionId}', functionId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Function + * + * Update function by its unique ID. + * + * @param {string} functionId + * @param {string} name + * @param {string[]} execute + * @param {object} vars + * @param {string[]} events + * @param {string} schedule + * @param {number} timeout + * @throws {AppwriteException} + * @returns {Promise} + */ + update: (functionId, name, execute, vars = {}, events = [], schedule = '', timeout = 15) => __awaiter(this, void 0, void 0, function* () { + if (functionId === undefined) { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (execute === undefined) { + throw new AppwriteException('Missing required parameter: "execute"'); + } + let path = '/functions/{functionId}'.replace('{functionId}', functionId); + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof execute !== 'undefined') { + payload['execute'] = execute; + } + if (typeof vars !== 'undefined') { + payload['vars'] = vars; + } + if (typeof events !== 'undefined') { + payload['events'] = events; + } + if (typeof schedule !== 'undefined') { + payload['schedule'] = schedule; + } + if (typeof timeout !== 'undefined') { + payload['timeout'] = timeout; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('put', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete Function + * + * Delete a function by its unique ID. + * + * @param {string} functionId + * @throws {AppwriteException} + * @returns {Promise} + */ + delete: (functionId) => __awaiter(this, void 0, void 0, function* () { + if (functionId === undefined) { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + let path = '/functions/{functionId}'.replace('{functionId}', functionId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * List Executions + * + * Get a list of all the current user function execution logs. You can use the + * query params to filter your results. On admin mode, this endpoint will + * return a list of all of the project's executions. [Learn more about + * different API modes](/docs/admin). + * + * @param {string} functionId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType + * @throws {AppwriteException} + * @returns {Promise} + */ + listExecutions: (functionId, search = '', limit = 25, offset = 0, orderType = 'ASC') => __awaiter(this, void 0, void 0, function* () { + if (functionId === undefined) { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + let path = '/functions/{functionId}/executions'.replace('{functionId}', functionId); + let payload = {}; + if (search) { + payload['search'] = search; + } + if (limit) { + payload['limit'] = limit; + } + if (offset) { + payload['offset'] = offset; + } + if (orderType) { + payload['orderType'] = orderType; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Execution + * + * 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. + * + * @param {string} functionId + * @param {string} data + * @throws {AppwriteException} + * @returns {Promise} + */ + createExecution: (functionId, data = '') => __awaiter(this, void 0, void 0, function* () { + if (functionId === undefined) { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + let path = '/functions/{functionId}/executions'.replace('{functionId}', functionId); + let payload = {}; + if (typeof data !== 'undefined') { + payload['data'] = data; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Execution + * + * Get a function execution log by its unique ID. + * + * @param {string} functionId + * @param {string} executionId + * @throws {AppwriteException} + * @returns {Promise} + */ + getExecution: (functionId, executionId) => __awaiter(this, void 0, void 0, function* () { + if (functionId === undefined) { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + if (executionId === undefined) { + throw new AppwriteException('Missing required parameter: "executionId"'); + } + let path = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Function Tag + * + * Update the function code tag ID using the unique function ID. Use this + * endpoint to switch the code tag that should be executed by the execution + * endpoint. + * + * @param {string} functionId + * @param {string} tag + * @throws {AppwriteException} + * @returns {Promise} + */ + updateTag: (functionId, tag) => __awaiter(this, void 0, void 0, function* () { + if (functionId === undefined) { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + if (tag === undefined) { + throw new AppwriteException('Missing required parameter: "tag"'); + } + let path = '/functions/{functionId}/tag'.replace('{functionId}', functionId); + let payload = {}; + if (typeof tag !== 'undefined') { + payload['tag'] = tag; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * List Tags + * + * Get a list of all the project's code tags. You can use the query params to + * filter your results. + * + * @param {string} functionId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType + * @throws {AppwriteException} + * @returns {Promise} + */ + listTags: (functionId, search = '', limit = 25, offset = 0, orderType = 'ASC') => __awaiter(this, void 0, void 0, function* () { + if (functionId === undefined) { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + let path = '/functions/{functionId}/tags'.replace('{functionId}', functionId); + let payload = {}; + if (search) { + payload['search'] = search; + } + if (limit) { + payload['limit'] = limit; + } + if (offset) { + payload['offset'] = offset; + } + if (orderType) { + payload['orderType'] = orderType; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Tag + * + * Create a new function code tag. Use this endpoint to upload a new version + * of your code function. To execute your newly uploaded code, you'll need to + * update the function's tag to use your new tag UID. + * + * This endpoint accepts a tar.gz file compressed with your code. Make sure to + * include any dependencies your code has within the compressed file. You can + * learn more about code packaging in the [Appwrite Cloud Functions + * tutorial](/docs/functions). + * + * Use the "command" param to set the entry point used to execute your code. + * + * @param {string} functionId + * @param {string} command + * @param {File} code + * @throws {AppwriteException} + * @returns {Promise} + */ + createTag: (functionId, command, code) => __awaiter(this, void 0, void 0, function* () { + if (functionId === undefined) { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + if (command === undefined) { + throw new AppwriteException('Missing required parameter: "command"'); + } + if (code === undefined) { + throw new AppwriteException('Missing required parameter: "code"'); + } + let path = '/functions/{functionId}/tags'.replace('{functionId}', functionId); + let payload = {}; + if (typeof command !== 'undefined') { + payload['command'] = command; + } + if (typeof code !== 'undefined') { + payload['code'] = code; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'multipart/form-data', + }, payload); + }), + /** + * Get Tag + * + * Get a code tag by its unique ID. + * + * @param {string} functionId + * @param {string} tagId + * @throws {AppwriteException} + * @returns {Promise} + */ + getTag: (functionId, tagId) => __awaiter(this, void 0, void 0, function* () { + if (functionId === undefined) { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + if (tagId === undefined) { + throw new AppwriteException('Missing required parameter: "tagId"'); + } + let path = '/functions/{functionId}/tags/{tagId}'.replace('{functionId}', functionId).replace('{tagId}', tagId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete Tag + * + * Delete a code tag by its unique ID. + * + * @param {string} functionId + * @param {string} tagId + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteTag: (functionId, tagId) => __awaiter(this, void 0, void 0, function* () { + if (functionId === undefined) { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + if (tagId === undefined) { + throw new AppwriteException('Missing required parameter: "tagId"'); + } + let path = '/functions/{functionId}/tags/{tagId}'.replace('{functionId}', functionId).replace('{tagId}', tagId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Function Usage + * + * + * @param {string} functionId + * @param {string} range + * @throws {AppwriteException} + * @returns {Promise} + */ + getUsage: (functionId, range = '30d') => __awaiter(this, void 0, void 0, function* () { + if (functionId === undefined) { + throw new AppwriteException('Missing required parameter: "functionId"'); + } + let path = '/functions/{functionId}/usage'.replace('{functionId}', functionId); + let payload = {}; + if (range) { + payload['range'] = range; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }) + }; + this.health = { + /** + * Get HTTP + * + * Check the Appwrite HTTP server is up and responsive. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + get: () => __awaiter(this, void 0, void 0, function* () { + let path = '/health'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Anti virus + * + * Check the Appwrite Anti Virus server is up and connection is successful. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getAntiVirus: () => __awaiter(this, void 0, void 0, function* () { + let path = '/health/anti-virus'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Cache + * + * Check the Appwrite in-memory cache server is up and connection is + * successful. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getCache: () => __awaiter(this, void 0, void 0, function* () { + let path = '/health/cache'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get DB + * + * Check the Appwrite database server is up and connection is successful. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getDB: () => __awaiter(this, void 0, void 0, function* () { + let path = '/health/db'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Certificate Queue + * + * Get the number of certificates that are waiting to be issued against + * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue + * server. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueueCertificates: () => __awaiter(this, void 0, void 0, function* () { + let path = '/health/queue/certificates'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Functions Queue + * + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueueFunctions: () => __awaiter(this, void 0, void 0, function* () { + let path = '/health/queue/functions'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Logs Queue + * + * Get the number of logs that are waiting to be processed in the Appwrite + * internal queue server. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueueLogs: () => __awaiter(this, void 0, void 0, function* () { + let path = '/health/queue/logs'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Tasks Queue + * + * Get the number of tasks that are waiting to be processed in the Appwrite + * internal queue server. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueueTasks: () => __awaiter(this, void 0, void 0, function* () { + let path = '/health/queue/tasks'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Usage Queue + * + * Get the number of usage stats that are waiting to be processed in the + * Appwrite internal queue server. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueueUsage: () => __awaiter(this, void 0, void 0, function* () { + let path = '/health/queue/usage'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Webhooks Queue + * + * Get the number of webhooks that are waiting to be processed in the Appwrite + * internal queue server. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getQueueWebhooks: () => __awaiter(this, void 0, void 0, function* () { + let path = '/health/queue/webhooks'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Local Storage + * + * Check the Appwrite local storage device is up and connection is successful. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getStorageLocal: () => __awaiter(this, void 0, void 0, function* () { + let path = '/health/storage/local'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Time + * + * 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. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getTime: () => __awaiter(this, void 0, void 0, function* () { + let path = '/health/time'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }) + }; + this.locale = { + /** + * Get User Locale + * + * Get the current user location based on IP. Returns an object with user + * country code, country name, continent name, continent code, ip address and + * suggested currency. You can use the locale header to get the data in a + * supported language. + * + * ([IP Geolocation by DB-IP](https://db-ip.com)) + * + * @throws {AppwriteException} + * @returns {Promise} + */ + get: () => __awaiter(this, void 0, void 0, function* () { + let path = '/locale'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * List Continents + * + * List of all continents. You can use the locale header to get the data in a + * supported language. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getContinents: () => __awaiter(this, void 0, void 0, function* () { + let path = '/locale/continents'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * List Countries + * + * List of all countries. You can use the locale header to get the data in a + * supported language. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getCountries: () => __awaiter(this, void 0, void 0, function* () { + let path = '/locale/countries'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * List EU Countries + * + * List of all countries that are currently members of the EU. You can use the + * locale header to get the data in a supported language. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getCountriesEU: () => __awaiter(this, void 0, void 0, function* () { + let path = '/locale/countries/eu'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * List Countries Phone Codes + * + * List of all countries phone codes. You can use the locale header to get the + * data in a supported language. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getCountriesPhones: () => __awaiter(this, void 0, void 0, function* () { + let path = '/locale/countries/phones'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * List Currencies + * + * List of all currencies, including currency symbol, name, plural, and + * decimal digits for all major and minor currencies. You can use the locale + * header to get the data in a supported language. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getCurrencies: () => __awaiter(this, void 0, void 0, function* () { + let path = '/locale/currencies'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * List Languages + * + * List of all languages classified by ISO 639-1 including 2-letter code, name + * in English, and name in the respective language. + * + * @throws {AppwriteException} + * @returns {Promise} + */ + getLanguages: () => __awaiter(this, void 0, void 0, function* () { + let path = '/locale/languages'; + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }) + }; + this.projects = { + /** + * List Projects + * + * + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType + * @throws {AppwriteException} + * @returns {Promise} + */ + list: (search = '', limit = 25, offset = 0, orderType = 'ASC') => __awaiter(this, void 0, void 0, function* () { + let path = '/projects'; + let payload = {}; + if (search) { + payload['search'] = search; + } + if (limit) { + payload['limit'] = limit; + } + if (offset) { + payload['offset'] = offset; + } + if (orderType) { + payload['orderType'] = orderType; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Project + * + * + * @param {string} name + * @param {string} teamId + * @param {string} description + * @param {string} logo + * @param {string} url + * @param {string} legalName + * @param {string} legalCountry + * @param {string} legalState + * @param {string} legalCity + * @param {string} legalAddress + * @param {string} legalTaxId + * @throws {AppwriteException} + * @returns {Promise} + */ + create: (name, teamId, description = '', logo = '', url = '', legalName = '', legalCountry = '', legalState = '', legalCity = '', legalAddress = '', legalTaxId = '') => __awaiter(this, void 0, void 0, function* () { + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (teamId === undefined) { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + let path = '/projects'; + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof teamId !== 'undefined') { + payload['teamId'] = teamId; + } + if (typeof description !== 'undefined') { + payload['description'] = description; + } + if (typeof logo !== 'undefined') { + payload['logo'] = logo; + } + if (typeof url !== 'undefined') { + payload['url'] = url; + } + if (typeof legalName !== 'undefined') { + payload['legalName'] = legalName; + } + if (typeof legalCountry !== 'undefined') { + payload['legalCountry'] = legalCountry; + } + if (typeof legalState !== 'undefined') { + payload['legalState'] = legalState; + } + if (typeof legalCity !== 'undefined') { + payload['legalCity'] = legalCity; + } + if (typeof legalAddress !== 'undefined') { + payload['legalAddress'] = legalAddress; + } + if (typeof legalTaxId !== 'undefined') { + payload['legalTaxId'] = legalTaxId; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Project + * + * + * @param {string} projectId + * @throws {AppwriteException} + * @returns {Promise} + */ + get: (projectId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + let path = '/projects/{projectId}'.replace('{projectId}', projectId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Project + * + * + * @param {string} projectId + * @param {string} name + * @param {string} description + * @param {string} logo + * @param {string} url + * @param {string} legalName + * @param {string} legalCountry + * @param {string} legalState + * @param {string} legalCity + * @param {string} legalAddress + * @param {string} legalTaxId + * @throws {AppwriteException} + * @returns {Promise} + */ + update: (projectId, name, description = '', logo = '', url = '', legalName = '', legalCountry = '', legalState = '', legalCity = '', legalAddress = '', legalTaxId = '') => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + let path = '/projects/{projectId}'.replace('{projectId}', projectId); + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof description !== 'undefined') { + payload['description'] = description; + } + if (typeof logo !== 'undefined') { + payload['logo'] = logo; + } + if (typeof url !== 'undefined') { + payload['url'] = url; + } + if (typeof legalName !== 'undefined') { + payload['legalName'] = legalName; + } + if (typeof legalCountry !== 'undefined') { + payload['legalCountry'] = legalCountry; + } + if (typeof legalState !== 'undefined') { + payload['legalState'] = legalState; + } + if (typeof legalCity !== 'undefined') { + payload['legalCity'] = legalCity; + } + if (typeof legalAddress !== 'undefined') { + payload['legalAddress'] = legalAddress; + } + if (typeof legalTaxId !== 'undefined') { + payload['legalTaxId'] = legalTaxId; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete Project + * + * + * @param {string} projectId + * @param {string} password + * @throws {AppwriteException} + * @returns {Promise} + */ + delete: (projectId, password) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (password === undefined) { + throw new AppwriteException('Missing required parameter: "password"'); + } + let path = '/projects/{projectId}'.replace('{projectId}', projectId); + let payload = {}; + if (typeof password !== 'undefined') { + payload['password'] = password; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Project users limit + * + * + * @param {string} projectId + * @param {string} limit + * @throws {AppwriteException} + * @returns {Promise} + */ + updateAuthLimit: (projectId, limit) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (limit === undefined) { + throw new AppwriteException('Missing required parameter: "limit"'); + } + let path = '/projects/{projectId}/auth/limit'.replace('{projectId}', projectId); + let payload = {}; + if (typeof limit !== 'undefined') { + payload['limit'] = limit; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Project auth method status. Use this endpoint to enable or disable a given auth method for this project. + * + * + * @param {string} projectId + * @param {string} method + * @param {boolean} status + * @throws {AppwriteException} + * @returns {Promise} + */ + updateAuthStatus: (projectId, method, status) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (method === undefined) { + throw new AppwriteException('Missing required parameter: "method"'); + } + if (status === undefined) { + throw new AppwriteException('Missing required parameter: "status"'); + } + let path = '/projects/{projectId}/auth/{method}'.replace('{projectId}', projectId).replace('{method}', method); + let payload = {}; + if (typeof status !== 'undefined') { + payload['status'] = status; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * List Domains + * + * + * @param {string} projectId + * @throws {AppwriteException} + * @returns {Promise} + */ + listDomains: (projectId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + let path = '/projects/{projectId}/domains'.replace('{projectId}', projectId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Domain + * + * + * @param {string} projectId + * @param {string} domain + * @throws {AppwriteException} + * @returns {Promise} + */ + createDomain: (projectId, domain) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (domain === undefined) { + throw new AppwriteException('Missing required parameter: "domain"'); + } + let path = '/projects/{projectId}/domains'.replace('{projectId}', projectId); + let payload = {}; + if (typeof domain !== 'undefined') { + payload['domain'] = domain; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Domain + * + * + * @param {string} projectId + * @param {string} domainId + * @throws {AppwriteException} + * @returns {Promise} + */ + getDomain: (projectId, domainId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (domainId === undefined) { + throw new AppwriteException('Missing required parameter: "domainId"'); + } + let path = '/projects/{projectId}/domains/{domainId}'.replace('{projectId}', projectId).replace('{domainId}', domainId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete Domain + * + * + * @param {string} projectId + * @param {string} domainId + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteDomain: (projectId, domainId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (domainId === undefined) { + throw new AppwriteException('Missing required parameter: "domainId"'); + } + let path = '/projects/{projectId}/domains/{domainId}'.replace('{projectId}', projectId).replace('{domainId}', domainId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Domain Verification Status + * + * + * @param {string} projectId + * @param {string} domainId + * @throws {AppwriteException} + * @returns {Promise} + */ + updateDomainVerification: (projectId, domainId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (domainId === undefined) { + throw new AppwriteException('Missing required parameter: "domainId"'); + } + let path = '/projects/{projectId}/domains/{domainId}/verification'.replace('{projectId}', projectId).replace('{domainId}', domainId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * List Keys + * + * + * @param {string} projectId + * @throws {AppwriteException} + * @returns {Promise} + */ + listKeys: (projectId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + let path = '/projects/{projectId}/keys'.replace('{projectId}', projectId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Key + * + * + * @param {string} projectId + * @param {string} name + * @param {string[]} scopes + * @throws {AppwriteException} + * @returns {Promise} + */ + createKey: (projectId, name, scopes) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (scopes === undefined) { + throw new AppwriteException('Missing required parameter: "scopes"'); + } + let path = '/projects/{projectId}/keys'.replace('{projectId}', projectId); + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof scopes !== 'undefined') { + payload['scopes'] = scopes; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Key + * + * + * @param {string} projectId + * @param {string} keyId + * @throws {AppwriteException} + * @returns {Promise} + */ + getKey: (projectId, keyId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (keyId === undefined) { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + let path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Key + * + * + * @param {string} projectId + * @param {string} keyId + * @param {string} name + * @param {string[]} scopes + * @throws {AppwriteException} + * @returns {Promise} + */ + updateKey: (projectId, keyId, name, scopes) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (keyId === undefined) { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (scopes === undefined) { + throw new AppwriteException('Missing required parameter: "scopes"'); + } + let path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId); + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof scopes !== 'undefined') { + payload['scopes'] = scopes; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('put', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete Key + * + * + * @param {string} projectId + * @param {string} keyId + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteKey: (projectId, keyId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (keyId === undefined) { + throw new AppwriteException('Missing required parameter: "keyId"'); + } + let path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Project OAuth2 + * + * + * @param {string} projectId + * @param {string} provider + * @param {string} appId + * @param {string} secret + * @throws {AppwriteException} + * @returns {Promise} + */ + updateOAuth2: (projectId, provider, appId = '', secret = '') => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (provider === undefined) { + throw new AppwriteException('Missing required parameter: "provider"'); + } + let path = '/projects/{projectId}/oauth2'.replace('{projectId}', projectId); + let payload = {}; + if (typeof provider !== 'undefined') { + payload['provider'] = provider; + } + if (typeof appId !== 'undefined') { + payload['appId'] = appId; + } + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * List Platforms + * + * + * @param {string} projectId + * @throws {AppwriteException} + * @returns {Promise} + */ + listPlatforms: (projectId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + let path = '/projects/{projectId}/platforms'.replace('{projectId}', projectId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Platform + * + * + * @param {string} projectId + * @param {string} type + * @param {string} name + * @param {string} key + * @param {string} store + * @param {string} hostname + * @throws {AppwriteException} + * @returns {Promise} + */ + createPlatform: (projectId, type, name, key = '', store = '', hostname = '') => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (type === undefined) { + throw new AppwriteException('Missing required parameter: "type"'); + } + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + let path = '/projects/{projectId}/platforms'.replace('{projectId}', projectId); + let payload = {}; + if (typeof type !== 'undefined') { + payload['type'] = type; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof store !== 'undefined') { + payload['store'] = store; + } + if (typeof hostname !== 'undefined') { + payload['hostname'] = hostname; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Platform + * + * + * @param {string} projectId + * @param {string} platformId + * @throws {AppwriteException} + * @returns {Promise} + */ + getPlatform: (projectId, platformId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (platformId === undefined) { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + let path = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Platform + * + * + * @param {string} projectId + * @param {string} platformId + * @param {string} name + * @param {string} key + * @param {string} store + * @param {string} hostname + * @throws {AppwriteException} + * @returns {Promise} + */ + updatePlatform: (projectId, platformId, name, key = '', store = '', hostname = '') => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (platformId === undefined) { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + let path = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId); + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof key !== 'undefined') { + payload['key'] = key; + } + if (typeof store !== 'undefined') { + payload['store'] = store; + } + if (typeof hostname !== 'undefined') { + payload['hostname'] = hostname; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('put', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete Platform + * + * + * @param {string} projectId + * @param {string} platformId + * @throws {AppwriteException} + * @returns {Promise} + */ + deletePlatform: (projectId, platformId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (platformId === undefined) { + throw new AppwriteException('Missing required parameter: "platformId"'); + } + let path = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * List Tasks + * + * + * @param {string} projectId + * @throws {AppwriteException} + * @returns {Promise} + */ + listTasks: (projectId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + let path = '/projects/{projectId}/tasks'.replace('{projectId}', projectId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Task + * + * + * @param {string} projectId + * @param {string} name + * @param {string} status + * @param {string} schedule + * @param {boolean} security + * @param {string} httpMethod + * @param {string} httpUrl + * @param {string[]} httpHeaders + * @param {string} httpUser + * @param {string} httpPass + * @throws {AppwriteException} + * @returns {Promise} + */ + createTask: (projectId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = [], httpUser = '', httpPass = '') => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (status === undefined) { + throw new AppwriteException('Missing required parameter: "status"'); + } + if (schedule === undefined) { + throw new AppwriteException('Missing required parameter: "schedule"'); + } + if (security === undefined) { + throw new AppwriteException('Missing required parameter: "security"'); + } + if (httpMethod === undefined) { + throw new AppwriteException('Missing required parameter: "httpMethod"'); + } + if (httpUrl === undefined) { + throw new AppwriteException('Missing required parameter: "httpUrl"'); + } + let path = '/projects/{projectId}/tasks'.replace('{projectId}', projectId); + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof status !== 'undefined') { + payload['status'] = status; + } + if (typeof schedule !== 'undefined') { + payload['schedule'] = schedule; + } + if (typeof security !== 'undefined') { + payload['security'] = security; + } + if (typeof httpMethod !== 'undefined') { + payload['httpMethod'] = httpMethod; + } + if (typeof httpUrl !== 'undefined') { + payload['httpUrl'] = httpUrl; + } + if (typeof httpHeaders !== 'undefined') { + payload['httpHeaders'] = httpHeaders; + } + if (typeof httpUser !== 'undefined') { + payload['httpUser'] = httpUser; + } + if (typeof httpPass !== 'undefined') { + payload['httpPass'] = httpPass; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Task + * + * + * @param {string} projectId + * @param {string} taskId + * @throws {AppwriteException} + * @returns {Promise} + */ + getTask: (projectId, taskId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (taskId === undefined) { + throw new AppwriteException('Missing required parameter: "taskId"'); + } + let path = '/projects/{projectId}/tasks/{taskId}'.replace('{projectId}', projectId).replace('{taskId}', taskId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Task + * + * + * @param {string} projectId + * @param {string} taskId + * @param {string} name + * @param {string} status + * @param {string} schedule + * @param {boolean} security + * @param {string} httpMethod + * @param {string} httpUrl + * @param {string[]} httpHeaders + * @param {string} httpUser + * @param {string} httpPass + * @throws {AppwriteException} + * @returns {Promise} + */ + updateTask: (projectId, taskId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = [], httpUser = '', httpPass = '') => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (taskId === undefined) { + throw new AppwriteException('Missing required parameter: "taskId"'); + } + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (status === undefined) { + throw new AppwriteException('Missing required parameter: "status"'); + } + if (schedule === undefined) { + throw new AppwriteException('Missing required parameter: "schedule"'); + } + if (security === undefined) { + throw new AppwriteException('Missing required parameter: "security"'); + } + if (httpMethod === undefined) { + throw new AppwriteException('Missing required parameter: "httpMethod"'); + } + if (httpUrl === undefined) { + throw new AppwriteException('Missing required parameter: "httpUrl"'); + } + let path = '/projects/{projectId}/tasks/{taskId}'.replace('{projectId}', projectId).replace('{taskId}', taskId); + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof status !== 'undefined') { + payload['status'] = status; + } + if (typeof schedule !== 'undefined') { + payload['schedule'] = schedule; + } + if (typeof security !== 'undefined') { + payload['security'] = security; + } + if (typeof httpMethod !== 'undefined') { + payload['httpMethod'] = httpMethod; + } + if (typeof httpUrl !== 'undefined') { + payload['httpUrl'] = httpUrl; + } + if (typeof httpHeaders !== 'undefined') { + payload['httpHeaders'] = httpHeaders; + } + if (typeof httpUser !== 'undefined') { + payload['httpUser'] = httpUser; + } + if (typeof httpPass !== 'undefined') { + payload['httpPass'] = httpPass; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('put', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete Task + * + * + * @param {string} projectId + * @param {string} taskId + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteTask: (projectId, taskId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (taskId === undefined) { + throw new AppwriteException('Missing required parameter: "taskId"'); + } + let path = '/projects/{projectId}/tasks/{taskId}'.replace('{projectId}', projectId).replace('{taskId}', taskId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Project + * + * + * @param {string} projectId + * @param {string} range + * @throws {AppwriteException} + * @returns {Promise} + */ + getUsage: (projectId, range = '30d') => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + let path = '/projects/{projectId}/usage'.replace('{projectId}', projectId); + let payload = {}; + if (range) { + payload['range'] = range; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * List Webhooks + * + * + * @param {string} projectId + * @throws {AppwriteException} + * @returns {Promise} + */ + listWebhooks: (projectId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + let path = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Webhook + * + * + * @param {string} projectId + * @param {string} name + * @param {string[]} events + * @param {string} url + * @param {boolean} security + * @param {string} httpUser + * @param {string} httpPass + * @throws {AppwriteException} + * @returns {Promise} + */ + createWebhook: (projectId, name, events, url, security, httpUser = '', httpPass = '') => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (events === undefined) { + throw new AppwriteException('Missing required parameter: "events"'); + } + if (url === undefined) { + throw new AppwriteException('Missing required parameter: "url"'); + } + if (security === undefined) { + throw new AppwriteException('Missing required parameter: "security"'); + } + let path = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId); + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof events !== 'undefined') { + payload['events'] = events; + } + if (typeof url !== 'undefined') { + payload['url'] = url; + } + if (typeof security !== 'undefined') { + payload['security'] = security; + } + if (typeof httpUser !== 'undefined') { + payload['httpUser'] = httpUser; + } + if (typeof httpPass !== 'undefined') { + payload['httpPass'] = httpPass; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Webhook + * + * + * @param {string} projectId + * @param {string} webhookId + * @throws {AppwriteException} + * @returns {Promise} + */ + getWebhook: (projectId, webhookId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (webhookId === undefined) { + throw new AppwriteException('Missing required parameter: "webhookId"'); + } + let path = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Webhook + * + * + * @param {string} projectId + * @param {string} webhookId + * @param {string} name + * @param {string[]} events + * @param {string} url + * @param {boolean} security + * @param {string} httpUser + * @param {string} httpPass + * @throws {AppwriteException} + * @returns {Promise} + */ + updateWebhook: (projectId, webhookId, name, events, url, security, httpUser = '', httpPass = '') => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (webhookId === undefined) { + throw new AppwriteException('Missing required parameter: "webhookId"'); + } + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + if (events === undefined) { + throw new AppwriteException('Missing required parameter: "events"'); + } + if (url === undefined) { + throw new AppwriteException('Missing required parameter: "url"'); + } + if (security === undefined) { + throw new AppwriteException('Missing required parameter: "security"'); + } + let path = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId); + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof events !== 'undefined') { + payload['events'] = events; + } + if (typeof url !== 'undefined') { + payload['url'] = url; + } + if (typeof security !== 'undefined') { + payload['security'] = security; + } + if (typeof httpUser !== 'undefined') { + payload['httpUser'] = httpUser; + } + if (typeof httpPass !== 'undefined') { + payload['httpPass'] = httpPass; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('put', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete Webhook + * + * + * @param {string} projectId + * @param {string} webhookId + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteWebhook: (projectId, webhookId) => __awaiter(this, void 0, void 0, function* () { + if (projectId === undefined) { + throw new AppwriteException('Missing required parameter: "projectId"'); + } + if (webhookId === undefined) { + throw new AppwriteException('Missing required parameter: "webhookId"'); + } + let path = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }) + }; + this.storage = { + /** + * List Files + * + * Get a list of all the user files. You can use the query params to filter + * your results. On admin mode, this endpoint will return a list of all of the + * project's files. [Learn more about different API modes](/docs/admin). + * + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType + * @throws {AppwriteException} + * @returns {Promise} + */ + listFiles: (search = '', limit = 25, offset = 0, orderType = 'ASC') => __awaiter(this, void 0, void 0, function* () { + let path = '/storage/files'; + let payload = {}; + if (search) { + payload['search'] = search; + } + if (limit) { + payload['limit'] = limit; + } + if (offset) { + payload['offset'] = offset; + } + if (orderType) { + payload['orderType'] = orderType; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create File + * + * Create a new file. The user who creates the file will automatically be + * assigned to read and write access unless he has passed custom values for + * read and write arguments. + * + * @param {File} file + * @param {string[]} read + * @param {string[]} write + * @throws {AppwriteException} + * @returns {Promise} + */ + createFile: (file, read = [], write = []) => __awaiter(this, void 0, void 0, function* () { + if (file === undefined) { + throw new AppwriteException('Missing required parameter: "file"'); + } + let path = '/storage/files'; + let payload = {}; + if (typeof file !== 'undefined') { + payload['file'] = file; + } + if (typeof read !== 'undefined') { + payload['read'] = read; + } + if (typeof write !== 'undefined') { + payload['write'] = write; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'multipart/form-data', + }, payload); + }), + /** + * Get File + * + * Get a file by its unique ID. This endpoint response returns a JSON object + * with the file metadata. + * + * @param {string} fileId + * @throws {AppwriteException} + * @returns {Promise} + */ + getFile: (fileId) => __awaiter(this, void 0, void 0, function* () { + if (fileId === undefined) { + throw new AppwriteException('Missing required parameter: "fileId"'); + } + let path = '/storage/files/{fileId}'.replace('{fileId}', fileId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update File + * + * Update a file by its unique ID. Only users with write permissions have + * access to update this resource. + * + * @param {string} fileId + * @param {string[]} read + * @param {string[]} write + * @throws {AppwriteException} + * @returns {Promise} + */ + updateFile: (fileId, read, write) => __awaiter(this, void 0, void 0, function* () { + if (fileId === undefined) { + throw new AppwriteException('Missing required parameter: "fileId"'); + } + if (read === undefined) { + throw new AppwriteException('Missing required parameter: "read"'); + } + if (write === undefined) { + throw new AppwriteException('Missing required parameter: "write"'); + } + let path = '/storage/files/{fileId}'.replace('{fileId}', fileId); + let payload = {}; + if (typeof read !== 'undefined') { + payload['read'] = read; + } + if (typeof write !== 'undefined') { + payload['write'] = write; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('put', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete File + * + * Delete a file by its unique ID. Only users with write permissions have + * access to delete this resource. + * + * @param {string} fileId + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteFile: (fileId) => __awaiter(this, void 0, void 0, function* () { + if (fileId === undefined) { + throw new AppwriteException('Missing required parameter: "fileId"'); + } + let path = '/storage/files/{fileId}'.replace('{fileId}', fileId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get File for Download + * + * 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. + * + * @param {string} fileId + * @throws {AppwriteException} + * @returns {URL} + */ + getFileDownload: (fileId) => { + if (fileId === undefined) { + throw new AppwriteException('Missing required parameter: "fileId"'); + } + let path = '/storage/files/{fileId}/download'.replace('{fileId}', fileId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + payload['project'] = this.config.project; + for (const [key, value] of Object.entries(this.flatten(payload))) { + uri.searchParams.append(key, value); + } + return uri; + }, + /** + * Get File Preview + * + * Get a file preview image. Currently, this method supports preview for image + * files (jpg, png, and gif), other supported formats, like pdf, docs, slides, + * and spreadsheets, will return the file icon image. You can also pass query + * string arguments for cutting and resizing your preview image. + * + * @param {string} fileId + * @param {number} width + * @param {number} height + * @param {number} quality + * @param {number} borderWidth + * @param {string} borderColor + * @param {number} borderRadius + * @param {number} opacity + * @param {number} rotation + * @param {string} background + * @param {string} output + * @throws {AppwriteException} + * @returns {URL} + */ + getFilePreview: (fileId, width = 0, height = 0, quality = 100, borderWidth = 0, borderColor = '', borderRadius = 0, opacity = 1, rotation = 0, background = '', output = '') => { + if (fileId === undefined) { + throw new AppwriteException('Missing required parameter: "fileId"'); + } + let path = '/storage/files/{fileId}/preview'.replace('{fileId}', fileId); + let payload = {}; + if (width) { + payload['width'] = width; + } + if (height) { + payload['height'] = height; + } + if (quality) { + payload['quality'] = quality; + } + if (borderWidth) { + payload['borderWidth'] = borderWidth; + } + if (borderColor) { + payload['borderColor'] = borderColor; + } + if (borderRadius) { + payload['borderRadius'] = borderRadius; + } + if (opacity) { + payload['opacity'] = opacity; + } + if (rotation) { + payload['rotation'] = rotation; + } + if (background) { + payload['background'] = background; + } + if (output) { + payload['output'] = output; + } + const uri = new URL(this.config.endpoint + path); + payload['project'] = this.config.project; + for (const [key, value] of Object.entries(this.flatten(payload))) { + uri.searchParams.append(key, value); + } + return uri; + }, + /** + * Get File for View + * + * Get a file content by its unique ID. This endpoint is similar to the + * download method but returns with no 'Content-Disposition: attachment' + * header. + * + * @param {string} fileId + * @throws {AppwriteException} + * @returns {URL} + */ + getFileView: (fileId) => { + if (fileId === undefined) { + throw new AppwriteException('Missing required parameter: "fileId"'); + } + let path = '/storage/files/{fileId}/view'.replace('{fileId}', fileId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + payload['project'] = this.config.project; + for (const [key, value] of Object.entries(this.flatten(payload))) { + uri.searchParams.append(key, value); + } + return uri; + } + }; + this.teams = { + /** + * List Teams + * + * Get a list of all the current user teams. You can use the query params to + * filter your results. On admin mode, this endpoint will return a list of all + * of the project's teams. [Learn more about different API + * modes](/docs/admin). + * + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType + * @throws {AppwriteException} + * @returns {Promise} + */ + list: (search = '', limit = 25, offset = 0, orderType = 'ASC') => __awaiter(this, void 0, void 0, function* () { + let path = '/teams'; + let payload = {}; + if (search) { + payload['search'] = search; + } + if (limit) { + payload['limit'] = limit; + } + if (offset) { + payload['offset'] = offset; + } + if (orderType) { + payload['orderType'] = orderType; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Team + * + * Create a new team. The user who creates the team will automatically be + * assigned as the owner of the team. The team owner can invite new members, + * who will be able add new owners and update or delete the team from your + * project. + * + * @param {string} name + * @param {string[]} roles + * @throws {AppwriteException} + * @returns {Promise} + */ + create: (name, roles = ["owner"]) => __awaiter(this, void 0, void 0, function* () { + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + let path = '/teams'; + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof roles !== 'undefined') { + payload['roles'] = roles; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Team + * + * Get a team by its unique ID. All team members have read access for this + * resource. + * + * @param {string} teamId + * @throws {AppwriteException} + * @returns {Promise} + */ + get: (teamId) => __awaiter(this, void 0, void 0, function* () { + if (teamId === undefined) { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + let path = '/teams/{teamId}'.replace('{teamId}', teamId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Team + * + * Update a team by its unique ID. Only team owners have write access for this + * resource. + * + * @param {string} teamId + * @param {string} name + * @throws {AppwriteException} + * @returns {Promise} + */ + update: (teamId, name) => __awaiter(this, void 0, void 0, function* () { + if (teamId === undefined) { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + if (name === undefined) { + throw new AppwriteException('Missing required parameter: "name"'); + } + let path = '/teams/{teamId}'.replace('{teamId}', teamId); + let payload = {}; + if (typeof name !== 'undefined') { + payload['name'] = name; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('put', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete Team + * + * Delete a team by its unique ID. Only team owners have write access for this + * resource. + * + * @param {string} teamId + * @throws {AppwriteException} + * @returns {Promise} + */ + delete: (teamId) => __awaiter(this, void 0, void 0, function* () { + if (teamId === undefined) { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + let path = '/teams/{teamId}'.replace('{teamId}', teamId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get Team Memberships + * + * Get a team members by the team unique ID. All team members have read access + * for this list of resources. + * + * @param {string} teamId + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType + * @throws {AppwriteException} + * @returns {Promise} + */ + getMemberships: (teamId, search = '', limit = 25, offset = 0, orderType = 'ASC') => __awaiter(this, void 0, void 0, function* () { + if (teamId === undefined) { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + let path = '/teams/{teamId}/memberships'.replace('{teamId}', teamId); + let payload = {}; + if (search) { + payload['search'] = search; + } + if (limit) { + payload['limit'] = limit; + } + if (offset) { + payload['offset'] = offset; + } + if (orderType) { + payload['orderType'] = orderType; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create Team Membership + * + * Use this endpoint to invite a new member to join your team. An email with a + * link to join the team will be sent to the new member email address if the + * member doesn't exist in the project it will be created automatically. + * + * Use the 'URL' parameter to redirect the user from the invitation email back + * to your app. When the user is redirected, use the [Update Team Membership + * Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow + * the user to accept the invitation to the team. + * + * Please note that in order to avoid a [Redirect + * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) + * the only valid redirect URL's are the once from domains you have set when + * added your platforms in the console interface. + * + * @param {string} teamId + * @param {string} email + * @param {string[]} roles + * @param {string} url + * @param {string} name + * @throws {AppwriteException} + * @returns {Promise} + */ + createMembership: (teamId, email, roles, url, name = '') => __awaiter(this, void 0, void 0, function* () { + if (teamId === undefined) { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + if (email === undefined) { + throw new AppwriteException('Missing required parameter: "email"'); + } + if (roles === undefined) { + throw new AppwriteException('Missing required parameter: "roles"'); + } + if (url === undefined) { + throw new AppwriteException('Missing required parameter: "url"'); + } + let path = '/teams/{teamId}/memberships'.replace('{teamId}', teamId); + let payload = {}; + if (typeof email !== 'undefined') { + payload['email'] = email; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + if (typeof roles !== 'undefined') { + payload['roles'] = roles; + } + if (typeof url !== 'undefined') { + payload['url'] = url; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Membership Roles + * + * + * @param {string} teamId + * @param {string} membershipId + * @param {string[]} roles + * @throws {AppwriteException} + * @returns {Promise} + */ + updateMembershipRoles: (teamId, membershipId, roles) => __awaiter(this, void 0, void 0, function* () { + if (teamId === undefined) { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + if (membershipId === undefined) { + throw new AppwriteException('Missing required parameter: "membershipId"'); + } + if (roles === undefined) { + throw new AppwriteException('Missing required parameter: "roles"'); + } + let path = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId); + let payload = {}; + if (typeof roles !== 'undefined') { + payload['roles'] = roles; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete Team Membership + * + * This endpoint allows a user to leave a team or for a team owner to delete + * the membership of any other team member. You can also use this endpoint to + * delete a user membership even if it is not accepted. + * + * @param {string} teamId + * @param {string} membershipId + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteMembership: (teamId, membershipId) => __awaiter(this, void 0, void 0, function* () { + if (teamId === undefined) { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + if (membershipId === undefined) { + throw new AppwriteException('Missing required parameter: "membershipId"'); + } + let path = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update Team Membership Status + * + * 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 recieved + * by the user. + * + * @param {string} teamId + * @param {string} membershipId + * @param {string} userId + * @param {string} secret + * @throws {AppwriteException} + * @returns {Promise} + */ + updateMembershipStatus: (teamId, membershipId, userId, secret) => __awaiter(this, void 0, void 0, function* () { + if (teamId === undefined) { + throw new AppwriteException('Missing required parameter: "teamId"'); + } + if (membershipId === undefined) { + throw new AppwriteException('Missing required parameter: "membershipId"'); + } + if (userId === undefined) { + throw new AppwriteException('Missing required parameter: "userId"'); + } + if (secret === undefined) { + throw new AppwriteException('Missing required parameter: "secret"'); + } + let path = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', teamId).replace('{membershipId}', membershipId); + let payload = {}; + if (typeof userId !== 'undefined') { + payload['userId'] = userId; + } + if (typeof secret !== 'undefined') { + payload['secret'] = secret; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + }) + }; + this.users = { + /** + * List Users + * + * Get a list of all the project's users. You can use the query params to + * filter your results. + * + * @param {string} search + * @param {number} limit + * @param {number} offset + * @param {string} orderType + * @throws {AppwriteException} + * @returns {Promise} + */ + list: (search = '', limit = 25, offset = 0, orderType = 'ASC') => __awaiter(this, void 0, void 0, function* () { + let path = '/users'; + let payload = {}; + if (search) { + payload['search'] = search; + } + if (limit) { + payload['limit'] = limit; + } + if (offset) { + payload['offset'] = offset; + } + if (orderType) { + payload['orderType'] = orderType; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Create User + * + * Create a new user. + * + * @param {string} email + * @param {string} password + * @param {string} name + * @throws {AppwriteException} + * @returns {Promise} + */ + create: (email, password, name = '') => __awaiter(this, void 0, void 0, function* () { + if (email === undefined) { + throw new AppwriteException('Missing required parameter: "email"'); + } + if (password === undefined) { + throw new AppwriteException('Missing required parameter: "password"'); + } + let path = '/users'; + let payload = {}; + if (typeof email !== 'undefined') { + payload['email'] = email; + } + if (typeof password !== 'undefined') { + payload['password'] = password; + } + if (typeof name !== 'undefined') { + payload['name'] = name; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('post', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get User + * + * Get a user by its unique ID. + * + * @param {string} userId + * @throws {AppwriteException} + * @returns {Promise} + */ + get: (userId) => __awaiter(this, void 0, void 0, function* () { + if (userId === undefined) { + throw new AppwriteException('Missing required parameter: "userId"'); + } + let path = '/users/{userId}'.replace('{userId}', userId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete User + * + * Delete a user by its unique ID. + * + * @param {string} userId + * @throws {AppwriteException} + * @returns {Promise} + */ + delete: (userId) => __awaiter(this, void 0, void 0, function* () { + if (userId === undefined) { + throw new AppwriteException('Missing required parameter: "userId"'); + } + let path = '/users/{userId}'.replace('{userId}', userId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get User Logs + * + * Get a user activity logs list by its unique ID. + * + * @param {string} userId + * @throws {AppwriteException} + * @returns {Promise} + */ + getLogs: (userId) => __awaiter(this, void 0, void 0, function* () { + if (userId === undefined) { + throw new AppwriteException('Missing required parameter: "userId"'); + } + let path = '/users/{userId}/logs'.replace('{userId}', userId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get User Preferences + * + * Get the user preferences by its unique ID. + * + * @param {string} userId + * @throws {AppwriteException} + * @returns {Promise} + */ + getPrefs: (userId) => __awaiter(this, void 0, void 0, function* () { + if (userId === undefined) { + throw new AppwriteException('Missing required parameter: "userId"'); + } + let path = '/users/{userId}/prefs'.replace('{userId}', userId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update User Preferences + * + * Update the user preferences by its unique ID. You can pass only the + * specific settings you wish to update. + * + * @param {string} userId + * @param {object} prefs + * @throws {AppwriteException} + * @returns {Promise} + */ + updatePrefs: (userId, prefs) => __awaiter(this, void 0, void 0, function* () { + if (userId === undefined) { + throw new AppwriteException('Missing required parameter: "userId"'); + } + if (prefs === undefined) { + throw new AppwriteException('Missing required parameter: "prefs"'); + } + let path = '/users/{userId}/prefs'.replace('{userId}', userId); + let payload = {}; + if (typeof prefs !== 'undefined') { + payload['prefs'] = prefs; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Get User Sessions + * + * Get the user sessions list by its unique ID. + * + * @param {string} userId + * @throws {AppwriteException} + * @returns {Promise} + */ + getSessions: (userId) => __awaiter(this, void 0, void 0, function* () { + if (userId === undefined) { + throw new AppwriteException('Missing required parameter: "userId"'); + } + let path = '/users/{userId}/sessions'.replace('{userId}', userId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('get', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete User Sessions + * + * Delete all user's sessions by using the user's unique ID. + * + * @param {string} userId + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteSessions: (userId) => __awaiter(this, void 0, void 0, function* () { + if (userId === undefined) { + throw new AppwriteException('Missing required parameter: "userId"'); + } + let path = '/users/{userId}/sessions'.replace('{userId}', userId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Delete User Session + * + * Delete a user sessions by its unique ID. + * + * @param {string} userId + * @param {string} sessionId + * @throws {AppwriteException} + * @returns {Promise} + */ + deleteSession: (userId, sessionId) => __awaiter(this, void 0, void 0, function* () { + if (userId === undefined) { + throw new AppwriteException('Missing required parameter: "userId"'); + } + if (sessionId === undefined) { + throw new AppwriteException('Missing required parameter: "sessionId"'); + } + let path = '/users/{userId}/sessions/{sessionId}'.replace('{userId}', userId).replace('{sessionId}', sessionId); + let payload = {}; + const uri = new URL(this.config.endpoint + path); + return yield this.call('delete', uri, { + 'content-type': 'application/json', + }, payload); + }), + /** + * Update User Status + * + * Update the user status by its unique ID. + * + * @param {string} userId + * @param {number} status + * @throws {AppwriteException} + * @returns {Promise} + */ + updateStatus: (userId, status) => __awaiter(this, void 0, void 0, function* () { + if (userId === undefined) { + throw new AppwriteException('Missing required parameter: "userId"'); + } + if (status === undefined) { + throw new AppwriteException('Missing required parameter: "status"'); + } + let path = '/users/{userId}/status'.replace('{userId}', userId); + let payload = {}; + if (typeof status !== 'undefined') { + payload['status'] = status; + } + const uri = new URL(this.config.endpoint + path); + return yield this.call('patch', uri, { + 'content-type': 'application/json', + }, payload); + }) + }; + } /** + * Set Endpoint + * + * Your project ID + * * @param {string} endpoint + * * @returns {this} */ - let setEndpoint = function(endpoint) { - config.endpoint = endpoint; - + setEndpoint(endpoint) { + this.config.endpoint = endpoint; return this; - }; - + } /** * Set Project * @@ -29,17 +3980,13 @@ * * @param value string * - * @return this + * @return {this} */ - let setProject = function (value) - { - http.addGlobalHeader('X-Appwrite-Project', value); - - config.project = value; - + setProject(value) { + this.headers['X-Appwrite-Project'] = value; + this.config.project = value; return this; - }; - + } /** * Set Key * @@ -47,5096 +3994,133 @@ * * @param value string * - * @return this + * @return {this} */ - let setKey = function (value) - { - http.addGlobalHeader('X-Appwrite-Key', value); - - config.key = value; - + setKey(value) { + this.headers['X-Appwrite-Key'] = value; + this.config.key = value; return this; - }; - + } + /** + * Set JWT + * + * Your secret JSON Web Token + * + * @param value string + * + * @return {this} + */ + setJWT(value) { + this.headers['X-Appwrite-JWT'] = value; + this.config.jwt = value; + return this; + } /** * Set Locale * * @param value string * - * @return this + * @return {this} */ - let setLocale = function (value) - { - http.addGlobalHeader('X-Appwrite-Locale', value); - - config.locale = value; - + setLocale(value) { + this.headers['X-Appwrite-Locale'] = value; + this.config.locale = value; return this; - }; - + } /** * Set Mode * * @param value string * - * @return this + * @return {this} */ - let setMode = function (value) - { - http.addGlobalHeader('X-Appwrite-Mode', value); - - config.mode = value; - + setMode(value) { + this.headers['X-Appwrite-Mode'] = value; + this.config.mode = value; return this; - }; - - let http = function(document) { - let globalParams = [], - globalHeaders = []; - - let addParam = function (url, param, value) { - let a = document.createElement('a'), regex = /(?:\?|&|&)+([^=]+)(?:=([^&]*))*/g; - let match, str = []; - a.href = url; - param = encodeURIComponent(param); - - while (match = regex.exec(a.search)) if (param !== match[1]) str.push(match[1] + (match[2] ? "=" + match[2] : "")); - - str.push(param + (value ? "=" + encodeURIComponent(value) : "")); - - a.search = str.join("&"); - - return a.href; - }; - - /** - * @param {Object} params - * @returns {string} - */ - let buildQuery = function(params) { - let str = []; - - for (let p in params) { - if(Array.isArray(params[p])) { - for (let index = 0; index < params[p].length; index++) { - let param = params[p][index]; - str.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(params[p])); + } + call(method, url, headers = {}, params = {}) { + var _a, _b; + return __awaiter(this, void 0, void 0, function* () { + method = method.toUpperCase(); + headers = Object.assign(Object.assign({}, headers), this.headers); + let options = { + method, + headers, + credentials: 'include' + }; + if (typeof window !== 'undefined' && window.localStorage) { + headers['X-Fallback-Cookies'] = (_a = window.localStorage.getItem('cookieFallback')) !== null && _a !== void 0 ? _a : ""; + } + if (method === 'GET') { + for (const [key, value] of Object.entries(this.flatten(params))) { + url.searchParams.append(key, value); } } - - return str.join("&"); - }; - - let addGlobalHeader = function(key, value) { - globalHeaders[key] = {key: key.toLowerCase(), value: value.toLowerCase()}; - }; - - let addGlobalParam = function(key, value) { - globalParams.push({key: key, value: value}); - }; - - addGlobalHeader('x-sdk-version', 'appwrite:web:1.0.0'); - addGlobalHeader('content-type', ''); - - /** - * @param {string} method - * @param {string} path string - * @param {Object} headers - * @param {Object} params - * @param {function} progress - * @returns {Promise} - */ - let call = function (method, path, headers = {}, params = {}, progress = null) { - let i; - - path = config.endpoint + path; - - if (-1 === ['GET', 'POST', 'PUT', 'DELETE', 'TRACE', 'HEAD', 'OPTIONS', 'CONNECT', 'PATCH'].indexOf(method)) { - throw new Error('var method must contain a valid HTTP method name'); - } - - if (typeof path !== 'string') { - throw new Error('var path must be of type string'); - } - - if (typeof headers !== 'object') { - throw new Error('var headers must be of type object'); - } - - for (i = 0; i < globalParams.length; i++) { // Add global params to URL - path = addParam(path, globalParams[i].key, globalParams[i].value); - } - - if(window.localStorage && window.localStorage.getItem('cookieFallback')) { - headers['X-Fallback-Cookies'] = window.localStorage.getItem('cookieFallback'); - } - - for (let key in globalHeaders) { // Add Global Headers - if (globalHeaders.hasOwnProperty(key)) { - if (!headers[globalHeaders[key].key]) { - headers[globalHeaders[key].key] = globalHeaders[key].value; - } - } - } - - if(method === 'GET') { - for (let param in params) { - if (param.hasOwnProperty(key)) { - path = addParam(path, key + (Array.isArray(param) ? '[]' : ''), params[key]); - } - } - } - - switch (headers['content-type']) { // Parse request by content type - case 'application/json': - params = JSON.stringify(params); - break; - - case 'multipart/form-data': - let formData = new FormData(); - - Object.keys(params).forEach(function(key) { - let param = params[key]; - formData.append(key + (Array.isArray(param) ? '[]' : ''), param); - }); - - params = formData; - break; - } - - return new Promise(function (resolve, reject) { - - let request = new XMLHttpRequest(), key; - - request.withCredentials = true; - request.open(method, path, true); - - for (key in headers) { // Set Headers - if (headers.hasOwnProperty(key)) { - if (key === 'content-type' && headers[key] === 'multipart/form-data') { // Skip to avoid missing boundary - continue; + else { + switch (headers['content-type']) { + case 'application/json': + options.body = JSON.stringify(params); + break; + case 'multipart/form-data': + let formData = new FormData(); + for (const key in params) { + if (Array.isArray(params[key])) { + formData.append(key + '[]', params[key].join(',')); + } + else { + formData.append(key, params[key]); + } } - - request.setRequestHeader(key, headers[key]); - } + options.body = formData; + delete headers['content-type']; + break; } - - request.onload = function () { - let data = request.response; - let contentType = this.getResponseHeader('content-type') || ''; - contentType = contentType.substring(0, contentType.indexOf(';')); - - switch (contentType) { - case 'application/json': - data = JSON.parse(data); - break; - } - - let cookieFallback = this.getResponseHeader('X-Fallback-Cookies') || ''; - - if(window.localStorage && cookieFallback) { - window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.'); - window.localStorage.setItem('cookieFallback', cookieFallback); - } - - if (4 === request.readyState && 399 >= request.status) { - resolve(data); - } else { - reject(data); - } - }; - - if (progress) { - request.addEventListener('progress', progress); - request.upload.addEventListener('progress', progress, false); - } - - // Handle network errors - request.onerror = function () { - reject(new Error("Network Error")); - }; - - request.send(params); - }) - }; - - return { - 'get': function(path, headers = {}, params = {}) { - return call('GET', path + ((Object.keys(params).length > 0) ? '?' + buildQuery(params) : ''), headers, {}); - }, - 'post': function(path, headers = {}, params = {}, progress = null) { - return call('POST', path, headers, params, progress); - }, - 'put': function(path, headers = {}, params = {}, progress = null) { - return call('PUT', path, headers, params, progress); - }, - 'patch': function(path, headers = {}, params = {}, progress = null) { - return call('PATCH', path, headers, params, progress); - }, - 'delete': function(path, headers = {}, params = {}, progress = null) { - return call('DELETE', path, headers, params, progress); - }, - 'addGlobalParam': addGlobalParam, - 'addGlobalHeader': addGlobalHeader - } - }(window.document); - - let account = { - - /** - * Get Account - * - * Get currently logged in user data as JSON object. - * - * @throws {Error} - * @return {Promise} - */ - get: function() { - let path = '/account'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Account - * - * Use this endpoint to allow a new user to register a new account in your - * project. After the user registration completes successfully, you can use - * the [/account/verfication](/docs/client/account#accountCreateVerification) - * 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](/docs/client/account#accountCreateSession). - * - * @param {string} email - * @param {string} password - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - create: function(email, password, name = '') { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/account'; - - let payload = {}; - - if(typeof email !== 'undefined') { - payload['email'] = email; - } - - if(typeof password !== 'undefined') { - payload['password'] = password; - } - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Account - * - * Delete a currently logged in user account. Behind the scene, the user - * record is not deleted but permanently blocked from any access. This is done - * to avoid deleted accounts being overtaken by new users with the same email - * address. Any user-related resources like documents or storage files should - * be deleted separately. - * - * @throws {Error} - * @return {Promise} - */ - delete: function() { - let path = '/account'; - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Email - * - * Update currently logged in user account email address. After changing user - * address, user confirmation status is being reset and a new confirmation - * mail is sent. For security measures, user password is required to complete - * this request. - * - * @param {string} email - * @param {string} password - * @throws {Error} - * @return {Promise} - */ - updateEmail: function(email, password) { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/account/email'; - - let payload = {}; - - if(typeof email !== 'undefined') { - payload['email'] = email; - } - - if(typeof password !== 'undefined') { - payload['password'] = password; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Account Logs - * - * Get currently logged in user list of latest security activity logs. Each - * log returns user IP address, location and date and time of log. - * - * @throws {Error} - * @return {Promise} - */ - getLogs: function() { - let path = '/account/logs'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Name - * - * Update currently logged in user account name. - * - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - updateName: function(name) { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/account/name'; - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Password - * - * Update currently logged in user password. For validation, user is required - * to pass the password twice. - * - * @param {string} password - * @param {string} oldPassword - * @throws {Error} - * @return {Promise} - */ - updatePassword: function(password, oldPassword) { - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - if(oldPassword === undefined) { - throw new Error('Missing required parameter: "oldPassword"'); - } - - let path = '/account/password'; - - let payload = {}; - - if(typeof password !== 'undefined') { - payload['password'] = password; - } - - if(typeof oldPassword !== 'undefined') { - payload['oldPassword'] = oldPassword; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Account Preferences - * - * Get currently logged in user preferences as a key-value object. - * - * @throws {Error} - * @return {Promise} - */ - getPrefs: function() { - let path = '/account/prefs'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Account Preferences - * - * Update currently logged in user account preferences. You can pass only the - * specific settings you wish to update. - * - * @param {object} prefs - * @throws {Error} - * @return {Promise} - */ - updatePrefs: function(prefs) { - if(prefs === undefined) { - throw new Error('Missing required parameter: "prefs"'); - } - - let path = '/account/prefs'; - - let payload = {}; - - if(typeof prefs !== 'undefined') { - payload['prefs'] = prefs; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Password Recovery - * - * Sends the user an email with a temporary secret key for password reset. - * When the user clicks the confirmation link he is redirected back to your - * app password reset URL with the secret key and email address values - * attached to the URL query string. Use the query string params to submit a - * request to the [PUT - * /account/recovery](/docs/client/account#accountUpdateRecovery) endpoint to - * complete the process. - * - * @param {string} email - * @param {string} url - * @throws {Error} - * @return {Promise} - */ - createRecovery: function(email, url) { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/account/recovery'; - - let payload = {}; - - if(typeof email !== 'undefined') { - payload['email'] = email; - } - - if(typeof url !== 'undefined') { - payload['url'] = url; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Complete Password Recovery - * - * Use this endpoint to complete the user account password reset. Both the - * **userId** and **secret** arguments will be passed as query parameters to - * the redirect URL you have provided when sending your request to the [POST - * /account/recovery](/docs/client/account#accountCreateRecovery) endpoint. - * - * Please note that in order to avoid a [Redirect - * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - * the only valid redirect URLs are the ones from domains you have set when - * adding your platforms in the console interface. - * - * @param {string} userId - * @param {string} secret - * @param {string} password - * @param {string} passwordAgain - * @throws {Error} - * @return {Promise} - */ - updateRecovery: function(userId, secret, password, passwordAgain) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(secret === undefined) { - throw new Error('Missing required parameter: "secret"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - if(passwordAgain === undefined) { - throw new Error('Missing required parameter: "passwordAgain"'); - } - - let path = '/account/recovery'; - - let payload = {}; - - if(typeof userId !== 'undefined') { - payload['userId'] = userId; - } - - if(typeof secret !== 'undefined') { - payload['secret'] = secret; - } - - if(typeof password !== 'undefined') { - payload['password'] = password; - } - - if(typeof passwordAgain !== 'undefined') { - payload['passwordAgain'] = passwordAgain; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Account Sessions - * - * Get currently logged in user list of active sessions across different - * devices. - * - * @throws {Error} - * @return {Promise} - */ - getSessions: function() { - let path = '/account/sessions'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Account Session - * - * 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. - * - * @param {string} email - * @param {string} password - * @throws {Error} - * @return {Promise} - */ - createSession: function(email, password) { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/account/sessions'; - - let payload = {}; - - if(typeof email !== 'undefined') { - payload['email'] = email; - } - - if(typeof password !== 'undefined') { - payload['password'] = password; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete All Account Sessions - * - * Delete all sessions from the user account and remove any sessions cookies - * from the end client. - * - * @throws {Error} - * @return {Promise} - */ - deleteSessions: function() { - let path = '/account/sessions'; - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Account Session with OAuth2 - * - * 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. - * - * @param {string} provider - * @param {string} success - * @param {string} failure - * @param {string[]} scopes - * @throws {Error} - * @return {Promise} - */ - createOAuth2Session: function(provider, success = 'https://appwrite.io/auth/oauth2/success', failure = 'https://appwrite.io/auth/oauth2/failure', scopes = []) { - if(provider === undefined) { - throw new Error('Missing required parameter: "provider"'); - } - - let path = '/account/sessions/oauth2/{provider}'.replace(new RegExp('{provider}', 'g'), provider); - - let payload = {}; - - if(success) { - payload['success'] = success; - } - - if(failure) { - payload['failure'] = failure; - } - - if(scopes) { - payload['scopes'] = scopes; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } + try { + let data = null; + const response = yield crossFetch.fetch(url.toString(), options); + if ((_b = response.headers.get("content-type")) === null || _b === void 0 ? void 0 : _b.includes("application/json")) { + data = yield response.json(); } else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); + data = { + message: yield response.text() + }; } + if (400 <= response.status) { + throw new AppwriteException(data === null || data === void 0 ? void 0 : data.message, response.status, data); + } + const cookieFallback = response.headers.get('X-Fallback-Cookies'); + if (typeof window !== 'undefined' && window.localStorage && cookieFallback) { + window.console.warn('Appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.'); + window.localStorage.setItem('cookieFallback', cookieFallback); + } + return data; } - - query = query.join("&"); - - window.location = config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Delete Account Session - * - * Use this endpoint to log out the currently logged in user from all their - * account sessions across all of their different devices. When using the - * option id argument, only the session unique ID provider will be deleted. - * - * @param {string} sessionId - * @throws {Error} - * @return {Promise} - */ - deleteSession: function(sessionId) { - if(sessionId === undefined) { - throw new Error('Missing required parameter: "sessionId"'); + catch (e) { + throw new AppwriteException(e.message); } - - let path = '/account/sessions/{sessionId}'.replace(new RegExp('{sessionId}', 'g'), sessionId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Email Verification - * - * Use this endpoint to send a verification message to your user email address - * to confirm they are the valid owners of that address. Both the **userId** - * and **secret** arguments will be passed as query parameters to the URL you - * have provided to be attached to the verification email. The provided URL - * should redirect the user back to your app and allow you to complete the - * verification process by verifying both the **userId** and **secret** - * parameters. Learn more about how to [complete the verification - * process](/docs/client/account#accountUpdateVerification). - * - * Please note that in order to avoid a [Redirect - * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), - * the only valid redirect URLs are the ones from domains you have set when - * adding your platforms in the console interface. - * - * - * @param {string} url - * @throws {Error} - * @return {Promise} - */ - createVerification: function(url) { - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); + }); + } + flatten(data, prefix = '') { + let output = {}; + for (const key in data) { + let value = data[key]; + let finalKey = prefix ? `${prefix}[${key}]` : key; + if (Array.isArray(value)) { + output = Object.assign(output, this.flatten(value, finalKey)); } - - let path = '/account/verification'; - - let payload = {}; - - if(typeof url !== 'undefined') { - payload['url'] = url; + else { + output[finalKey] = value; } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Complete Email Verification - * - * Use this endpoint to complete the user email verification process. Use both - * the **userId** and **secret** parameters that were attached to your app URL - * to verify the user email ownership. If confirmed this route will return a - * 200 status code. - * - * @param {string} userId - * @param {string} secret - * @throws {Error} - * @return {Promise} - */ - updateVerification: function(userId, secret) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(secret === undefined) { - throw new Error('Missing required parameter: "secret"'); - } - - let path = '/account/verification'; - - let payload = {}; - - if(typeof userId !== 'undefined') { - payload['userId'] = userId; - } - - if(typeof secret !== 'undefined') { - payload['secret'] = secret; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); } - }; - - let avatars = { - - /** - * Get Browser Icon - * - * You can use this endpoint to show different browser icons to your users. - * The code argument receives the browser code as it appears in your user - * /account/sessions endpoint. Use width, height and quality arguments to - * change the output settings. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {string} - */ - getBrowser: function(code, width = 100, height = 100, quality = 100) { - if(code === undefined) { - throw new Error('Missing required parameter: "code"'); - } - - let path = '/avatars/browsers/{code}'.replace(new RegExp('{code}', 'g'), code); - - let payload = {}; - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(quality) { - payload['quality'] = quality; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get Credit Card Icon - * - * The credit card endpoint will return you the icon of the credit card - * provider you need. Use width, height and quality arguments to change the - * output settings. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {string} - */ - getCreditCard: function(code, width = 100, height = 100, quality = 100) { - if(code === undefined) { - throw new Error('Missing required parameter: "code"'); - } - - let path = '/avatars/credit-cards/{code}'.replace(new RegExp('{code}', 'g'), code); - - let payload = {}; - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(quality) { - payload['quality'] = quality; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get Favicon - * - * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote - * website URL. - * - * - * @param {string} url - * @throws {Error} - * @return {string} - */ - getFavicon: function(url) { - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/avatars/favicon'; - - let payload = {}; - - if(url) { - payload['url'] = url; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get Country Flag - * - * You can use this endpoint to show different country flags icons to your - * users. The code argument receives the 2 letter country code. Use width, - * height and quality arguments to change the output settings. - * - * @param {string} code - * @param {number} width - * @param {number} height - * @param {number} quality - * @throws {Error} - * @return {string} - */ - getFlag: function(code, width = 100, height = 100, quality = 100) { - if(code === undefined) { - throw new Error('Missing required parameter: "code"'); - } - - let path = '/avatars/flags/{code}'.replace(new RegExp('{code}', 'g'), code); - - let payload = {}; - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(quality) { - payload['quality'] = quality; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get Image from URL - * - * Use this endpoint to fetch a remote image URL and crop it to any image size - * you want. This endpoint is very useful if you need to crop and display - * remote images in your app or in case you want to make sure a 3rd party - * image is properly served using a TLS protocol. - * - * @param {string} url - * @param {number} width - * @param {number} height - * @throws {Error} - * @return {string} - */ - getImage: function(url, width = 400, height = 400) { - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/avatars/image'; - - let payload = {}; - - if(url) { - payload['url'] = url; - } - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get User Initials - * - * Use this endpoint to show your user initials avatar icon on your website or - * app. By default, this route will try to print your logged-in user name or - * email initials. You can also overwrite the user name if you pass the 'name' - * parameter. If no name is given and no user is logged, an empty avatar will - * be returned. - * - * You can use the color and background params to change the avatar colors. By - * default, a random theme will be selected. The random theme will persist for - * the user's initials when reloading the same theme will always return for - * the same initials. - * - * @param {string} name - * @param {number} width - * @param {number} height - * @param {string} color - * @param {string} background - * @throws {Error} - * @return {string} - */ - getInitials: function(name = '', width = 500, height = 500, color = '', background = '') { - let path = '/avatars/initials'; - - let payload = {}; - - if(name) { - payload['name'] = name; - } - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(color) { - payload['color'] = color; - } - - if(background) { - payload['background'] = background; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get QR Code - * - * Converts a given plain text to a QR code image. You can use the query - * parameters to change the size and style of the resulting image. - * - * @param {string} text - * @param {number} size - * @param {number} margin - * @param {boolean} download - * @throws {Error} - * @return {string} - */ - getQR: function(text, size = 400, margin = 1, download = false) { - if(text === undefined) { - throw new Error('Missing required parameter: "text"'); - } - - let path = '/avatars/qr'; - - let payload = {}; - - if(text) { - payload['text'] = text; - } - - if(size) { - payload['size'] = size; - } - - if(margin) { - payload['margin'] = margin; - } - - if(download) { - payload['download'] = download; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - } - }; - - let database = { - - /** - * List Collections - * - * Get a list of all the user collections. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project's collections. [Learn more about different API - * modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listCollections: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/database/collections'; - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Collection - * - * Create a new Collection. - * - * @param {string} name - * @param {string[]} read - * @param {string[]} write - * @param {string[]} rules - * @throws {Error} - * @return {Promise} - */ - createCollection: function(name, read, write, rules) { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - if(rules === undefined) { - throw new Error('Missing required parameter: "rules"'); - } - - let path = '/database/collections'; - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof read !== 'undefined') { - payload['read'] = read; - } - - if(typeof write !== 'undefined') { - payload['write'] = write; - } - - if(typeof rules !== 'undefined') { - payload['rules'] = rules; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Collection - * - * Get a collection by its unique ID. This endpoint response returns a JSON - * object with the collection metadata. - * - * @param {string} collectionId - * @throws {Error} - * @return {Promise} - */ - getCollection: function(collectionId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - let path = '/database/collections/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Collection - * - * Update a collection by its unique ID. - * - * @param {string} collectionId - * @param {string} name - * @param {string[]} read - * @param {string[]} write - * @param {string[]} rules - * @throws {Error} - * @return {Promise} - */ - updateCollection: function(collectionId, name, read, write, rules = []) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/database/collections/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof read !== 'undefined') { - payload['read'] = read; - } - - if(typeof write !== 'undefined') { - payload['write'] = write; - } - - if(typeof rules !== 'undefined') { - payload['rules'] = rules; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Collection - * - * Delete a collection by its unique ID. Only users with write permissions - * have access to delete this resource. - * - * @param {string} collectionId - * @throws {Error} - * @return {Promise} - */ - deleteCollection: function(collectionId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - let path = '/database/collections/{collectionId}'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Documents - * - * Get a list of all the user documents. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project's documents. [Learn more about different API - * modes](/docs/admin). - * - * @param {string} collectionId - * @param {string[]} filters - * @param {number} limit - * @param {number} offset - * @param {string} orderField - * @param {string} orderType - * @param {string} orderCast - * @param {string} search - * @throws {Error} - * @return {Promise} - */ - listDocuments: function(collectionId, filters = [], limit = 25, offset = 0, orderField = '', orderType = 'ASC', orderCast = 'string', search = '') { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - let path = '/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - if(filters) { - payload['filters'] = filters; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderField) { - payload['orderField'] = orderField; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - if(orderCast) { - payload['orderCast'] = orderCast; - } - - if(search) { - payload['search'] = search; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Document - * - * Create a new Document. Before using this route, you should create a new - * collection resource using either a [server - * integration](/docs/server/database#databaseCreateCollection) API or - * directly from your database console. - * - * @param {string} collectionId - * @param {object} data - * @param {string[]} read - * @param {string[]} write - * @param {string} parentDocument - * @param {string} parentProperty - * @param {string} parentPropertyType - * @throws {Error} - * @return {Promise} - */ - createDocument: function(collectionId, data, read, write, parentDocument = '', parentProperty = '', parentPropertyType = 'assign') { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(data === undefined) { - throw new Error('Missing required parameter: "data"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/database/collections/{collectionId}/documents'.replace(new RegExp('{collectionId}', 'g'), collectionId); - - let payload = {}; - - if(typeof data !== 'undefined') { - payload['data'] = data; - } - - if(typeof read !== 'undefined') { - payload['read'] = read; - } - - if(typeof write !== 'undefined') { - payload['write'] = write; - } - - if(typeof parentDocument !== 'undefined') { - payload['parentDocument'] = parentDocument; - } - - if(typeof parentProperty !== 'undefined') { - payload['parentProperty'] = parentProperty; - } - - if(typeof parentPropertyType !== 'undefined') { - payload['parentPropertyType'] = parentPropertyType; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Document - * - * Get a document by its unique ID. This endpoint response returns a JSON - * object with the document data. - * - * @param {string} collectionId - * @param {string} documentId - * @throws {Error} - * @return {Promise} - */ - getDocument: function(collectionId, documentId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(documentId === undefined) { - throw new Error('Missing required parameter: "documentId"'); - } - - let path = '/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Document - * - * Update a document by its unique ID. Using the patch method you can pass - * only specific fields that will get updated. - * - * @param {string} collectionId - * @param {string} documentId - * @param {object} data - * @param {string[]} read - * @param {string[]} write - * @throws {Error} - * @return {Promise} - */ - updateDocument: function(collectionId, documentId, data, read, write) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(documentId === undefined) { - throw new Error('Missing required parameter: "documentId"'); - } - - if(data === undefined) { - throw new Error('Missing required parameter: "data"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - let payload = {}; - - if(typeof data !== 'undefined') { - payload['data'] = data; - } - - if(typeof read !== 'undefined') { - payload['read'] = read; - } - - if(typeof write !== 'undefined') { - payload['write'] = write; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Document - * - * Delete a document by its unique ID. This endpoint deletes only the parent - * documents, its attributes and relations to other documents. Child documents - * **will not** be deleted. - * - * @param {string} collectionId - * @param {string} documentId - * @throws {Error} - * @return {Promise} - */ - deleteDocument: function(collectionId, documentId) { - if(collectionId === undefined) { - throw new Error('Missing required parameter: "collectionId"'); - } - - if(documentId === undefined) { - throw new Error('Missing required parameter: "documentId"'); - } - - let path = '/database/collections/{collectionId}/documents/{documentId}'.replace(new RegExp('{collectionId}', 'g'), collectionId).replace(new RegExp('{documentId}', 'g'), documentId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let functions = { - - /** - * List Functions - * - * Get a list of all the project's functions. You can use the query params to - * filter your results. - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - list: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/functions'; - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Function - * - * Create a new function. You can pass a list of - * [permissions](/docs/permissions) to allow different project users or team - * with access to execute the function using the client API. - * - * @param {string} name - * @param {string[]} execute - * @param {string} env - * @param {object} vars - * @param {string[]} events - * @param {string} schedule - * @param {number} timeout - * @throws {Error} - * @return {Promise} - */ - create: function(name, execute, env, vars = {}, events = [], schedule = '', timeout = 15) { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(execute === undefined) { - throw new Error('Missing required parameter: "execute"'); - } - - if(env === undefined) { - throw new Error('Missing required parameter: "env"'); - } - - let path = '/functions'; - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof execute !== 'undefined') { - payload['execute'] = execute; - } - - if(typeof env !== 'undefined') { - payload['env'] = env; - } - - if(typeof vars !== 'undefined') { - payload['vars'] = vars; - } - - if(typeof events !== 'undefined') { - payload['events'] = events; - } - - if(typeof schedule !== 'undefined') { - payload['schedule'] = schedule; - } - - if(typeof timeout !== 'undefined') { - payload['timeout'] = timeout; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Function - * - * Get a function by its unique ID. - * - * @param {string} functionId - * @throws {Error} - * @return {Promise} - */ - get: function(functionId) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Function - * - * Update function by its unique ID. - * - * @param {string} functionId - * @param {string} name - * @param {string[]} execute - * @param {object} vars - * @param {string[]} events - * @param {string} schedule - * @param {number} timeout - * @throws {Error} - * @return {Promise} - */ - update: function(functionId, name, execute, vars = {}, events = [], schedule = '', timeout = 15) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(execute === undefined) { - throw new Error('Missing required parameter: "execute"'); - } - - let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof execute !== 'undefined') { - payload['execute'] = execute; - } - - if(typeof vars !== 'undefined') { - payload['vars'] = vars; - } - - if(typeof events !== 'undefined') { - payload['events'] = events; - } - - if(typeof schedule !== 'undefined') { - payload['schedule'] = schedule; - } - - if(typeof timeout !== 'undefined') { - payload['timeout'] = timeout; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Function - * - * Delete a function by its unique ID. - * - * @param {string} functionId - * @throws {Error} - * @return {Promise} - */ - delete: function(functionId) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - let path = '/functions/{functionId}'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Executions - * - * Get a list of all the current user function execution logs. You can use the - * query params to filter your results. On admin mode, this endpoint will - * return a list of all of the project's executions. [Learn more about - * different API modes](/docs/admin). - * - * @param {string} functionId - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listExecutions: function(functionId, search = '', limit = 25, offset = 0, orderType = 'ASC') { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - let path = '/functions/{functionId}/executions'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Execution - * - * 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. - * - * @param {string} functionId - * @param {string} data - * @throws {Error} - * @return {Promise} - */ - createExecution: function(functionId, data) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - let path = '/functions/{functionId}/executions'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - if (data) { - payload['data'] = data; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Execution - * - * Get a function execution log by its unique ID. - * - * @param {string} functionId - * @param {string} executionId - * @throws {Error} - * @return {Promise} - */ - getExecution: function(functionId, executionId) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - if(executionId === undefined) { - throw new Error('Missing required parameter: "executionId"'); - } - - let path = '/functions/{functionId}/executions/{executionId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{executionId}', 'g'), executionId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Function Tag - * - * Update the function code tag ID using the unique function ID. Use this - * endpoint to switch the code tag that should be executed by the execution - * endpoint. - * - * @param {string} functionId - * @param {string} tag - * @throws {Error} - * @return {Promise} - */ - updateTag: function(functionId, tag) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - if(tag === undefined) { - throw new Error('Missing required parameter: "tag"'); - } - - let path = '/functions/{functionId}/tag'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - if(typeof tag !== 'undefined') { - payload['tag'] = tag; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Tags - * - * Get a list of all the project's code tags. You can use the query params to - * filter your results. - * - * @param {string} functionId - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listTags: function(functionId, search = '', limit = 25, offset = 0, orderType = 'ASC') { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - let path = '/functions/{functionId}/tags'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Tag - * - * Create a new function code tag. Use this endpoint to upload a new version - * of your code function. To execute your newly uploaded code, you'll need to - * update the function's tag to use your new tag UID. - * - * This endpoint accepts a tar.gz file compressed with your code. Make sure to - * include any dependencies your code has within the compressed file. You can - * learn more about code packaging in the [Appwrite Cloud Functions - * tutorial](/docs/functions). - * - * Use the "command" param to set the entry point used to execute your code. - * - * @param {string} functionId - * @param {string} command - * @param {File} code - * @throws {Error} - * @return {Promise} - */ - createTag: function(functionId, command, code) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - if(command === undefined) { - throw new Error('Missing required parameter: "command"'); - } - - if(code === undefined) { - throw new Error('Missing required parameter: "code"'); - } - - let path = '/functions/{functionId}/tags'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - if(typeof command !== 'undefined') { - payload['command'] = command; - } - - if(typeof code !== 'undefined') { - payload['code'] = code; - } - - return http - .post(path, { - 'content-type': 'multipart/form-data', - }, payload); - }, - - /** - * Get Tag - * - * Get a code tag by its unique ID. - * - * @param {string} functionId - * @param {string} tagId - * @throws {Error} - * @return {Promise} - */ - getTag: function(functionId, tagId) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - if(tagId === undefined) { - throw new Error('Missing required parameter: "tagId"'); - } - - let path = '/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{tagId}', 'g'), tagId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Tag - * - * Delete a code tag by its unique ID. - * - * @param {string} functionId - * @param {string} tagId - * @throws {Error} - * @return {Promise} - */ - deleteTag: function(functionId, tagId) { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - if(tagId === undefined) { - throw new Error('Missing required parameter: "tagId"'); - } - - let path = '/functions/{functionId}/tags/{tagId}'.replace(new RegExp('{functionId}', 'g'), functionId).replace(new RegExp('{tagId}', 'g'), tagId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Function Usage - * - * - * @param {string} functionId - * @param {string} range - * @throws {Error} - * @return {Promise} - */ - getUsage: function(functionId, range = '30d') { - if(functionId === undefined) { - throw new Error('Missing required parameter: "functionId"'); - } - - let path = '/functions/{functionId}/usage'.replace(new RegExp('{functionId}', 'g'), functionId); - - let payload = {}; - - if(range) { - payload['range'] = range; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let health = { - - /** - * Get HTTP - * - * Check the Appwrite HTTP server is up and responsive. - * - * @throws {Error} - * @return {Promise} - */ - get: function() { - let path = '/health'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Anti virus - * - * Check the Appwrite Anti Virus server is up and connection is successful. - * - * @throws {Error} - * @return {Promise} - */ - getAntiVirus: function() { - let path = '/health/anti-virus'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Cache - * - * Check the Appwrite in-memory cache server is up and connection is - * successful. - * - * @throws {Error} - * @return {Promise} - */ - getCache: function() { - let path = '/health/cache'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get DB - * - * Check the Appwrite database server is up and connection is successful. - * - * @throws {Error} - * @return {Promise} - */ - getDB: function() { - let path = '/health/db'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Certificate Queue - * - * Get the number of certificates that are waiting to be issued against - * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue - * server. - * - * @throws {Error} - * @return {Promise} - */ - getQueueCertificates: function() { - let path = '/health/queue/certificates'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Functions Queue - * - * - * @throws {Error} - * @return {Promise} - */ - getQueueFunctions: function() { - let path = '/health/queue/functions'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Logs Queue - * - * Get the number of logs that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws {Error} - * @return {Promise} - */ - getQueueLogs: function() { - let path = '/health/queue/logs'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Tasks Queue - * - * Get the number of tasks that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws {Error} - * @return {Promise} - */ - getQueueTasks: function() { - let path = '/health/queue/tasks'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Usage Queue - * - * Get the number of usage stats that are waiting to be processed in the - * Appwrite internal queue server. - * - * @throws {Error} - * @return {Promise} - */ - getQueueUsage: function() { - let path = '/health/queue/usage'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Webhooks Queue - * - * Get the number of webhooks that are waiting to be processed in the Appwrite - * internal queue server. - * - * @throws {Error} - * @return {Promise} - */ - getQueueWebhooks: function() { - let path = '/health/queue/webhooks'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Local Storage - * - * Check the Appwrite local storage device is up and connection is successful. - * - * @throws {Error} - * @return {Promise} - */ - getStorageLocal: function() { - let path = '/health/storage/local'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Time - * - * 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. - * - * @throws {Error} - * @return {Promise} - */ - getTime: function() { - let path = '/health/time'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let locale = { - - /** - * Get User Locale - * - * Get the current user location based on IP. Returns an object with user - * country code, country name, continent name, continent code, ip address and - * suggested currency. You can use the locale header to get the data in a - * supported language. - * - * ([IP Geolocation by DB-IP](https://db-ip.com)) - * - * @throws {Error} - * @return {Promise} - */ - get: function() { - let path = '/locale'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Continents - * - * List of all continents. You can use the locale header to get the data in a - * supported language. - * - * @throws {Error} - * @return {Promise} - */ - getContinents: function() { - let path = '/locale/continents'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Countries - * - * List of all countries. You can use the locale header to get the data in a - * supported language. - * - * @throws {Error} - * @return {Promise} - */ - getCountries: function() { - let path = '/locale/countries'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List EU Countries - * - * List of all countries that are currently members of the EU. You can use the - * locale header to get the data in a supported language. - * - * @throws {Error} - * @return {Promise} - */ - getCountriesEU: function() { - let path = '/locale/countries/eu'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Countries Phone Codes - * - * List of all countries phone codes. You can use the locale header to get the - * data in a supported language. - * - * @throws {Error} - * @return {Promise} - */ - getCountriesPhones: function() { - let path = '/locale/countries/phones'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Currencies - * - * List of all currencies, including currency symbol, name, plural, and - * decimal digits for all major and minor currencies. You can use the locale - * header to get the data in a supported language. - * - * @throws {Error} - * @return {Promise} - */ - getCurrencies: function() { - let path = '/locale/currencies'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Languages - * - * List of all languages classified by ISO 639-1 including 2-letter code, name - * in English, and name in the respective language. - * - * @throws {Error} - * @return {Promise} - */ - getLanguages: function() { - let path = '/locale/languages'; - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let projects = { - - /** - * List Projects - * - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - list: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/projects'; - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Project - * - * - * @param {string} name - * @param {string} teamId - * @param {string} description - * @param {string} logo - * @param {string} url - * @param {string} legalName - * @param {string} legalCountry - * @param {string} legalState - * @param {string} legalCity - * @param {string} legalAddress - * @param {string} legalTaxId - * @throws {Error} - * @return {Promise} - */ - create: function(name, teamId, description = '', logo = '', url = '', legalName = '', legalCountry = '', legalState = '', legalCity = '', legalAddress = '', legalTaxId = '') { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/projects'; - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof teamId !== 'undefined') { - payload['teamId'] = teamId; - } - - if(typeof description !== 'undefined') { - payload['description'] = description; - } - - if(typeof logo !== 'undefined') { - payload['logo'] = logo; - } - - if(typeof url !== 'undefined') { - payload['url'] = url; - } - - if(typeof legalName !== 'undefined') { - payload['legalName'] = legalName; - } - - if(typeof legalCountry !== 'undefined') { - payload['legalCountry'] = legalCountry; - } - - if(typeof legalState !== 'undefined') { - payload['legalState'] = legalState; - } - - if(typeof legalCity !== 'undefined') { - payload['legalCity'] = legalCity; - } - - if(typeof legalAddress !== 'undefined') { - payload['legalAddress'] = legalAddress; - } - - if(typeof legalTaxId !== 'undefined') { - payload['legalTaxId'] = legalTaxId; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Project - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - get: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Project - * - * - * @param {string} projectId - * @param {string} name - * @param {string} description - * @param {string} logo - * @param {string} url - * @param {string} legalName - * @param {string} legalCountry - * @param {string} legalState - * @param {string} legalCity - * @param {string} legalAddress - * @param {string} legalTaxId - * @throws {Error} - * @return {Promise} - */ - update: function(projectId, name, description = '', logo = '', url = '', legalName = '', legalCountry = '', legalState = '', legalCity = '', legalAddress = '', legalTaxId = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof description !== 'undefined') { - payload['description'] = description; - } - - if(typeof logo !== 'undefined') { - payload['logo'] = logo; - } - - if(typeof url !== 'undefined') { - payload['url'] = url; - } - - if(typeof legalName !== 'undefined') { - payload['legalName'] = legalName; - } - - if(typeof legalCountry !== 'undefined') { - payload['legalCountry'] = legalCountry; - } - - if(typeof legalState !== 'undefined') { - payload['legalState'] = legalState; - } - - if(typeof legalCity !== 'undefined') { - payload['legalCity'] = legalCity; - } - - if(typeof legalAddress !== 'undefined') { - payload['legalAddress'] = legalAddress; - } - - if(typeof legalTaxId !== 'undefined') { - payload['legalTaxId'] = legalTaxId; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Project - * - * - * @param {string} projectId - * @param {string} password - * @throws {Error} - * @return {Promise} - */ - delete: function(projectId, password) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/projects/{projectId}'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(typeof password !== 'undefined') { - payload['password'] = password; - } - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Project users limit - * - * - * @param {string} projectId - * @param {string} limit - * @throws {Error} - * @return {Promise} - */ - updateAuthLimit: function(projectId, limit) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(limit === undefined) { - throw new Error('Missing required parameter: "limit"'); - } - - let path = '/projects/{projectId}/auth/limit'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(typeof limit !== 'undefined') { - payload['limit'] = limit; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Project auth method status. Use this endpoint to enable or disable a given auth method for this project. - * - * - * @param {string} projectId - * @param {string} method - * @param {boolean} status - * @throws {Error} - * @return {Promise} - */ - updateAuthStatus: function(projectId, method, status) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(method === undefined) { - throw new Error('Missing required parameter: "method"'); - } - - if(status === undefined) { - throw new Error('Missing required parameter: "status"'); - } - - let path = '/projects/{projectId}/auth/{method}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{method}', 'g'), method); - - let payload = {}; - - if(typeof status !== 'undefined') { - payload['status'] = status; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Domains - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listDomains: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/domains'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Domain - * - * - * @param {string} projectId - * @param {string} domain - * @throws {Error} - * @return {Promise} - */ - createDomain: function(projectId, domain) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(domain === undefined) { - throw new Error('Missing required parameter: "domain"'); - } - - let path = '/projects/{projectId}/domains'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(typeof domain !== 'undefined') { - payload['domain'] = domain; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Domain - * - * - * @param {string} projectId - * @param {string} domainId - * @throws {Error} - * @return {Promise} - */ - getDomain: function(projectId, domainId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(domainId === undefined) { - throw new Error('Missing required parameter: "domainId"'); - } - - let path = '/projects/{projectId}/domains/{domainId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{domainId}', 'g'), domainId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Domain - * - * - * @param {string} projectId - * @param {string} domainId - * @throws {Error} - * @return {Promise} - */ - deleteDomain: function(projectId, domainId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(domainId === undefined) { - throw new Error('Missing required parameter: "domainId"'); - } - - let path = '/projects/{projectId}/domains/{domainId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{domainId}', 'g'), domainId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Domain Verification Status - * - * - * @param {string} projectId - * @param {string} domainId - * @throws {Error} - * @return {Promise} - */ - updateDomainVerification: function(projectId, domainId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(domainId === undefined) { - throw new Error('Missing required parameter: "domainId"'); - } - - let path = '/projects/{projectId}/domains/{domainId}/verification'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{domainId}', 'g'), domainId); - - let payload = {}; - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Keys - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listKeys: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/keys'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Key - * - * - * @param {string} projectId - * @param {string} name - * @param {string[]} scopes - * @throws {Error} - * @return {Promise} - */ - createKey: function(projectId, name, scopes) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(scopes === undefined) { - throw new Error('Missing required parameter: "scopes"'); - } - - let path = '/projects/{projectId}/keys'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof scopes !== 'undefined') { - payload['scopes'] = scopes; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Key - * - * - * @param {string} projectId - * @param {string} keyId - * @throws {Error} - * @return {Promise} - */ - getKey: function(projectId, keyId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(keyId === undefined) { - throw new Error('Missing required parameter: "keyId"'); - } - - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Key - * - * - * @param {string} projectId - * @param {string} keyId - * @param {string} name - * @param {string[]} scopes - * @throws {Error} - * @return {Promise} - */ - updateKey: function(projectId, keyId, name, scopes) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(keyId === undefined) { - throw new Error('Missing required parameter: "keyId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(scopes === undefined) { - throw new Error('Missing required parameter: "scopes"'); - } - - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof scopes !== 'undefined') { - payload['scopes'] = scopes; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Key - * - * - * @param {string} projectId - * @param {string} keyId - * @throws {Error} - * @return {Promise} - */ - deleteKey: function(projectId, keyId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(keyId === undefined) { - throw new Error('Missing required parameter: "keyId"'); - } - - let path = '/projects/{projectId}/keys/{keyId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{keyId}', 'g'), keyId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Project OAuth2 - * - * - * @param {string} projectId - * @param {string} provider - * @param {string} appId - * @param {string} secret - * @throws {Error} - * @return {Promise} - */ - updateOAuth2: function(projectId, provider, appId = '', secret = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(provider === undefined) { - throw new Error('Missing required parameter: "provider"'); - } - - let path = '/projects/{projectId}/oauth2'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(typeof provider !== 'undefined') { - payload['provider'] = provider; - } - - if(typeof appId !== 'undefined') { - payload['appId'] = appId; - } - - if(typeof secret !== 'undefined') { - payload['secret'] = secret; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Platforms - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listPlatforms: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/platforms'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Platform - * - * - * @param {string} projectId - * @param {string} type - * @param {string} name - * @param {string} key - * @param {string} store - * @param {string} hostname - * @throws {Error} - * @return {Promise} - */ - createPlatform: function(projectId, type, name, key = '', store = '', hostname = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(type === undefined) { - throw new Error('Missing required parameter: "type"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/projects/{projectId}/platforms'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(typeof type !== 'undefined') { - payload['type'] = type; - } - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof key !== 'undefined') { - payload['key'] = key; - } - - if(typeof store !== 'undefined') { - payload['store'] = store; - } - - if(typeof hostname !== 'undefined') { - payload['hostname'] = hostname; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Platform - * - * - * @param {string} projectId - * @param {string} platformId - * @throws {Error} - * @return {Promise} - */ - getPlatform: function(projectId, platformId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(platformId === undefined) { - throw new Error('Missing required parameter: "platformId"'); - } - - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Platform - * - * - * @param {string} projectId - * @param {string} platformId - * @param {string} name - * @param {string} key - * @param {string} store - * @param {string} hostname - * @throws {Error} - * @return {Promise} - */ - updatePlatform: function(projectId, platformId, name, key = '', store = '', hostname = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(platformId === undefined) { - throw new Error('Missing required parameter: "platformId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof key !== 'undefined') { - payload['key'] = key; - } - - if(typeof store !== 'undefined') { - payload['store'] = store; - } - - if(typeof hostname !== 'undefined') { - payload['hostname'] = hostname; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Platform - * - * - * @param {string} projectId - * @param {string} platformId - * @throws {Error} - * @return {Promise} - */ - deletePlatform: function(projectId, platformId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(platformId === undefined) { - throw new Error('Missing required parameter: "platformId"'); - } - - let path = '/projects/{projectId}/platforms/{platformId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{platformId}', 'g'), platformId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Tasks - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listTasks: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/tasks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Task - * - * - * @param {string} projectId - * @param {string} name - * @param {string} status - * @param {string} schedule - * @param {boolean} security - * @param {string} httpMethod - * @param {string} httpUrl - * @param {string[]} httpHeaders - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - createTask: function(projectId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = [], httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(status === undefined) { - throw new Error('Missing required parameter: "status"'); - } - - if(schedule === undefined) { - throw new Error('Missing required parameter: "schedule"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - if(httpMethod === undefined) { - throw new Error('Missing required parameter: "httpMethod"'); - } - - if(httpUrl === undefined) { - throw new Error('Missing required parameter: "httpUrl"'); - } - - let path = '/projects/{projectId}/tasks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof status !== 'undefined') { - payload['status'] = status; - } - - if(typeof schedule !== 'undefined') { - payload['schedule'] = schedule; - } - - if(typeof security !== 'undefined') { - payload['security'] = security; - } - - if(typeof httpMethod !== 'undefined') { - payload['httpMethod'] = httpMethod; - } - - if(typeof httpUrl !== 'undefined') { - payload['httpUrl'] = httpUrl; - } - - if(typeof httpHeaders !== 'undefined') { - payload['httpHeaders'] = httpHeaders; - } - - if(typeof httpUser !== 'undefined') { - payload['httpUser'] = httpUser; - } - - if(typeof httpPass !== 'undefined') { - payload['httpPass'] = httpPass; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Task - * - * - * @param {string} projectId - * @param {string} taskId - * @throws {Error} - * @return {Promise} - */ - getTask: function(projectId, taskId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(taskId === undefined) { - throw new Error('Missing required parameter: "taskId"'); - } - - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Task - * - * - * @param {string} projectId - * @param {string} taskId - * @param {string} name - * @param {string} status - * @param {string} schedule - * @param {boolean} security - * @param {string} httpMethod - * @param {string} httpUrl - * @param {string[]} httpHeaders - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - updateTask: function(projectId, taskId, name, status, schedule, security, httpMethod, httpUrl, httpHeaders = [], httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(taskId === undefined) { - throw new Error('Missing required parameter: "taskId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(status === undefined) { - throw new Error('Missing required parameter: "status"'); - } - - if(schedule === undefined) { - throw new Error('Missing required parameter: "schedule"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - if(httpMethod === undefined) { - throw new Error('Missing required parameter: "httpMethod"'); - } - - if(httpUrl === undefined) { - throw new Error('Missing required parameter: "httpUrl"'); - } - - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof status !== 'undefined') { - payload['status'] = status; - } - - if(typeof schedule !== 'undefined') { - payload['schedule'] = schedule; - } - - if(typeof security !== 'undefined') { - payload['security'] = security; - } - - if(typeof httpMethod !== 'undefined') { - payload['httpMethod'] = httpMethod; - } - - if(typeof httpUrl !== 'undefined') { - payload['httpUrl'] = httpUrl; - } - - if(typeof httpHeaders !== 'undefined') { - payload['httpHeaders'] = httpHeaders; - } - - if(typeof httpUser !== 'undefined') { - payload['httpUser'] = httpUser; - } - - if(typeof httpPass !== 'undefined') { - payload['httpPass'] = httpPass; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Task - * - * - * @param {string} projectId - * @param {string} taskId - * @throws {Error} - * @return {Promise} - */ - deleteTask: function(projectId, taskId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(taskId === undefined) { - throw new Error('Missing required parameter: "taskId"'); - } - - let path = '/projects/{projectId}/tasks/{taskId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{taskId}', 'g'), taskId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Project - * - * - * @param {string} projectId - * @param {string} range - * @throws {Error} - * @return {Promise} - */ - getUsage: function(projectId, range = '30d') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/usage'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(range) { - payload['range'] = range; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * List Webhooks - * - * - * @param {string} projectId - * @throws {Error} - * @return {Promise} - */ - listWebhooks: function(projectId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - let path = '/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Webhook - * - * - * @param {string} projectId - * @param {string} name - * @param {string[]} events - * @param {string} url - * @param {boolean} security - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - createWebhook: function(projectId, name, events, url, security, httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(events === undefined) { - throw new Error('Missing required parameter: "events"'); - } - - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - let path = '/projects/{projectId}/webhooks'.replace(new RegExp('{projectId}', 'g'), projectId); - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof events !== 'undefined') { - payload['events'] = events; - } - - if(typeof url !== 'undefined') { - payload['url'] = url; - } - - if(typeof security !== 'undefined') { - payload['security'] = security; - } - - if(typeof httpUser !== 'undefined') { - payload['httpUser'] = httpUser; - } - - if(typeof httpPass !== 'undefined') { - payload['httpPass'] = httpPass; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Webhook - * - * - * @param {string} projectId - * @param {string} webhookId - * @throws {Error} - * @return {Promise} - */ - getWebhook: function(projectId, webhookId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(webhookId === undefined) { - throw new Error('Missing required parameter: "webhookId"'); - } - - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Webhook - * - * - * @param {string} projectId - * @param {string} webhookId - * @param {string} name - * @param {string[]} events - * @param {string} url - * @param {boolean} security - * @param {string} httpUser - * @param {string} httpPass - * @throws {Error} - * @return {Promise} - */ - updateWebhook: function(projectId, webhookId, name, events, url, security, httpUser = '', httpPass = '') { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(webhookId === undefined) { - throw new Error('Missing required parameter: "webhookId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - if(events === undefined) { - throw new Error('Missing required parameter: "events"'); - } - - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - if(security === undefined) { - throw new Error('Missing required parameter: "security"'); - } - - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof events !== 'undefined') { - payload['events'] = events; - } - - if(typeof url !== 'undefined') { - payload['url'] = url; - } - - if(typeof security !== 'undefined') { - payload['security'] = security; - } - - if(typeof httpUser !== 'undefined') { - payload['httpUser'] = httpUser; - } - - if(typeof httpPass !== 'undefined') { - payload['httpPass'] = httpPass; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Webhook - * - * - * @param {string} projectId - * @param {string} webhookId - * @throws {Error} - * @return {Promise} - */ - deleteWebhook: function(projectId, webhookId) { - if(projectId === undefined) { - throw new Error('Missing required parameter: "projectId"'); - } - - if(webhookId === undefined) { - throw new Error('Missing required parameter: "webhookId"'); - } - - let path = '/projects/{projectId}/webhooks/{webhookId}'.replace(new RegExp('{projectId}', 'g'), projectId).replace(new RegExp('{webhookId}', 'g'), webhookId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let storage = { - - /** - * List Files - * - * Get a list of all the user files. You can use the query params to filter - * your results. On admin mode, this endpoint will return a list of all of the - * project's files. [Learn more about different API modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - listFiles: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/storage/files'; - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create File - * - * Create a new file. The user who creates the file will automatically be - * assigned to read and write access unless he has passed custom values for - * read and write arguments. - * - * @param {File} file - * @param {string[]} read - * @param {string[]} write - * @throws {Error} - * @return {Promise} - */ - createFile: function(file, read, write) { - if(file === undefined) { - throw new Error('Missing required parameter: "file"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/storage/files'; - - let payload = {}; - - if(typeof file !== 'undefined') { - payload['file'] = file; - } - - if(typeof read !== 'undefined') { - payload['read'] = read; - } - - if(typeof write !== 'undefined') { - payload['write'] = write; - } - - return http - .post(path, { - 'content-type': 'multipart/form-data', - }, payload); - }, - - /** - * Get File - * - * Get a file by its unique ID. This endpoint response returns a JSON object - * with the file metadata. - * - * @param {string} fileId - * @throws {Error} - * @return {Promise} - */ - getFile: function(fileId) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update File - * - * Update a file by its unique ID. Only users with write permissions have - * access to update this resource. - * - * @param {string} fileId - * @param {string[]} read - * @param {string[]} write - * @throws {Error} - * @return {Promise} - */ - updateFile: function(fileId, read, write) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - if(read === undefined) { - throw new Error('Missing required parameter: "read"'); - } - - if(write === undefined) { - throw new Error('Missing required parameter: "write"'); - } - - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - if(typeof read !== 'undefined') { - payload['read'] = read; - } - - if(typeof write !== 'undefined') { - payload['write'] = write; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete File - * - * Delete a file by its unique ID. Only users with write permissions have - * access to delete this resource. - * - * @param {string} fileId - * @throws {Error} - * @return {Promise} - */ - deleteFile: function(fileId) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get File for Download - * - * 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. - * - * @param {string} fileId - * @throws {Error} - * @return {string} - */ - getFileDownload: function(fileId) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}/download'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get File Preview - * - * Get a file preview image. Currently, this method supports preview for image - * files (jpg, png, and gif), other supported formats, like pdf, docs, slides, - * and spreadsheets, will return the file icon image. You can also pass query - * string arguments for cutting and resizing your preview image. - * - * @param {string} fileId - * @param {number} width - * @param {number} height - * @param {number} quality - * @param {string} background - * @param {string} output - * @throws {Error} - * @return {string} - */ - getFilePreview: function(fileId, width = 0, height = 0, quality = 100, background = '', output = '') { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}/preview'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - if(width) { - payload['width'] = width; - } - - if(height) { - payload['height'] = height; - } - - if(quality) { - payload['quality'] = quality; - } - - if(background) { - payload['background'] = background; - } - - if(output) { - payload['output'] = output; - } - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - }, - - /** - * Get File for View - * - * Get a file content by its unique ID. This endpoint is similar to the - * download method but returns with no 'Content-Disposition: attachment' - * header. - * - * @param {string} fileId - * @throws {Error} - * @return {string} - */ - getFileView: function(fileId) { - if(fileId === undefined) { - throw new Error('Missing required parameter: "fileId"'); - } - - let path = '/storage/files/{fileId}/view'.replace(new RegExp('{fileId}', 'g'), fileId); - - let payload = {}; - - payload['project'] = config.project; - - payload['key'] = config.key; - - - let query = []; - - for (let p in payload) { - if(Array.isArray(payload[p])) { - for (let index = 0; index < payload[p].length; index++) { - let param = payload[p][index]; - query.push(encodeURIComponent(p + '[]') + "=" + encodeURIComponent(param)); - } - } - else { - query.push(encodeURIComponent(p) + "=" + encodeURIComponent(payload[p])); - } - } - - query = query.join("&"); - - return config.endpoint + path + ((query) ? '?' + query : ''); - } - }; - - let teams = { - - /** - * List Teams - * - * Get a list of all the current user teams. You can use the query params to - * filter your results. On admin mode, this endpoint will return a list of all - * of the project's teams. [Learn more about different API - * modes](/docs/admin). - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - list: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/teams'; - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Team - * - * Create a new team. The user who creates the team will automatically be - * assigned as the owner of the team. The team owner can invite new members, - * who will be able add new owners and update or delete the team from your - * project. - * - * @param {string} name - * @param {string[]} roles - * @throws {Error} - * @return {Promise} - */ - create: function(name, roles = ["owner"]) { - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/teams'; - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof roles !== 'undefined') { - payload['roles'] = roles; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Team - * - * Get a team by its unique ID. All team members have read access for this - * resource. - * - * @param {string} teamId - * @throws {Error} - * @return {Promise} - */ - get: function(teamId) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Team - * - * Update a team by its unique ID. Only team owners have write access for this - * resource. - * - * @param {string} teamId - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - update: function(teamId, name) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(name === undefined) { - throw new Error('Missing required parameter: "name"'); - } - - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - return http - .put(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Team - * - * Delete a team by its unique ID. Only team owners have write access for this - * resource. - * - * @param {string} teamId - * @throws {Error} - * @return {Promise} - */ - delete: function(teamId) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/teams/{teamId}'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get Team Memberships - * - * Get a team members by the team unique ID. All team members have read access - * for this list of resources. - * - * @param {string} teamId - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - getMemberships: function(teamId, search = '', limit = 25, offset = 0, orderType = 'ASC') { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - let path = '/teams/{teamId}/memberships'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create Team Membership - * - * Use this endpoint to invite a new member to join your team. An email with a - * link to join the team will be sent to the new member email address if the - * member doesn't exist in the project it will be created automatically. - * - * Use the 'URL' parameter to redirect the user from the invitation email back - * to your app. When the user is redirected, use the [Update Team Membership - * Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow - * the user to accept the invitation to the team. - * - * Please note that in order to avoid a [Redirect - * Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) - * the only valid redirect URL's are the once from domains you have set when - * added your platforms in the console interface. - * - * @param {string} teamId - * @param {string} email - * @param {string[]} roles - * @param {string} url - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - createMembership: function(teamId, email, roles, url, name = '') { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(roles === undefined) { - throw new Error('Missing required parameter: "roles"'); - } - - if(url === undefined) { - throw new Error('Missing required parameter: "url"'); - } - - let path = '/teams/{teamId}/memberships'.replace(new RegExp('{teamId}', 'g'), teamId); - - let payload = {}; - - if(typeof email !== 'undefined') { - payload['email'] = email; - } - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - if(typeof roles !== 'undefined') { - payload['roles'] = roles; - } - - if(typeof url !== 'undefined') { - payload['url'] = url; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete Team Membership - * - * This endpoint allows a user to leave a team or for a team owner to delete - * the membership of any other team member. You can also use this endpoint to - * delete a user membership even if it is not accepted. - * - * @param {string} teamId - * @param {string} inviteId - * @throws {Error} - * @return {Promise} - */ - deleteMembership: function(teamId, inviteId) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(inviteId === undefined) { - throw new Error('Missing required parameter: "inviteId"'); - } - - let path = '/teams/{teamId}/memberships/{inviteId}'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update Team Membership Status - * - * 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 recieved - * by the user. - * - * @param {string} teamId - * @param {string} inviteId - * @param {string} userId - * @param {string} secret - * @throws {Error} - * @return {Promise} - */ - updateMembershipStatus: function(teamId, inviteId, userId, secret) { - if(teamId === undefined) { - throw new Error('Missing required parameter: "teamId"'); - } - - if(inviteId === undefined) { - throw new Error('Missing required parameter: "inviteId"'); - } - - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(secret === undefined) { - throw new Error('Missing required parameter: "secret"'); - } - - let path = '/teams/{teamId}/memberships/{inviteId}/status'.replace(new RegExp('{teamId}', 'g'), teamId).replace(new RegExp('{inviteId}', 'g'), inviteId); - - let payload = {}; - - if(typeof userId !== 'undefined') { - payload['userId'] = userId; - } - - if(typeof secret !== 'undefined') { - payload['secret'] = secret; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - let users = { - - /** - * List Users - * - * Get a list of all the project's users. You can use the query params to - * filter your results. - * - * @param {string} search - * @param {number} limit - * @param {number} offset - * @param {string} orderType - * @throws {Error} - * @return {Promise} - */ - list: function(search = '', limit = 25, offset = 0, orderType = 'ASC') { - let path = '/users'; - - let payload = {}; - - if(search) { - payload['search'] = search; - } - - if(limit) { - payload['limit'] = limit; - } - - if(offset) { - payload['offset'] = offset; - } - - if(orderType) { - payload['orderType'] = orderType; - } - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Create User - * - * Create a new user. - * - * @param {string} email - * @param {string} password - * @param {string} name - * @throws {Error} - * @return {Promise} - */ - create: function(email, password, name = '') { - if(email === undefined) { - throw new Error('Missing required parameter: "email"'); - } - - if(password === undefined) { - throw new Error('Missing required parameter: "password"'); - } - - let path = '/users'; - - let payload = {}; - - if(typeof email !== 'undefined') { - payload['email'] = email; - } - - if(typeof password !== 'undefined') { - payload['password'] = password; - } - - if(typeof name !== 'undefined') { - payload['name'] = name; - } - - return http - .post(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User - * - * Get a user by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - get: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete User - * - * Delete a user by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - deleteUser: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User Logs - * - * Get a user activity logs list by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getLogs: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/logs'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User Preferences - * - * Get the user preferences by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getPrefs: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update User Preferences - * - * Update the user preferences by its unique ID. You can pass only the - * specific settings you wish to update. - * - * @param {string} userId - * @param {object} prefs - * @throws {Error} - * @return {Promise} - */ - updatePrefs: function(userId, prefs) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(prefs === undefined) { - throw new Error('Missing required parameter: "prefs"'); - } - - let path = '/users/{userId}/prefs'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - if(typeof prefs !== 'undefined') { - payload['prefs'] = prefs; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Get User Sessions - * - * Get the user sessions list by its unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - getSessions: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .get(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete User Sessions - * - * Delete all user's sessions by using the user's unique ID. - * - * @param {string} userId - * @throws {Error} - * @return {Promise} - */ - deleteSessions: function(userId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - let path = '/users/{userId}/sessions'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Delete User Session - * - * Delete a user sessions by its unique ID. - * - * @param {string} userId - * @param {string} sessionId - * @throws {Error} - * @return {Promise} - */ - deleteSession: function(userId, sessionId) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(sessionId === undefined) { - throw new Error('Missing required parameter: "sessionId"'); - } - - let path = '/users/{userId}/sessions/{sessionId}'.replace(new RegExp('{userId}', 'g'), userId).replace(new RegExp('{sessionId}', 'g'), sessionId); - - let payload = {}; - - return http - .delete(path, { - 'content-type': 'application/json', - }, payload); - }, - - /** - * Update User Status - * - * Update the user status by its unique ID. - * - * @param {string} userId - * @param {string} status - * @throws {Error} - * @return {Promise} - */ - updateStatus: function(userId, status) { - if(userId === undefined) { - throw new Error('Missing required parameter: "userId"'); - } - - if(status === undefined) { - throw new Error('Missing required parameter: "status"'); - } - - let path = '/users/{userId}/status'.replace(new RegExp('{userId}', 'g'), userId); - - let payload = {}; - - if(typeof status !== 'undefined') { - payload['status'] = status; - } - - return http - .patch(path, { - 'content-type': 'application/json', - }, payload); - } - }; - - return { - setEndpoint: setEndpoint, - setProject: setProject, - setKey: setKey, - setLocale: setLocale, - setMode: setMode, - account: account, - avatars: avatars, - database: database, - functions: functions, - health: health, - locale: locale, - projects: projects, - storage: storage, - teams: teams, - users: users - }; - }; - - if(typeof module !== "undefined") { - module.exports = window.Appwrite; + return output; + } } -})((typeof window !== "undefined") ? window : {}); \ No newline at end of file + exports.Appwrite = Appwrite; + + return exports; + +}({}, null, window)); diff --git a/public/scripts/services/console.js b/public/scripts/services/console.js index 7a08cc4e2..1904187c2 100644 --- a/public/scripts/services/console.js +++ b/public/scripts/services/console.js @@ -2,10 +2,10 @@ "use strict"; window.ls.container.set('console', function (window) { - var sdk = new window.Appwrite(); + var sdk = new window.Appwrite.Appwrite(); sdk - .setEndpoint(APP_ENV.API) + .setEndpoint(APP_ENV.ENDPOINT + APP_ENV.API) .setProject('console') .setLocale(APP_ENV.LOCALE) ; diff --git a/public/scripts/services/sdk.js b/public/scripts/services/sdk.js index fa3a4fb6d..117c958f8 100644 --- a/public/scripts/services/sdk.js +++ b/public/scripts/services/sdk.js @@ -2,10 +2,10 @@ "use strict"; window.ls.container.set('sdk', function (window, router) { - var sdk = new window.Appwrite(); + var sdk = new window.Appwrite.Appwrite(); sdk - .setEndpoint(APP_ENV.API) + .setEndpoint(APP_ENV.ENDPOINT + APP_ENV.API) .setProject(router.params.project || '') .setLocale(APP_ENV.LOCALE) .setMode('admin') diff --git a/src/Appwrite/Auth/OAuth2/Twitch.php b/src/Appwrite/Auth/OAuth2/Twitch.php index 463bbf917..9608f9f61 100644 --- a/src/Appwrite/Auth/OAuth2/Twitch.php +++ b/src/Appwrite/Auth/OAuth2/Twitch.php @@ -24,7 +24,7 @@ class Twitch extends OAuth2 * @var array */ protected $scopes = [ - 'user:read:email', + 'user:read:email', ]; /** @@ -65,9 +65,7 @@ class Twitch extends OAuth2 { $result = \json_decode($this->request( 'POST', - $this->endpoint . 'token', - [], - \http_build_query([ + $this->endpoint . 'token?'. \http_build_query([ "client_id" => $this->appID, "client_secret" => $this->appSecret, "code" => $code, @@ -139,11 +137,15 @@ class Twitch extends OAuth2 protected function getUser(string $accessToken) { if (empty($this->user)) { - $this->user = \json_decode($this->request( + $response = \json_decode($this->request( 'GET', - $this->resourceEndpoint, - ['Authorization: Bearer '.\urlencode($accessToken)] - ), true)['data']['0']; + $this->resourceEndpoint , [ + 'Authorization: Bearer '.\urlencode($accessToken), + 'Client-Id: '. \urlencode($this->appID) + ] + ), true); + + $this->user = $response['data']['0'] ?? []; } return $this->user; diff --git a/src/Appwrite/Specification/Format/OpenAPI3.php b/src/Appwrite/Specification/Format/OpenAPI3.php index b5724a0ee..b14134cdf 100644 --- a/src/Appwrite/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/Specification/Format/OpenAPI3.php @@ -5,6 +5,7 @@ namespace Appwrite\Specification\Format; use Appwrite\Specification\Format; use Appwrite\Template\Template; use stdClass; +use Utopia\Validator; class OpenAPI3 extends Format { @@ -230,24 +231,24 @@ class OpenAPI3 extends Format switch ((!empty($validator)) ? \get_class($validator) : '') { case 'Utopia\Validator\Text': - $node['schema']['type'] = 'string'; + $node['schema']['type'] = $validator->getType(); $node['schema']['x-example'] = '['.\strtoupper(Template::fromCamelCaseToSnake($node['name'])).']'; break; case 'Utopia\Validator\Boolean': - $node['schema']['type'] = 'boolean'; + $node['schema']['type'] = $validator->getType(); $node['schema']['x-example'] = false; break; case 'Appwrite\Database\Validator\UID': - $node['schema']['type'] = 'string'; + $node['schema']['type'] = $validator->getType(); $node['schema']['x-example'] = '['.\strtoupper(Template::fromCamelCaseToSnake($node['name'])).']'; break; case 'Appwrite\Network\Validator\Email': - $node['schema']['type'] = 'string'; + $node['schema']['type'] = $validator->getType(); $node['schema']['format'] = 'email'; $node['schema']['x-example'] = 'email@example.com'; break; case 'Appwrite\Network\Validator\URL': - $node['schema']['type'] = 'string'; + $node['schema']['type'] = $validator->getType(); $node['schema']['format'] = 'url'; $node['schema']['x-example'] = 'https://example.com'; break; @@ -261,7 +262,7 @@ class OpenAPI3 extends Format break; case 'Utopia\Storage\Validator\File': $consumes = ['multipart/form-data']; - $node['schema']['type'] = 'string'; + $node['schema']['type'] = $validator->getType(); $node['schema']['format'] = 'binary'; break; case 'Utopia\Validator\ArrayList': @@ -271,24 +272,24 @@ class OpenAPI3 extends Format ]; break; case 'Appwrite\Auth\Validator\Password': - $node['schema']['type'] = 'string'; - $node['schema']['format'] = 'format'; + $node['schema']['type'] = $validator->getType(); + $node['schema']['format'] = 'password'; $node['schema']['x-example'] = 'password'; break; case 'Utopia\Validator\Range': /** @var \Utopia\Validator\Range $validator */ - $node['schema']['type'] = 'integer'; - $node['schema']['format'] = 'int32'; + $node['schema']['type'] = $validator->getType() === Validator::TYPE_FLOAT ? 'number': $validator->getType(); + $node['schema']['format'] = $validator->getType() == Validator::TYPE_INTEGER ? 'int32' : 'float'; $node['schema']['x-example'] = $validator->getMin(); break; case 'Utopia\Validator\Numeric': - $node['schema']['type'] = 'integer'; + $node['schema']['type'] = $validator->getType(); $node['schema']['format'] = 'int32'; break; case 'Utopia\Validator\Length': - $node['schema']['type'] = 'string'; + $node['schema']['type'] = $validator->getType(); break; case 'Appwrite\Network\Validator\Host': - $node['schema']['type'] = 'string'; + $node['schema']['type'] = $validator->getType(); $node['schema']['format'] = 'url'; $node['schema']['x-example'] = 'https://example.com'; break; diff --git a/src/Appwrite/Specification/Format/Swagger2.php b/src/Appwrite/Specification/Format/Swagger2.php index 442df921b..54d6e8867 100644 --- a/src/Appwrite/Specification/Format/Swagger2.php +++ b/src/Appwrite/Specification/Format/Swagger2.php @@ -5,6 +5,7 @@ namespace Appwrite\Specification\Format; use Appwrite\Specification\Format; use Appwrite\Template\Template; use stdClass; +use Utopia\Validator; class Swagger2 extends Format { @@ -226,24 +227,24 @@ class Swagger2 extends Format switch ((!empty($validator)) ? \get_class($validator) : '') { case 'Utopia\Validator\Text': - $node['type'] = 'string'; + $node['type'] = $validator->getType(); $node['x-example'] = '['.\strtoupper(Template::fromCamelCaseToSnake($node['name'])).']'; break; case 'Utopia\Validator\Boolean': - $node['type'] = 'boolean'; + $node['type'] = $validator->getType(); $node['x-example'] = false; break; case 'Appwrite\Database\Validator\UID': - $node['type'] = 'string'; + $node['type'] = $validator->getType(); $node['x-example'] = '['.\strtoupper(Template::fromCamelCaseToSnake($node['name'])).']'; break; case 'Appwrite\Network\Validator\Email': - $node['type'] = 'string'; + $node['type'] = $validator->getType(); $node['format'] = 'email'; $node['x-example'] = 'email@example.com'; break; case 'Appwrite\Network\Validator\URL': - $node['type'] = 'string'; + $node['type'] = $validator->getType(); $node['format'] = 'url'; $node['x-example'] = 'https://example.com'; break; @@ -267,25 +268,25 @@ class Swagger2 extends Format ]; break; case 'Appwrite\Auth\Validator\Password': - $node['type'] = 'string'; - $node['format'] = 'format'; + $node['type'] = $validator->getType(); + $node['format'] = 'password'; $node['x-example'] = 'password'; break; case 'Utopia\Validator\Range': /** @var \Utopia\Validator\Range $validator */ - $node['type'] = 'integer'; - $node['format'] = 'int32'; + $node['type'] = $validator->getType() === Validator::TYPE_FLOAT ? 'number': $validator->getType(); + $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'] = 'integer'; + $node['type'] = $validator->getType(); $node['format'] = 'int32'; break; case 'Utopia\Validator\Length': - $node['type'] = 'string'; + $node['type'] = $validator->getType(); break; case 'Appwrite\Network\Validator\Host': - $node['type'] = 'string'; + $node['type'] = $validator->getType(); $node['format'] = 'url'; $node['x-example'] = 'https://example.com'; break; diff --git a/tests/e2e/Services/Account/AccountCustomClientTest.php b/tests/e2e/Services/Account/AccountCustomClientTest.php index 6c4de08fd..77a4f9368 100644 --- a/tests/e2e/Services/Account/AccountCustomClientTest.php +++ b/tests/e2e/Services/Account/AccountCustomClientTest.php @@ -240,6 +240,10 @@ class AccountCustomClientTest extends Scope ]); $this->assertEquals(201, $response['headers']['status-code']); + $this->assertIsArray($response['body']); + $this->assertNotEmpty($response['body']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertNotEmpty($response['body']['userId']); $session = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_'.$this->getProject()['$id']]; diff --git a/tests/resources/docker/docker-compose.yml b/tests/resources/docker/docker-compose.yml index 7a931600c..76d62317a 100644 --- a/tests/resources/docker/docker-compose.yml +++ b/tests/resources/docker/docker-compose.yml @@ -346,7 +346,7 @@ services: - appwrite-influxdb:/var/lib/influxdb:rw telegraf: - image: appwrite/telegraf:1.0.0 + image: appwrite/telegraf:1.1.0 container_name: appwrite-telegraf restart: unless-stopped networks: